diff --git a/lib/services/serviceFabric/LICENSE.txt b/lib/services/serviceFabric/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/serviceFabric/LICENSE.txt +++ b/lib/services/serviceFabric/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/serviceFabric/README.md b/lib/services/serviceFabric/README.md index 6645b5188a..917d95528f 100644 --- a/lib/services/serviceFabric/README.md +++ b/lib/services/serviceFabric/README.md @@ -1,18 +1,41 @@ -# Microsoft Azure SDK for Node.js - Service Fabric - -This project provides a Node.js package for accessing the Azure Service Fabric. Right now it supports: -- **Node.js version: 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-servicefabric -``` - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/WindowsAzure/azure-sdk-for-node) - +--- +uid: azure-servicefabric +summary: *content + +--- +# Microsoft Azure SDK for Node.js - ServiceFabricClient +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-servicefabric +``` + +## How to use + +### Authentication, client creation and getClusterManifest as an example. + +```javascript +const msRest = require("ms-rest"); +const ServiceFabricClient = require("azure-servicefabric"); +const token = ""; +const creds = new msRest.TokenCredentials(token); +const subscriptionId = ""; +const client = new ServiceFabricClient(creds, subscriptionId); +const timeout = 1; +client.getClusterManifest(timeout).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/serviceFabric/lib/models/aadMetadataObject.js b/lib/services/serviceFabric/lib/models/aadMetadataObject.js index ba1953dac6..87db55c728 100644 --- a/lib/services/serviceFabric/lib/models/aadMetadataObject.js +++ b/lib/services/serviceFabric/lib/models/aadMetadataObject.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Azure Active Directory metadata object used for secured connection to * cluster. @@ -21,7 +19,8 @@ class AadMetadataObject { /** * Create a AadMetadataObject. * @member {string} [type] The client authentication method. - * @member {object} [metadata] + * @member {object} [metadata] Azure Active Directory metadata used for + * secured connection to cluster. * @member {string} [metadata.authority] The AAD authority url. * @member {string} [metadata.client] The AAD client application Id. * @member {string} [metadata.cluster] The AAD cluster application Id. diff --git a/lib/services/serviceFabric/lib/models/addRemoveIncrementalNamedPartitionScalingMechanism.js b/lib/services/serviceFabric/lib/models/addRemoveIncrementalNamedPartitionScalingMechanism.js new file mode 100644 index 0000000000..67dba30ed8 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/addRemoveIncrementalNamedPartitionScalingMechanism.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a scaling mechanism for adding or removing named partitions of a + * stateless service. Partition names are in the format '0','1''N-1' + * + * @extends models['ScalingMechanismDescription'] + */ +class AddRemoveIncrementalNamedPartitionScalingMechanism extends models['ScalingMechanismDescription'] { + /** + * Create a AddRemoveIncrementalNamedPartitionScalingMechanism. + * @member {number} minPartitionCount Minimum number of named partitions of + * the service. + * @member {number} maxPartitionCount Maximum number of named partitions of + * the service. + * @member {number} scaleIncrement The number of instances to add or remove + * during a scaling operation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AddRemoveIncrementalNamedPartitionScalingMechanism + * + * @returns {object} metadata of AddRemoveIncrementalNamedPartitionScalingMechanism + * + */ + mapper() { + return { + required: false, + serializedName: 'AddRemoveIncrementalNamedPartition', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingMechanismDescription', + className: 'AddRemoveIncrementalNamedPartitionScalingMechanism', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + minPartitionCount: { + required: true, + serializedName: 'MinPartitionCount', + type: { + name: 'Number' + } + }, + maxPartitionCount: { + required: true, + serializedName: 'MaxPartitionCount', + type: { + name: 'Number' + } + }, + scaleIncrement: { + required: true, + serializedName: 'ScaleIncrement', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AddRemoveIncrementalNamedPartitionScalingMechanism; diff --git a/lib/services/serviceFabric/lib/models/analysisEventMetadata.js b/lib/services/serviceFabric/lib/models/analysisEventMetadata.js new file mode 100644 index 0000000000..a699924e40 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/analysisEventMetadata.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'; + +/** + * Metadata about an Analysis Event. + * + */ +class AnalysisEventMetadata { + /** + * Create a AnalysisEventMetadata. + * @member {moment.duration} [delay] The analysis delay. + * @member {moment.duration} [duration] The duration of analysis. + */ + constructor() { + } + + /** + * Defines the metadata of AnalysisEventMetadata + * + * @returns {object} metadata of AnalysisEventMetadata + * + */ + mapper() { + return { + required: false, + serializedName: 'AnalysisEventMetadata', + type: { + name: 'Composite', + className: 'AnalysisEventMetadata', + modelProperties: { + delay: { + required: false, + serializedName: 'Delay', + type: { + name: 'TimeSpan' + } + }, + duration: { + required: false, + serializedName: 'Duration', + type: { + name: 'TimeSpan' + } + } + } + } + }; + } +} + +module.exports = AnalysisEventMetadata; diff --git a/lib/services/serviceFabric/lib/models/applicationBackupConfigurationInfo.js b/lib/services/serviceFabric/lib/models/applicationBackupConfigurationInfo.js new file mode 100644 index 0000000000..103b5dba73 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationBackupConfigurationInfo.js @@ -0,0 +1,94 @@ +/* + * 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'); + +/** + * Backup configuration information for a specific Service Fabric application + * specifying what backup policy is being applied and suspend description, if + * any. + * + * @extends models['BackupConfigurationInfo'] + */ +class ApplicationBackupConfigurationInfo extends models['BackupConfigurationInfo'] { + /** + * Create a ApplicationBackupConfigurationInfo. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationBackupConfigurationInfo + * + * @returns {object} metadata of ApplicationBackupConfigurationInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'Application', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'BackupConfigurationInfo', + className: 'ApplicationBackupConfigurationInfo', + modelProperties: { + policyName: { + required: false, + serializedName: 'PolicyName', + type: { + name: 'String' + } + }, + policyInheritedFrom: { + required: false, + serializedName: 'PolicyInheritedFrom', + type: { + name: 'String' + } + }, + suspensionInfo: { + required: false, + serializedName: 'SuspensionInfo', + type: { + name: 'Composite', + className: 'BackupSuspensionInfo' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationName: { + required: false, + serializedName: 'ApplicationName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationBackupConfigurationInfo; diff --git a/lib/services/serviceFabric/lib/models/applicationBackupEntity.js b/lib/services/serviceFabric/lib/models/applicationBackupEntity.js new file mode 100644 index 0000000000..6123ca7d96 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationBackupEntity.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Identifies the Service Fabric application which is being backed up. + * + * @extends models['BackupEntity'] + */ +class ApplicationBackupEntity extends models['BackupEntity'] { + /** + * Create a ApplicationBackupEntity. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationBackupEntity + * + * @returns {object} metadata of ApplicationBackupEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'Application', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'EntityKind', + clientName: 'entityKind' + }, + uberParent: 'BackupEntity', + className: 'ApplicationBackupEntity', + modelProperties: { + entityKind: { + required: true, + serializedName: 'EntityKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationName: { + required: false, + serializedName: 'ApplicationName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationBackupEntity; diff --git a/lib/services/serviceFabric/lib/models/applicationCapacityDescription.js b/lib/services/serviceFabric/lib/models/applicationCapacityDescription.js index 0a9e992a4e..f6959f22bb 100644 --- a/lib/services/serviceFabric/lib/models/applicationCapacityDescription.js +++ b/lib/services/serviceFabric/lib/models/applicationCapacityDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes capacity information for services of this application. This * description can be used for describing the following. @@ -21,7 +19,6 @@ const models = require('./index'); * - Limiting the custom capacity metrics to limit the total consumption of * this metric by the services of this application * - * */ class ApplicationCapacityDescription { /** @@ -37,7 +34,8 @@ class ApplicationCapacityDescription { * 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 {array} [applicationMetrics] + * @member {array} [applicationMetrics] List of application capacity metric + * description. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationCreatedEvent.js b/lib/services/serviceFabric/lib/models/applicationCreatedEvent.js new file mode 100644 index 0000000000..bcf2a77ba4 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationCreatedEvent.js @@ -0,0 +1,113 @@ +/* + * 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'); + +/** + * Application Created event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationCreatedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationCreatedEvent. + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {string} applicationDefinitionKind Application definition kind. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationCreatedEvent + * + * @returns {object} metadata of ApplicationCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + }, + applicationDefinitionKind: { + required: true, + serializedName: 'ApplicationDefinitionKind', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationDeletedEvent.js b/lib/services/serviceFabric/lib/models/applicationDeletedEvent.js new file mode 100644 index 0000000000..1e7137b09d --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationDeletedEvent.js @@ -0,0 +1,105 @@ +/* + * 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'); + +/** + * Application Deleted event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationDeletedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationDeletedEvent. + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationDeletedEvent + * + * @returns {object} metadata of ApplicationDeletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationDeleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationDeletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationDeletedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationDescription.js b/lib/services/serviceFabric/lib/models/applicationDescription.js index 9ad43310f6..ac4ee94c08 100644 --- a/lib/services/serviceFabric/lib/models/applicationDescription.js +++ b/lib/services/serviceFabric/lib/models/applicationDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes a Service Fabric application. * @@ -19,11 +17,23 @@ const models = require('./index'); class ApplicationDescription { /** * Create a ApplicationDescription. - * @member {string} name - * @member {string} typeName - * @member {string} typeVersion - * @member {array} [parameterList] - * @member {object} [applicationCapacity] + * @member {string} name The name of the application, including the 'fabric:' + * URI scheme. + * @member {string} typeName The application type name as defined in the + * application manifest. + * @member {string} typeVersion The version of the application type as + * defined in the application manifest. + * @member {array} [parameterList] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * @member {object} [applicationCapacity] Describes capacity information for + * services of this application. This description can be used for describing + * the following. + * - Reserving the capacity for the services on the nodes + * - Limiting the total number of nodes that services of this application can + * run on + * - Limiting the custom capacity metrics to limit the total consumption of + * this metric by the services of this application * @member {number} [applicationCapacity.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 @@ -35,7 +45,8 @@ class ApplicationDescription { * 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. - * @member {array} [applicationCapacity.applicationMetrics] + * @member {array} [applicationCapacity.applicationMetrics] List of + * application capacity metric description. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationEvent.js b/lib/services/serviceFabric/lib/models/applicationEvent.js new file mode 100644 index 0000000000..ec73ad890c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationEvent.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Application Events. + * + * @extends models['FabricEvent'] + */ +class ApplicationEvent extends models['FabricEvent'] { + /** + * Create a ApplicationEvent. + * @member {string} applicationId The identity of the application. This is an + * encoded representation of the application name. This is used in the REST + * APIs to identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" + * in previous versions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationEvent + * + * @returns {object} metadata of ApplicationEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationHealth.js b/lib/services/serviceFabric/lib/models/applicationHealth.js index 5008af00f0..1d6e419f15 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealth.js +++ b/lib/services/serviceFabric/lib/models/applicationHealth.js @@ -22,7 +22,8 @@ const models = require('./index'); class ApplicationHealth extends models['EntityHealth'] { /** * Create a ApplicationHealth. - * @member {string} [name] + * @member {string} [name] The name of the application, including the + * 'fabric:' URI scheme. * @member {array} [serviceHealthStates] Service health states as found in * the health store. * @member {array} [deployedApplicationHealthStates] Deployed application diff --git a/lib/services/serviceFabric/lib/models/applicationHealthEvaluation.js b/lib/services/serviceFabric/lib/models/applicationHealthEvaluation.js index a1bb40d5dc..cd8d63a749 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthEvaluation.js @@ -22,8 +22,12 @@ const models = require('./index'); class ApplicationHealthEvaluation extends models['HealthEvaluation'] { /** * Create a ApplicationHealthEvaluation. - * @member {string} [applicationName] - * @member {array} [unhealthyEvaluations] + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the application. The types + * of the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, + * ServicesHealthEvaluation or EventHealthEvaluation. */ constructor() { super(); @@ -41,6 +45,11 @@ class ApplicationHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Application', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'ApplicationHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -60,6 +69,7 @@ class ApplicationHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/applicationHealthPolicies.js b/lib/services/serviceFabric/lib/models/applicationHealthPolicies.js index 523098d0e6..6e88f4a5f9 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthPolicies.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthPolicies.js @@ -10,18 +10,17 @@ 'use strict'; -const models = require('./index'); - /** * Defines the application health policy map used to evaluate the health of an * application or one of its children entities. * - * */ class ApplicationHealthPolicies { /** * Create a ApplicationHealthPolicies. - * @member {array} [applicationHealthPolicyMap] + * @member {array} [applicationHealthPolicyMap] The wrapper that contains the + * map with application health policies used to evaluate specific + * applications in the cluster. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationHealthPolicy.js b/lib/services/serviceFabric/lib/models/applicationHealthPolicy.js index f26e60a3e7..037eade3c7 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthPolicy.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthPolicy.js @@ -10,13 +10,10 @@ 'use strict'; -const models = require('./index'); - /** * Defines a health policy used to evaluate the health of an application or one * of its children entities. * - * */ class ApplicationHealthPolicy { /** @@ -33,9 +30,9 @@ class ApplicationHealthPolicy { * 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. - * . Default value: 0 . - * @member {object} [defaultServiceTypeHealthPolicy] + * nodes. Default percentage is zero. Default value: 0 . + * @member {object} [defaultServiceTypeHealthPolicy] The health policy used + * by default to evaluate the health of a service type. * @member {number} * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. @@ -76,7 +73,8 @@ class ApplicationHealthPolicy { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [serviceTypeHealthPolicyMap] + * @member {array} [serviceTypeHealthPolicyMap] The map with service type + * health policy per service type name. The map is empty by default. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationHealthPolicyMapItem.js b/lib/services/serviceFabric/lib/models/applicationHealthPolicyMapItem.js index 12c0600081..f04a6d8a3b 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthPolicyMapItem.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthPolicyMapItem.js @@ -10,18 +10,17 @@ 'use strict'; -const models = require('./index'); - /** * Defines an item in ApplicationHealthPolicyMap. * - * */ class ApplicationHealthPolicyMapItem { /** * Create a ApplicationHealthPolicyMapItem. - * @member {string} key - * @member {object} value + * @member {string} key The key of the application health policy map item. + * This is the name of the application. + * @member {object} value The value of the application health policy map + * item. This is the ApplicationHealthPolicy for this application. * @member {boolean} [value.considerWarningAsError] Indicates whether * warnings are treated with the same severity as errors. * @member {number} [value.maxPercentUnhealthyDeployedApplications] The @@ -35,7 +34,8 @@ class ApplicationHealthPolicyMapItem { * deployed on in the cluster. * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. - * @member {object} [value.defaultServiceTypeHealthPolicy] + * @member {object} [value.defaultServiceTypeHealthPolicy] The health policy + * used by default to evaluate the health of a service type. * @member {number} * [value.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. @@ -76,7 +76,8 @@ class ApplicationHealthPolicyMapItem { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [value.serviceTypeHealthPolicyMap] + * @member {array} [value.serviceTypeHealthPolicyMap] The map with service + * type health policy per service type name. The map is empty by default. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/applicationHealthReportCreatedEvent.js new file mode 100644 index 0000000000..a721add24a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationHealthReportCreatedEvent.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'); + +/** + * Application Health Report Created event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationHealthReportCreatedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationHealthReportCreatedEvent. + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationHealthReportCreatedEvent + * + * @returns {object} metadata of ApplicationHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationInstanceId: { + required: true, + serializedName: 'ApplicationInstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ApplicationHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/applicationHealthReportExpiredEvent.js new file mode 100644 index 0000000000..d1048af4a2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationHealthReportExpiredEvent.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'); + +/** + * Application Health Report Expired event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationHealthReportExpiredEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationHealthReportExpiredEvent. + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationHealthReportExpiredEvent + * + * @returns {object} metadata of ApplicationHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationInstanceId: { + required: true, + serializedName: 'ApplicationInstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ApplicationHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationHealthState.js b/lib/services/serviceFabric/lib/models/applicationHealthState.js index 689d7efdc2..bcd0181cdd 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthState.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthState.js @@ -16,13 +16,13 @@ const models = require('./index'); * Represents the health state of an application, which contains the * application identifier and the aggregated health state. * - * * @extends models['EntityHealthState'] */ class ApplicationHealthState extends models['EntityHealthState'] { /** * Create a ApplicationHealthState. - * @member {string} [name] + * @member {string} [name] The name of the application, including the + * 'fabric:' URI scheme. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/applicationHealthStateChunk.js b/lib/services/serviceFabric/lib/models/applicationHealthStateChunk.js index 14699cf73d..f401c2eea1 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthStateChunk.js @@ -18,18 +18,23 @@ const models = require('./index'); * aggregated health state and any children services and deployed applications * that respect the filters in cluster health chunk query description. * - * * @extends models['EntityHealthStateChunk'] */ class ApplicationHealthStateChunk extends models['EntityHealthStateChunk'] { /** * Create a ApplicationHealthStateChunk. - * @member {string} [applicationName] - * @member {string} [applicationTypeName] - * @member {object} [serviceHealthStateChunks] + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [applicationTypeName] The application type name as + * defined in the application manifest. + * @member {object} [serviceHealthStateChunks] The list of service health + * state chunks in the cluster that respect the filters in the cluster health + * chunk query description. * @member {array} [serviceHealthStateChunks.items] The list of service * health state chunks that respect the input filters in the chunk query. - * @member {object} [deployedApplicationHealthStateChunks] + * @member {object} [deployedApplicationHealthStateChunks] The list of + * deployed application health state chunks in the cluster that respect the + * filters in the cluster health chunk query description. * @member {array} [deployedApplicationHealthStateChunks.items] The list of * deployed application health state chunks that respect the input filters in * the chunk query. diff --git a/lib/services/serviceFabric/lib/models/applicationHealthStateChunkList.js b/lib/services/serviceFabric/lib/models/applicationHealthStateChunkList.js index 48f0037a0b..522a185604 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthStateChunkList.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthStateChunkList.js @@ -17,7 +17,6 @@ const models = require('./index'); * input filters in the chunk query. Returned by get cluster health state * chunks query. * - * * @extends models['EntityHealthStateChunkList'] */ class ApplicationHealthStateChunkList extends models['EntityHealthStateChunkList'] { diff --git a/lib/services/serviceFabric/lib/models/applicationHealthStateFilter.js b/lib/services/serviceFabric/lib/models/applicationHealthStateFilter.js index d6591ca0fa..42e317030e 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthStateFilter.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthStateFilter.js @@ -10,15 +10,12 @@ 'use strict'; -const models = require('./index'); - /** * Defines matching criteria to determine whether a application should be * included in the cluster health chunk. * One filter can match zero, one or multiple applications, depending on its * properties. * - * */ class ApplicationHealthStateFilter { /** @@ -51,7 +48,7 @@ class ApplicationHealthStateFilter { * If not specified, default value is None, unless the application name or * the application type name are specified. If the filter has default value * and application name is specified, the matching application is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches applications with * HealthState value of OK (2) and Warning (4). @@ -66,8 +63,7 @@ class ApplicationHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The * value is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [serviceFilters] Defines a list of filters that specify * which services to be included in the returned cluster health chunk as * children of the application. The services are returned only if the parent diff --git a/lib/services/serviceFabric/lib/models/applicationInfo.js b/lib/services/serviceFabric/lib/models/applicationInfo.js index 58b39e6f10..b617661501 100644 --- a/lib/services/serviceFabric/lib/models/applicationInfo.js +++ b/lib/services/serviceFabric/lib/models/applicationInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a Service Fabric application. * @@ -19,17 +17,30 @@ const models = require('./index'); class ApplicationInfo { /** * Create a ApplicationInfo. - * @member {string} [id] - * @member {string} [name] - * @member {string} [typeName] - * @member {string} [typeVersion] - * @member {string} [status] Possible values include: 'Invalid', 'Ready', - * 'Upgrading', 'Creating', 'Deleting', 'Failed' - * @member {array} [parameters] - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [applicationDefinitionKind] Possible values include: - * 'Invalid', 'ServiceFabricApplicationDescription', 'Compose' + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" + * in previous versions. + * @member {string} [name] The name of the application, including the + * 'fabric:' URI scheme. + * @member {string} [typeName] The application type name as defined in the + * application manifest. + * @member {string} [typeVersion] The version of the application type as + * defined in the application manifest. + * @member {string} [status] The status of the application. Possible values + * include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {array} [parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [applicationDefinitionKind] The mechanism used to define + * a Service Fabric application. Possible values include: 'Invalid', + * 'ServiceFabricApplicationDescription', 'Compose' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationLoadInfo.js b/lib/services/serviceFabric/lib/models/applicationLoadInfo.js index 283e6a9f58..5bd9f01217 100644 --- a/lib/services/serviceFabric/lib/models/applicationLoadInfo.js +++ b/lib/services/serviceFabric/lib/models/applicationLoadInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Load Information about a Service Fabric application. * @@ -19,7 +17,13 @@ const models = require('./index'); class ApplicationLoadInfo { /** * Create a ApplicationLoadInfo. - * @member {string} [id] + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" + * in previous versions. * @member {number} [minimumNodes] The minimum number of nodes for this * application. * It is the number of nodes where Service Fabric will reserve Capacity in @@ -36,7 +40,8 @@ class ApplicationLoadInfo { * is instantiated. * For applications that do not have application capacity defined this value * will be zero. - * @member {array} [applicationLoadMetricInformation] + * @member {array} [applicationLoadMetricInformation] List of application + * capacity metric description. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationMetricDescription.js b/lib/services/serviceFabric/lib/models/applicationMetricDescription.js index 245e2e4586..7bd3095da3 100644 --- a/lib/services/serviceFabric/lib/models/applicationMetricDescription.js +++ b/lib/services/serviceFabric/lib/models/applicationMetricDescription.js @@ -15,7 +15,6 @@ * can be used to limit the total consumption of this metric by the services of * this application. * - * */ class ApplicationMetricDescription { /** diff --git a/lib/services/serviceFabric/lib/models/applicationNameInfo.js b/lib/services/serviceFabric/lib/models/applicationNameInfo.js index c4013e17c7..3af6929198 100644 --- a/lib/services/serviceFabric/lib/models/applicationNameInfo.js +++ b/lib/services/serviceFabric/lib/models/applicationNameInfo.js @@ -17,8 +17,15 @@ class ApplicationNameInfo { /** * Create a ApplicationNameInfo. - * @member {string} [id] - * @member {string} [name] + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" + * in previous versions. + * @member {string} [name] The name of the application, including the + * 'fabric:' URI scheme. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/applicationResourceDescription.js b/lib/services/serviceFabric/lib/models/applicationResourceDescription.js new file mode 100644 index 0000000000..44ab255e87 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationResourceDescription.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'; + +/** + * Describes a service fabric application resource. + * + */ +class ApplicationResourceDescription { + /** + * Create a ApplicationResourceDescription. + * @member {string} [description] User readable description of the + * application. + * @member {string} [debugParams] Internal use. + * @member {array} [services] describes the services in the application. + * @member {string} [healthState] Describes the health state of an + * application resource. Possible values include: 'Invalid', 'Ok', 'Warning', + * 'Error', 'Unknown' + * @member {string} [unhealthyEvaluation] When the application's health state + * is not 'Ok', this additional details from service fabric Health Manager + * for the user to know why the application is marked unhealthy. + * @member {string} [status] Status of the application resource. Possible + * values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', + * 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the application deployment. + * @member {array} [serviceNames] Names of the services in the application. + * @member {object} [diagnostics] Describes the diagnostics definition and + * usage for an application resource. + * @member {array} [diagnostics.sinks] List of supported sinks that can be + * referenced. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.defaultSinkRefs] The sinks to be used if + * diagnostics is enabled. Sink choices can be overridden at the service and + * code package level. + * @member {string} name Application resource name. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationResourceDescription + * + * @returns {object} metadata of ApplicationResourceDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationResourceDescription', + type: { + name: 'Composite', + className: 'ApplicationResourceDescription', + modelProperties: { + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + debugParams: { + required: false, + serializedName: 'properties.debugParams', + type: { + name: 'String' + } + }, + services: { + required: false, + serializedName: 'properties.services', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceResourceDescription' + } + } + } + }, + healthState: { + required: false, + readOnly: true, + serializedName: 'properties.healthState', + type: { + name: 'String' + } + }, + unhealthyEvaluation: { + required: false, + readOnly: true, + serializedName: 'properties.unhealthyEvaluation', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'properties.statusDetails', + type: { + name: 'String' + } + }, + serviceNames: { + required: false, + readOnly: true, + serializedName: 'properties.serviceNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + diagnostics: { + required: false, + serializedName: 'properties.diagnostics', + type: { + name: 'Composite', + className: 'DiagnosticsDescription' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationResourceDescription; diff --git a/lib/services/serviceFabric/lib/models/applicationTypeApplicationsHealthEvaluation.js b/lib/services/serviceFabric/lib/models/applicationTypeApplicationsHealthEvaluation.js index 4f24256117..74aadd25f7 100644 --- a/lib/services/serviceFabric/lib/models/applicationTypeApplicationsHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/applicationTypeApplicationsHealthEvaluation.js @@ -25,13 +25,17 @@ const models = require('./index'); class ApplicationTypeApplicationsHealthEvaluation extends models['HealthEvaluation'] { /** * Create a ApplicationTypeApplicationsHealthEvaluation. - * @member {string} [applicationTypeName] + * @member {string} [applicationTypeName] The application type name as + * defined in the application manifest. * @member {number} [maxPercentUnhealthyApplications] Maximum allowed * percentage of unhealthy applications for the application type, specified * as an entry in ApplicationTypeHealthPolicyMap. * @member {number} [totalCount] Total number of applications of the * application type found in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ApplicationHealthEvaluation of this application type that impacted the + * aggregated health. */ constructor() { super(); @@ -49,6 +53,11 @@ class ApplicationTypeApplicationsHealthEvaluation extends models['HealthEvaluati serializedName: 'ApplicationTypeApplications', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'ApplicationTypeApplicationsHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -68,6 +77,7 @@ class ApplicationTypeApplicationsHealthEvaluation extends models['HealthEvaluati kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/applicationTypeHealthPolicyMapItem.js b/lib/services/serviceFabric/lib/models/applicationTypeHealthPolicyMapItem.js index 556c46d4a8..05e0facfa3 100644 --- a/lib/services/serviceFabric/lib/models/applicationTypeHealthPolicyMapItem.js +++ b/lib/services/serviceFabric/lib/models/applicationTypeHealthPolicyMapItem.js @@ -13,7 +13,6 @@ /** * Defines an item in ApplicationTypeHealthPolicyMap. * - * */ class ApplicationTypeHealthPolicyMapItem { /** diff --git a/lib/services/serviceFabric/lib/models/applicationTypeInfo.js b/lib/services/serviceFabric/lib/models/applicationTypeInfo.js index fd837207b5..f9ad8230c8 100644 --- a/lib/services/serviceFabric/lib/models/applicationTypeInfo.js +++ b/lib/services/serviceFabric/lib/models/applicationTypeInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about an application type. * @@ -19,13 +17,19 @@ const models = require('./index'); class ApplicationTypeInfo { /** * Create a ApplicationTypeInfo. - * @member {string} [name] - * @member {string} [version] - * @member {array} [defaultParameterList] - * @member {string} [status] Possible values include: 'Invalid', - * 'Provisioning', 'Available', 'Unprovisioning', 'Failed' - * @member {string} [statusDetails] - * @member {string} [applicationTypeDefinitionKind] Possible values include: + * @member {string} [name] The application type name as defined in the + * application manifest. + * @member {string} [version] The version of the application type as defined + * in the application manifest. + * @member {array} [defaultParameterList] List of application type parameters + * that can be overridden when creating or updating the application. + * @member {string} [status] The status of the application type. Possible + * values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', + * 'Failed' + * @member {string} [statusDetails] Additional detailed information about the + * status of the application type. + * @member {string} [applicationTypeDefinitionKind] The mechanism used to + * define a Service Fabric application type. Possible values include: * 'Invalid', 'ServiceFabricApplicationPackage', 'Compose' */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeCompleteEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeCompleteEvent.js new file mode 100644 index 0000000000..c170d9bf04 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeCompleteEvent.js @@ -0,0 +1,114 @@ +/* + * 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'); + +/** + * Application Upgrade Complete event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeCompleteEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeCompleteEvent. + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in + * milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationUpgradeCompleteEvent + * + * @returns {object} metadata of ApplicationUpgradeCompleteEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeComplete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeCompleteEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + }, + overallUpgradeElapsedTimeInMs: { + required: true, + serializedName: 'OverallUpgradeElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationUpgradeCompleteEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeDescription.js b/lib/services/serviceFabric/lib/models/applicationUpgradeDescription.js index 559db2bbc7..e0d86756a6 100644 --- a/lib/services/serviceFabric/lib/models/applicationUpgradeDescription.js +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeDescription.js @@ -10,16 +10,14 @@ 'use strict'; -const models = require('./index'); - /** - * Describes the parameters for an application upgrade. Please note that - * upgrade description replaces the existing application description. This - * means that if the parameters are not specified, the existing parameters on - * the applications will be overwritten with the empty parameters list. This - * would results in application using the default value of the parameters from - * the application manifest. If you do not want to change any existing - * parameter values, please get the application parameters first using the + * Describes the parameters for an application upgrade. Note that upgrade + * description replaces the existing application description. This means that + * if the parameters are not specified, the existing parameters on the + * applications will be overwritten with the empty parameters list. This would + * result in the application using the default value of the parameters from the + * application manifest. If you do not want to change any existing parameter + * values, please get the application parameters first using the * GetApplicationInfo query and then supply those values as Parameters in this * ApplicationUpgradeDescription. * @@ -27,26 +25,68 @@ const models = require('./index'); class ApplicationUpgradeDescription { /** * Create a ApplicationUpgradeDescription. - * @member {string} name - * @member {string} targetApplicationTypeVersion - * @member {array} parameters - * @member {string} upgradeKind Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', + * @member {string} name The name of the target application, including the + * 'fabric:' URI scheme. + * @member {string} targetApplicationTypeVersion The target application type + * version (found in the application manifest) for the application upgrade. + * @member {array} parameters List of application parameters with overridden + * values from their default values specified in the application manifest. + * @member {string} upgradeKind The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health + * during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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} [monitoringPolicy] Describes the parameters for + * monitoring an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} - * [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * [monitoringPolicy.healthCheckStableDurationInMilliseconds] 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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 {boolean} [applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @member {number} @@ -62,6 +102,8 @@ class ApplicationUpgradeDescription { * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. @@ -102,7 +144,9 @@ class ApplicationUpgradeDescription { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @member {array} [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/serviceFabric/lib/models/applicationUpgradeDomainCompleteEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeDomainCompleteEvent.js new file mode 100644 index 0000000000..b8673fb9e0 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeDomainCompleteEvent.js @@ -0,0 +1,139 @@ +/* + * 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'); + +/** + * Application Upgrade Domain Complete event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeDomainCompleteEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeDomainCompleteEvent. + * @member {string} applicationTypeName Application type name. + * @member {string} currentApplicationTypeVersion Current Application type + * version. + * @member {string} applicationTypeVersion Target Application type version. + * @member {string} upgradeState State of upgrade. + * @member {string} upgradeDomains Upgrade domains. + * @member {number} upgradeDomainElapsedTimeInMs Upgrade time of domain in + * milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationUpgradeDomainCompleteEvent + * + * @returns {object} metadata of ApplicationUpgradeDomainCompleteEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeDomainComplete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeDomainCompleteEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + currentApplicationTypeVersion: { + required: true, + serializedName: 'CurrentApplicationTypeVersion', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + }, + upgradeState: { + required: true, + serializedName: 'UpgradeState', + type: { + name: 'String' + } + }, + upgradeDomains: { + required: true, + serializedName: 'UpgradeDomains', + type: { + name: 'String' + } + }, + upgradeDomainElapsedTimeInMs: { + required: true, + serializedName: 'UpgradeDomainElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationUpgradeDomainCompleteEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeProgressInfo.js b/lib/services/serviceFabric/lib/models/applicationUpgradeProgressInfo.js index 00b1f52b92..3267490e74 100644 --- a/lib/services/serviceFabric/lib/models/applicationUpgradeProgressInfo.js +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeProgressInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the parameters for an application upgrade. * @@ -19,42 +17,105 @@ const models = require('./index'); class ApplicationUpgradeProgressInfo { /** * Create a ApplicationUpgradeProgressInfo. - * @member {string} [name] - * @member {string} [typeName] - * @member {string} [targetApplicationTypeVersion] - * @member {array} [upgradeDomains] - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', + * @member {string} [name] The name of the target application, including the + * 'fabric:' URI scheme. + * @member {string} [typeName] The application type name as defined in the + * application manifest. + * @member {string} [targetApplicationTypeVersion] The target application + * type version (found in the application manifest) for the application + * upgrade. + * @member {array} [upgradeDomains] List of upgrade domains and their + * statuses. + * @member {string} [upgradeState] The state of the upgrade domain. Possible + * values include: 'Invalid', 'RollingBackInProgress', + * 'RollingBackCompleted', 'RollingForwardPending', * 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed' - * @member {string} [nextUpgradeDomain] - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', + * @member {string} [nextUpgradeDomain] The name of the next upgrade domain + * to be processed. + * @member {string} [rollingUpgradeMode] The mode used to monitor health + * during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: * 'UnmonitoredAuto' . - * @member {object} [upgradeDescription] - * @member {string} [upgradeDescription.name] - * @member {string} [upgradeDescription.targetApplicationTypeVersion] - * @member {array} [upgradeDescription.parameters] - * @member {string} [upgradeDescription.upgradeKind] Possible values include: - * 'Invalid', 'Rolling' - * @member {string} [upgradeDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {object} [upgradeDescription] Describes the parameters for an + * application upgrade. Note that upgrade description replaces the existing + * application description. This means that if the parameters are not + * specified, the existing parameters on the applications will be overwritten + * with the empty parameters list. This would result in the application using + * the default value of the parameters from the application manifest. If you + * do not want to change any existing parameter values, please get the + * application parameters first using the GetApplicationInfo query and then + * supply those values as Parameters in this ApplicationUpgradeDescription. + * @member {string} [upgradeDescription.name] The name of the target + * application, including the 'fabric:' URI scheme. + * @member {string} [upgradeDescription.targetApplicationTypeVersion] The + * target application type version (found in the application manifest) for + * the application upgrade. + * @member {array} [upgradeDescription.parameters] List of application + * parameters with overridden values from their default values specified in + * the application manifest. + * @member {string} [upgradeDescription.upgradeKind] The kind of upgrade out + * of the following possible values. Possible values include: 'Invalid', + * 'Rolling' + * @member {string} [upgradeDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * @member {number} - * [upgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [upgradeDescription.forceRestart] - * @member {object} [upgradeDescription.monitoringPolicy] - * @member {string} [upgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [upgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [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 {object} [upgradeDescription.monitoringPolicy] Describes the + * parameters for monitoring an upgrade in Monitored mode. + * @member {string} [upgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} * [upgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} - * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] 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} * [upgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [upgradeDescription.applicationHealthPolicy] + * 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} [upgradeDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * @member {boolean} * [upgradeDescription.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. @@ -72,6 +133,8 @@ class ApplicationUpgradeProgressInfo { * nodes. Default percentage is zero. * @member {object} * [upgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} * [upgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. @@ -114,23 +177,34 @@ class ApplicationUpgradeProgressInfo { * services. Default percentage is zero. * @member {array} * [upgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * @member {string} [upgradeDurationInMilliseconds] The estimated total * amount of time spent processing the overall upgrade. * @member {string} [upgradeDomainDurationInMilliseconds] The estimated total * amount of time spent processing the current upgrade domain. - * @member {array} [unhealthyEvaluations] - * @member {object} [currentUpgradeDomainProgress] - * @member {string} [currentUpgradeDomainProgress.domainName] + * @member {array} [unhealthyEvaluations] List of health evaluations that + * resulted in the current aggregated health state. + * @member {object} [currentUpgradeDomainProgress] Information about the + * current in-progress upgrade domain. + * @member {string} [currentUpgradeDomainProgress.domainName] The name of the + * upgrade domain * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] + * List of upgrading nodes and their statuses * @member {string} [startTimestampUtc] The estimated UTC datetime when the * upgrade started. * @member {string} [failureTimestampUtc] The estimated UTC datetime when the * upgrade failed and FailureAction was executed. - * @member {string} [failureReason] Possible values include: 'None', - * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'UpgradeTimeout' - * @member {object} [upgradeDomainProgressAtFailure] - * @member {string} [upgradeDomainProgressAtFailure.domainName] + * @member {string} [failureReason] The cause of an upgrade failure that + * resulted in FailureAction being executed. Possible values include: 'None', + * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', + * 'OverallUpgradeTimeout' + * @member {object} [upgradeDomainProgressAtFailure] Information about the + * upgrade domain progress at the time of upgrade failure. + * @member {string} [upgradeDomainProgressAtFailure.domainName] The name of + * the upgrade domain * @member {array} [upgradeDomainProgressAtFailure.nodeUpgradeProgressList] + * List of upgrading nodes and their statuses * @member {string} [upgradeStatusDetails] Additional detailed information * about the status of the pending upgrade. */ diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackCompleteEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackCompleteEvent.js new file mode 100644 index 0000000000..7006904206 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackCompleteEvent.js @@ -0,0 +1,122 @@ +/* + * 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'); + +/** + * Application Upgrade Rollback Complete event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeRollbackCompleteEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeRollbackCompleteEvent. + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {string} failureReason Describes reason of failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in + * milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationUpgradeRollbackCompleteEvent + * + * @returns {object} metadata of ApplicationUpgradeRollbackCompleteEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeRollbackComplete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeRollbackCompleteEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + }, + failureReason: { + required: true, + serializedName: 'FailureReason', + type: { + name: 'String' + } + }, + overallUpgradeElapsedTimeInMs: { + required: true, + serializedName: 'OverallUpgradeElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationUpgradeRollbackCompleteEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackStartEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackStartEvent.js new file mode 100644 index 0000000000..6477776fea --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackStartEvent.js @@ -0,0 +1,131 @@ +/* + * 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'); + +/** + * Application Upgrade Rollback Start event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeRollbackStartEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeRollbackStartEvent. + * @member {string} applicationTypeName Application type name. + * @member {string} currentApplicationTypeVersion Current Application type + * version. + * @member {string} applicationTypeVersion Target Application type version. + * @member {string} failureReason Describes reason of failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in + * milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationUpgradeRollbackStartEvent + * + * @returns {object} metadata of ApplicationUpgradeRollbackStartEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeRollbackStart', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeRollbackStartEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + currentApplicationTypeVersion: { + required: true, + serializedName: 'CurrentApplicationTypeVersion', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + }, + failureReason: { + required: true, + serializedName: 'FailureReason', + type: { + name: 'String' + } + }, + overallUpgradeElapsedTimeInMs: { + required: true, + serializedName: 'OverallUpgradeElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ApplicationUpgradeRollbackStartEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeStartEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeStartEvent.js new file mode 100644 index 0000000000..929fa59bc5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeStartEvent.js @@ -0,0 +1,138 @@ +/* + * 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'); + +/** + * Application Upgrade Start event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeStartEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeStartEvent. + * @member {string} applicationTypeName Application type name. + * @member {string} currentApplicationTypeVersion Current Application type + * version. + * @member {string} applicationTypeVersion Target Application type version. + * @member {string} upgradeType Type of upgrade. + * @member {string} rollingUpgradeMode Mode of upgrade. + * @member {string} failureAction Action if failed. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationUpgradeStartEvent + * + * @returns {object} metadata of ApplicationUpgradeStartEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeStart', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeStartEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + currentApplicationTypeVersion: { + required: true, + serializedName: 'CurrentApplicationTypeVersion', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + }, + upgradeType: { + required: true, + serializedName: 'UpgradeType', + type: { + name: 'String' + } + }, + rollingUpgradeMode: { + required: true, + serializedName: 'RollingUpgradeMode', + type: { + name: 'String' + } + }, + failureAction: { + required: true, + serializedName: 'FailureAction', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationUpgradeStartEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeUpdateDescription.js b/lib/services/serviceFabric/lib/models/applicationUpgradeUpdateDescription.js index eace142442..442355053b 100644 --- a/lib/services/serviceFabric/lib/models/applicationUpgradeUpdateDescription.js +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeUpdateDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the parameters for updating an ongoing application upgrade. * @@ -19,10 +17,13 @@ const models = require('./index'); class ApplicationUpgradeUpdateDescription { /** * Create a ApplicationUpgradeUpdateDescription. - * @member {string} name - * @member {string} upgradeKind Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {object} [applicationHealthPolicy] + * @member {string} name The name of the application, including the 'fabric:' + * URI scheme. + * @member {string} upgradeKind The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {object} [applicationHealthPolicy] Defines a health policy used to + * evaluate the health of an application or one of its children entities. * @member {boolean} [applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @member {number} @@ -38,6 +39,8 @@ class ApplicationUpgradeUpdateDescription { * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. @@ -78,20 +81,59 @@ class ApplicationUpgradeUpdateDescription { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] - * @member {object} [updateDescription] - * @member {string} [updateDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' - * @member {boolean} [updateDescription.forceRestart] + * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The + * map with service type health policy per service type name. The map is + * empty by default. + * @member {object} [updateDescription] Describes the parameters for updating + * a rolling upgrade of application or cluster. + * @member {string} [updateDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {boolean} [updateDescription.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 {number} [updateDescription.replicaSetCheckTimeoutInMilliseconds] - * @member {string} [updateDescription.failureAction] Possible values - * include: 'Invalid', 'Rollback', 'Manual' + * 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 {string} [updateDescription.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} - * [updateDescription.healthCheckStableDurationInMilliseconds] + * [updateDescription.healthCheckStableDurationInMilliseconds] 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} [updateDescription.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [updateDescription.upgradeTimeoutInMilliseconds] + * 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} [updateDescription.upgradeTimeoutInMilliseconds] 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} [updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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/serviceFabric/lib/models/applicationsHealthEvaluation.js b/lib/services/serviceFabric/lib/models/applicationsHealthEvaluation.js index 505b052850..1fe4b88c60 100644 --- a/lib/services/serviceFabric/lib/models/applicationsHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/applicationsHealthEvaluation.js @@ -26,7 +26,9 @@ class ApplicationsHealthEvaluation extends models['HealthEvaluation'] { * percentage of unhealthy applications from the ClusterHealthPolicy. * @member {number} [totalCount] Total number of applications from the health * store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ApplicationHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -44,6 +46,11 @@ class ApplicationsHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Applications', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'ApplicationsHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -63,6 +70,7 @@ class ApplicationsHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/averagePartitionLoadScalingTrigger.js b/lib/services/serviceFabric/lib/models/averagePartitionLoadScalingTrigger.js new file mode 100644 index 0000000000..08e176c524 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/averagePartitionLoadScalingTrigger.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a scaling trigger related to an average load of a metric/resource + * of a partition. + * + * @extends models['ScalingTriggerDescription'] + */ +class AveragePartitionLoadScalingTrigger extends models['ScalingTriggerDescription'] { + /** + * Create a AveragePartitionLoadScalingTrigger. + * @member {string} metricName The name of the metric for which usage should + * be tracked. + * @member {string} lowerLoadThreshold The lower limit of the load below + * which a scale in operation should be performed. + * @member {string} upperLoadThreshold The upper limit of the load beyond + * which a scale out operation should be performed. + * @member {number} scaleIntervalInSeconds The period in seconds on which a + * decision is made whether to scale or not. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AveragePartitionLoadScalingTrigger + * + * @returns {object} metadata of AveragePartitionLoadScalingTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'AveragePartitionLoad', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingTriggerDescription', + className: 'AveragePartitionLoadScalingTrigger', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + metricName: { + required: true, + serializedName: 'MetricName', + type: { + name: 'String' + } + }, + lowerLoadThreshold: { + required: true, + serializedName: 'LowerLoadThreshold', + type: { + name: 'String' + } + }, + upperLoadThreshold: { + required: true, + serializedName: 'UpperLoadThreshold', + type: { + name: 'String' + } + }, + scaleIntervalInSeconds: { + required: true, + serializedName: 'ScaleIntervalInSeconds', + constraints: { + InclusiveMaximum: 4294967295, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AveragePartitionLoadScalingTrigger; diff --git a/lib/services/serviceFabric/lib/models/averageServiceLoadScalingTrigger.js b/lib/services/serviceFabric/lib/models/averageServiceLoadScalingTrigger.js new file mode 100644 index 0000000000..fef69e06dc --- /dev/null +++ b/lib/services/serviceFabric/lib/models/averageServiceLoadScalingTrigger.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a scaling policy related to an average load of a metric/resource + * of a service. + * + * @extends models['ScalingTriggerDescription'] + */ +class AverageServiceLoadScalingTrigger extends models['ScalingTriggerDescription'] { + /** + * Create a AverageServiceLoadScalingTrigger. + * @member {string} metricName The name of the metric for which usage should + * be tracked. + * @member {string} lowerLoadThreshold The lower limit of the load below + * which a scale in operation should be performed. + * @member {string} upperLoadThreshold The upper limit of the load beyond + * which a scale out operation should be performed. + * @member {number} scaleIntervalInSeconds The period in seconds on which a + * decision is made whether to scale or not. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AverageServiceLoadScalingTrigger + * + * @returns {object} metadata of AverageServiceLoadScalingTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'AverageServiceLoad', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingTriggerDescription', + className: 'AverageServiceLoadScalingTrigger', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + metricName: { + required: true, + serializedName: 'MetricName', + type: { + name: 'String' + } + }, + lowerLoadThreshold: { + required: true, + serializedName: 'LowerLoadThreshold', + type: { + name: 'String' + } + }, + upperLoadThreshold: { + required: true, + serializedName: 'UpperLoadThreshold', + type: { + name: 'String' + } + }, + scaleIntervalInSeconds: { + required: true, + serializedName: 'ScaleIntervalInSeconds', + constraints: { + InclusiveMaximum: 4294967295, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AverageServiceLoadScalingTrigger; diff --git a/lib/services/serviceFabric/lib/models/azureBlobBackupStorageDescription.js b/lib/services/serviceFabric/lib/models/azureBlobBackupStorageDescription.js new file mode 100644 index 0000000000..dc76deffea --- /dev/null +++ b/lib/services/serviceFabric/lib/models/azureBlobBackupStorageDescription.js @@ -0,0 +1,87 @@ +/* + * 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 the parameters for Azure blob store used for storing and + * enumerating backups. + * + * @extends models['BackupStorageDescription'] + */ +class AzureBlobBackupStorageDescription extends models['BackupStorageDescription'] { + /** + * Create a AzureBlobBackupStorageDescription. + * @member {string} connectionString The connection string to connect to the + * Azure blob store. + * @member {string} containerName The name of the container in the blob store + * to store and enumerate backups from. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureBlobBackupStorageDescription + * + * @returns {object} metadata of AzureBlobBackupStorageDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureBlobStore', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'StorageKind', + clientName: 'storageKind' + }, + uberParent: 'BackupStorageDescription', + className: 'AzureBlobBackupStorageDescription', + modelProperties: { + friendlyName: { + required: false, + serializedName: 'FriendlyName', + type: { + name: 'String' + } + }, + storageKind: { + required: true, + serializedName: 'StorageKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + connectionString: { + required: true, + serializedName: 'ConnectionString', + type: { + name: 'String' + } + }, + containerName: { + required: true, + serializedName: 'ContainerName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureBlobBackupStorageDescription; diff --git a/lib/services/serviceFabric/lib/models/backupConfigurationInfo.js b/lib/services/serviceFabric/lib/models/backupConfigurationInfo.js new file mode 100644 index 0000000000..f1fcabc830 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupConfigurationInfo.js @@ -0,0 +1,91 @@ +/* + * 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 backup configuration information. + * + */ +class BackupConfigurationInfo { + /** + * Create a BackupConfigurationInfo. + * @member {string} [policyName] The name of the backup policy which is + * applicable to this Service Fabric application or service or partition. + * @member {string} [policyInheritedFrom] Specifies the scope at which the + * backup policy is applied. Possible values include: 'Invalid', 'Partition', + * 'Service', 'Application' + * @member {object} [suspensionInfo] Describes the backup suspension details. + * @member {boolean} [suspensionInfo.isSuspended] Indicates whether periodic + * backup is suspended at this level or not. + * @member {string} [suspensionInfo.suspensionInheritedFrom] Specifies the + * scope at which the backup suspension was applied. Possible values include: + * 'Invalid', 'Partition', 'Service', 'Application' + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of BackupConfigurationInfo + * + * @returns {object} metadata of BackupConfigurationInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupConfigurationInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'BackupConfigurationInfo', + className: 'BackupConfigurationInfo', + modelProperties: { + policyName: { + required: false, + serializedName: 'PolicyName', + type: { + name: 'String' + } + }, + policyInheritedFrom: { + required: false, + serializedName: 'PolicyInheritedFrom', + type: { + name: 'String' + } + }, + suspensionInfo: { + required: false, + serializedName: 'SuspensionInfo', + type: { + name: 'Composite', + className: 'BackupSuspensionInfo' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackupConfigurationInfo; diff --git a/lib/services/serviceFabric/lib/models/backupEntity.js b/lib/services/serviceFabric/lib/models/backupEntity.js new file mode 100644 index 0000000000..212d013b61 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupEntity.js @@ -0,0 +1,58 @@ +/* + * 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 Service Fabric entity that is configured for backup. + * + */ +class BackupEntity { + /** + * Create a BackupEntity. + * @member {string} entityKind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of BackupEntity + * + * @returns {object} metadata of BackupEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupEntity', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'EntityKind', + clientName: 'entityKind' + }, + uberParent: 'BackupEntity', + className: 'BackupEntity', + modelProperties: { + entityKind: { + required: true, + serializedName: 'EntityKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackupEntity; diff --git a/lib/services/serviceFabric/lib/models/backupEpoch.js b/lib/services/serviceFabric/lib/models/backupEpoch.js new file mode 100644 index 0000000000..4aeeeb44e8 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupEpoch.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An Epoch is a configuration number for the partition as a whole. When the + * configuration of the replica set changes, for example when the Primary + * replica changes, the operations that are replicated from the new Primary + * replica are said to be a new Epoch from the ones which were sent by the old + * Primary replica. + * + */ +class BackupEpoch { + /** + * Create a BackupEpoch. + * @member {string} [configurationNumber] The current configuration number of + * this Epoch. The configuration number is an increasing value that is + * updated whenever the configuration of this replica set changes. + * @member {string} [dataLossNumber] The current dataloss number of this + * Epoch. The data loss number property is an increasing value which is + * updated whenever data loss is suspected, as when loss of a quorum of + * replicas in the replica set that includes the Primary replica. + */ + constructor() { + } + + /** + * Defines the metadata of BackupEpoch + * + * @returns {object} metadata of BackupEpoch + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupEpoch', + type: { + name: 'Composite', + className: 'BackupEpoch', + modelProperties: { + configurationNumber: { + required: false, + serializedName: 'ConfigurationNumber', + type: { + name: 'String' + } + }, + dataLossNumber: { + required: false, + serializedName: 'DataLossNumber', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackupEpoch; diff --git a/lib/services/serviceFabric/lib/models/backupInfo.js b/lib/services/serviceFabric/lib/models/backupInfo.js new file mode 100644 index 0000000000..fe3c13d28c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupInfo.js @@ -0,0 +1,330 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Represents a backup point which can be used to trigger a restore. + * + */ +class BackupInfo { + /** + * Create a BackupInfo. + * @member {uuid} [backupId] Unique backup ID . + * @member {uuid} [backupChainId] Unique backup chain ID. All backups part of + * the same chain has the same backup chain id. A backup chain is comprised + * of 1 full backup and multiple incremental backups. + * @member {string} [applicationName] Name of the Service Fabric application + * this partition backup belongs to. + * @member {string} [serviceName] Name of the Service Fabric service this + * partition backup belongs to. + * @member {object} [partitionInformation] Information about the partition to + * which this backup belongs to + * @member {uuid} [partitionInformation.id] An internal ID used by Service + * Fabric to uniquely identify a partition. This is a randomly generated GUID + * when the service was created. The partition ID is unique and does not + * change for the lifetime of the service. If the same service was deleted + * and recreated the IDs of its partitions would be different. + * @member {string} [partitionInformation.servicePartitionKind] Polymorphic + * Discriminator + * @member {string} [backupLocation] Location of the backup, relative to the + * backup store. + * @member {string} [backupType] Describes the type of backup, whether its + * full or incremental. Possible values include: 'Invalid', 'Full', + * 'Incremental' + * @member {object} [epochOfLastBackupRecord] Epoch of the last record in + * this backup. + * @member {string} [epochOfLastBackupRecord.configurationNumber] The current + * configuration number of this Epoch. The configuration number is an + * increasing value that is updated whenever the configuration of this + * replica set changes. + * @member {string} [epochOfLastBackupRecord.dataLossNumber] The current + * dataloss number of this Epoch. The data loss number property is an + * increasing value which is updated whenever data loss is suspected, as when + * loss of a quorum of replicas in the replica set that includes the Primary + * replica. + * @member {string} [lsnOfLastBackupRecord] LSN of the last record in this + * backup. + * @member {date} [creationTimeUtc] The date time when this backup was taken. + * @member {object} [failureError] Denotes the failure encountered in getting + * backup point information. + * @member {string} [failureError.code] Defines the fabric error codes that + * be returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values + * that can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request + * Entity Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: + * 'FABRIC_E_INVALID_PARTITION_KEY', + * 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', + * 'FABRIC_E_APPLICATION_NOT_UPGRADING', + * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_FABRIC_NOT_UPGRADING', + * 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', + * 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', + * 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', + * 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', + * 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', + * 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', + * 'FABRIC_E_SERVICE_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', + * 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', + * 'FABRIC_E_PARTITION_NOT_FOUND', 'FABRIC_E_REPLICA_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', + * 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', + * 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', + * 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', + * 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', + * 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', + * 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', + * 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', + * 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_SERVICE_ALREADY_EXISTS', + * 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_TYPE_IN_USE', + * 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', + * 'FABRIC_E_FABRIC_VERSION_IN_USE', 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_NAME_ALREADY_EXISTS', 'FABRIC_E_NAME_NOT_EMPTY', + * 'FABRIC_E_PROPERTY_CHECK_FAILED', 'FABRIC_E_SERVICE_METADATA_MISMATCH', + * 'FABRIC_E_SERVICE_TYPE_MISMATCH', 'FABRIC_E_HEALTH_STALE_REPORT', + * 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', + * 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', + * 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', + * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', + * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', + * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' + * @member {string} [failureError.message] Error message. + */ + constructor() { + } + + /** + * Defines the metadata of BackupInfo + * + * @returns {object} metadata of BackupInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupInfo', + type: { + name: 'Composite', + className: 'BackupInfo', + modelProperties: { + backupId: { + required: false, + serializedName: 'BackupId', + type: { + name: 'String' + } + }, + backupChainId: { + required: false, + serializedName: 'BackupChainId', + type: { + name: 'String' + } + }, + applicationName: { + required: false, + serializedName: 'ApplicationName', + type: { + name: 'String' + } + }, + serviceName: { + required: false, + serializedName: 'ServiceName', + type: { + name: 'String' + } + }, + partitionInformation: { + required: false, + serializedName: 'PartitionInformation', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServicePartitionKind', + clientName: 'servicePartitionKind' + }, + uberParent: 'PartitionInformation', + className: 'PartitionInformation' + } + }, + backupLocation: { + required: false, + serializedName: 'BackupLocation', + type: { + name: 'String' + } + }, + backupType: { + required: false, + serializedName: 'BackupType', + type: { + name: 'String' + } + }, + epochOfLastBackupRecord: { + required: false, + serializedName: 'EpochOfLastBackupRecord', + type: { + name: 'Composite', + className: 'BackupEpoch' + } + }, + lsnOfLastBackupRecord: { + required: false, + serializedName: 'LsnOfLastBackupRecord', + type: { + name: 'String' + } + }, + creationTimeUtc: { + required: false, + serializedName: 'CreationTimeUtc', + type: { + name: 'DateTime' + } + }, + failureError: { + required: false, + serializedName: 'FailureError', + type: { + name: 'Composite', + className: 'FabricErrorError' + } + } + } + } + }; + } +} + +module.exports = BackupInfo; diff --git a/lib/services/serviceFabric/lib/models/backupPartitionDescription.js b/lib/services/serviceFabric/lib/models/backupPartitionDescription.js new file mode 100644 index 0000000000..5f925738ca --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupPartitionDescription.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 parameters for triggering partition's backup. + * + */ +class BackupPartitionDescription { + /** + * Create a BackupPartitionDescription. + * @member {object} [backupStorage] Specifies the details of the backup + * storage where to save the backup. + * @member {string} [backupStorage.friendlyName] Friendly name for this + * backup storage. + * @member {string} [backupStorage.storageKind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of BackupPartitionDescription + * + * @returns {object} metadata of BackupPartitionDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupPartitionDescription', + type: { + name: 'Composite', + className: 'BackupPartitionDescription', + modelProperties: { + backupStorage: { + required: false, + serializedName: 'BackupStorage', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'StorageKind', + clientName: 'storageKind' + }, + uberParent: 'BackupStorageDescription', + className: 'BackupStorageDescription' + } + } + } + } + }; + } +} + +module.exports = BackupPartitionDescription; diff --git a/lib/services/serviceFabric/lib/models/backupPolicyDescription.js b/lib/services/serviceFabric/lib/models/backupPolicyDescription.js new file mode 100644 index 0000000000..40c8c255f2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupPolicyDescription.js @@ -0,0 +1,113 @@ +/* + * 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 a backup policy for configuring periodic backup. + * + */ +class BackupPolicyDescription { + /** + * Create a BackupPolicyDescription. + * @member {string} name The unique name identifying this backup policy. + * @member {boolean} autoRestoreOnDataLoss Specifies whether to trigger + * restore automatically using the latest available backup in case the + * partition experiences a data loss event. + * @member {number} maxIncrementalBackups Defines the maximum number of + * incremental backups to be taken between two full backups. This is just the + * upper limit. A full backup may be taken before specified number of + * incremental backups are completed in one of the following conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * @member {object} schedule Describes the backup schedule parameters. + * @member {string} [schedule.scheduleKind] Polymorphic Discriminator + * @member {object} storage Describes the details of backup storage where to + * store the periodic backups. + * @member {string} [storage.friendlyName] Friendly name for this backup + * storage. + * @member {string} [storage.storageKind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of BackupPolicyDescription + * + * @returns {object} metadata of BackupPolicyDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupPolicyDescription', + type: { + name: 'Composite', + className: 'BackupPolicyDescription', + modelProperties: { + name: { + required: true, + serializedName: 'Name', + type: { + name: 'String' + } + }, + autoRestoreOnDataLoss: { + required: true, + serializedName: 'AutoRestoreOnDataLoss', + type: { + name: 'Boolean' + } + }, + maxIncrementalBackups: { + required: true, + serializedName: 'MaxIncrementalBackups', + constraints: { + InclusiveMaximum: 255, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + schedule: { + required: true, + serializedName: 'Schedule', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ScheduleKind', + clientName: 'scheduleKind' + }, + uberParent: 'BackupScheduleDescription', + className: 'BackupScheduleDescription' + } + }, + storage: { + required: true, + serializedName: 'Storage', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'StorageKind', + clientName: 'storageKind' + }, + uberParent: 'BackupStorageDescription', + className: 'BackupStorageDescription' + } + } + } + } + }; + } +} + +module.exports = BackupPolicyDescription; diff --git a/lib/services/serviceFabric/lib/models/backupProgressInfo.js b/lib/services/serviceFabric/lib/models/backupProgressInfo.js new file mode 100644 index 0000000000..ecb09475eb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupProgressInfo.js @@ -0,0 +1,281 @@ +/* + * 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 progress of a partition's backup. + * + */ +class BackupProgressInfo { + /** + * Create a BackupProgressInfo. + * @member {string} [backupState] Represents the current state of the + * partition backup operation. Possible values include: 'Invalid', + * 'Accepted', 'BackupInProgress', 'Success', 'Failure', 'Timeout' + * @member {date} [timeStampUtc] TimeStamp in UTC when operation succeeded or + * failed. + * @member {uuid} [backupId] Unique ID of the newly created backup. + * @member {string} [backupLocation] Location, relative to the backup store, + * of the newly created backup. + * @member {object} [epochOfLastBackupRecord] Specifies the epoch of the last + * record included in backup. + * @member {string} [epochOfLastBackupRecord.configurationNumber] The current + * configuration number of this Epoch. The configuration number is an + * increasing value that is updated whenever the configuration of this + * replica set changes. + * @member {string} [epochOfLastBackupRecord.dataLossNumber] The current + * dataloss number of this Epoch. The data loss number property is an + * increasing value which is updated whenever data loss is suspected, as when + * loss of a quorum of replicas in the replica set that includes the Primary + * replica. + * @member {string} [lsnOfLastBackupRecord] The LSN of last record included + * in backup. + * @member {object} [failureError] Denotes the failure encountered in + * performing backup operation. + * @member {string} [failureError.code] Defines the fabric error codes that + * be returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values + * that can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request + * Entity Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: + * 'FABRIC_E_INVALID_PARTITION_KEY', + * 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', + * 'FABRIC_E_APPLICATION_NOT_UPGRADING', + * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_FABRIC_NOT_UPGRADING', + * 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', + * 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', + * 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', + * 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', + * 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', + * 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', + * 'FABRIC_E_SERVICE_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', + * 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', + * 'FABRIC_E_PARTITION_NOT_FOUND', 'FABRIC_E_REPLICA_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', + * 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', + * 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', + * 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', + * 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', + * 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', + * 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', + * 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', + * 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_SERVICE_ALREADY_EXISTS', + * 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_TYPE_IN_USE', + * 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', + * 'FABRIC_E_FABRIC_VERSION_IN_USE', 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_NAME_ALREADY_EXISTS', 'FABRIC_E_NAME_NOT_EMPTY', + * 'FABRIC_E_PROPERTY_CHECK_FAILED', 'FABRIC_E_SERVICE_METADATA_MISMATCH', + * 'FABRIC_E_SERVICE_TYPE_MISMATCH', 'FABRIC_E_HEALTH_STALE_REPORT', + * 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', + * 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', + * 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', + * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', + * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', + * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' + * @member {string} [failureError.message] Error message. + */ + constructor() { + } + + /** + * Defines the metadata of BackupProgressInfo + * + * @returns {object} metadata of BackupProgressInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupProgressInfo', + type: { + name: 'Composite', + className: 'BackupProgressInfo', + modelProperties: { + backupState: { + required: false, + serializedName: 'BackupState', + type: { + name: 'String' + } + }, + timeStampUtc: { + required: false, + serializedName: 'TimeStampUtc', + type: { + name: 'DateTime' + } + }, + backupId: { + required: false, + serializedName: 'BackupId', + type: { + name: 'String' + } + }, + backupLocation: { + required: false, + serializedName: 'BackupLocation', + type: { + name: 'String' + } + }, + epochOfLastBackupRecord: { + required: false, + serializedName: 'EpochOfLastBackupRecord', + type: { + name: 'Composite', + className: 'BackupEpoch' + } + }, + lsnOfLastBackupRecord: { + required: false, + serializedName: 'LsnOfLastBackupRecord', + type: { + name: 'String' + } + }, + failureError: { + required: false, + serializedName: 'FailureError', + type: { + name: 'Composite', + className: 'FabricErrorError' + } + } + } + } + }; + } +} + +module.exports = BackupProgressInfo; diff --git a/lib/services/serviceFabric/lib/models/backupScheduleDescription.js b/lib/services/serviceFabric/lib/models/backupScheduleDescription.js new file mode 100644 index 0000000000..6cb850c06d --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupScheduleDescription.js @@ -0,0 +1,58 @@ +/* + * 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 backup schedule parameters. + * + */ +class BackupScheduleDescription { + /** + * Create a BackupScheduleDescription. + * @member {string} scheduleKind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of BackupScheduleDescription + * + * @returns {object} metadata of BackupScheduleDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupScheduleDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ScheduleKind', + clientName: 'scheduleKind' + }, + uberParent: 'BackupScheduleDescription', + className: 'BackupScheduleDescription', + modelProperties: { + scheduleKind: { + required: true, + serializedName: 'ScheduleKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackupScheduleDescription; diff --git a/lib/services/serviceFabric/lib/models/backupStorageDescription.js b/lib/services/serviceFabric/lib/models/backupStorageDescription.js new file mode 100644 index 0000000000..ce941b0c9a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupStorageDescription.js @@ -0,0 +1,66 @@ +/* + * 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 parameters for the backup storage. + * + */ +class BackupStorageDescription { + /** + * Create a BackupStorageDescription. + * @member {string} [friendlyName] Friendly name for this backup storage. + * @member {string} storageKind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of BackupStorageDescription + * + * @returns {object} metadata of BackupStorageDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupStorageDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'StorageKind', + clientName: 'storageKind' + }, + uberParent: 'BackupStorageDescription', + className: 'BackupStorageDescription', + modelProperties: { + friendlyName: { + required: false, + serializedName: 'FriendlyName', + type: { + name: 'String' + } + }, + storageKind: { + required: true, + serializedName: 'StorageKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackupStorageDescription; diff --git a/lib/services/serviceFabric/lib/models/backupSuspensionInfo.js b/lib/services/serviceFabric/lib/models/backupSuspensionInfo.js new file mode 100644 index 0000000000..24eddbbd20 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/backupSuspensionInfo.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'; + +/** + * Describes the backup suspension details. + * + */ +class BackupSuspensionInfo { + /** + * Create a BackupSuspensionInfo. + * @member {boolean} [isSuspended] Indicates whether periodic backup is + * suspended at this level or not. + * @member {string} [suspensionInheritedFrom] Specifies the scope at which + * the backup suspension was applied. Possible values include: 'Invalid', + * 'Partition', 'Service', 'Application' + */ + constructor() { + } + + /** + * Defines the metadata of BackupSuspensionInfo + * + * @returns {object} metadata of BackupSuspensionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupSuspensionInfo', + type: { + name: 'Composite', + className: 'BackupSuspensionInfo', + modelProperties: { + isSuspended: { + required: false, + serializedName: 'IsSuspended', + type: { + name: 'Boolean' + } + }, + suspensionInheritedFrom: { + required: false, + serializedName: 'SuspensionInheritedFrom', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BackupSuspensionInfo; diff --git a/lib/services/serviceFabric/lib/models/binaryPropertyValue.js b/lib/services/serviceFabric/lib/models/binaryPropertyValue.js new file mode 100644 index 0000000000..370bf64f4b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/binaryPropertyValue.js @@ -0,0 +1,77 @@ +/* + * 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 Service Fabric property value of type Binary. + * + * @extends models['PropertyValue'] + */ +class BinaryPropertyValue extends models['PropertyValue'] { + /** + * Create a BinaryPropertyValue. + * @member {array} data Array of bytes to be sent as an integer array. Each + * element of array is a number between 0 and 255. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BinaryPropertyValue + * + * @returns {object} metadata of BinaryPropertyValue + * + */ + mapper() { + return { + required: false, + serializedName: 'Binary', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'BinaryPropertyValue', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + data: { + required: true, + serializedName: 'Data', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + } + } + } + }; + } +} + +module.exports = BinaryPropertyValue; diff --git a/lib/services/serviceFabric/lib/models/chaos.js b/lib/services/serviceFabric/lib/models/chaos.js new file mode 100644 index 0000000000..dbed6b921a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaos.js @@ -0,0 +1,215 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains a description of Chaos. + * + */ +class Chaos { + /** + * Create a Chaos. + * @member {object} [chaosParameters] If Chaos is running, these are the + * parameters Chaos is running with. + * @member {string} [chaosParameters.timeToRunInSeconds] Total time (in + * seconds) for which Chaos will run before automatically stopping. The + * maximum allowed value is 4,294,967,295 (System.UInt32.MaxValue). + * @member {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] + * The maximum amount of time to wait for all cluster entities to become + * stable and healthy. Chaos executes in iterations and at the start of each + * iteration it validates the health of cluster entities. + * During validation if a cluster entity is not stable and healthy within + * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation + * failed event. + * @member {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults + * is the maximum number of concurrent faults induced per iteration. + * Chaos executes in iterations and two consecutive iterations are separated + * by a validation phase. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. + * The recommendation is to start with a value of 2 or 3 and to exercise + * caution while moving up. + * @member {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or + * disables the move primary and move secondary faults. + * @member {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait + * time (in seconds) between consecutive faults within a single iteration. + * The larger the value, the lower the overlapping between faults and the + * simpler the sequence of state transitions that the cluster goes through. + * The recommendation is to start with a value between 1 and 5 and exercise + * caution while moving up. + * @member {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] + * Time-separation (in seconds) between two consecutive iterations of Chaos. + * The larger the value, the lower the fault injection rate. + * @member {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected + * exception happens during fault execution--to provide the cluster with some + * time to recuperate--Chaos will wait for 30 minutes before the next + * health-check. + * @member {boolean} + * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates + * whether warnings are treated with the same severity as errors. + * @member {number} + * [chaosParameters.clusterHealthPolicy.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} + * [chaosParameters.clusterHealthPolicy.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 {array} + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used + * to record information about + * the Chaos run. There cannot be more than 100 such pairs and each string + * (key or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [chaosParameters.context.map] Describes a map that + * contains a collection of ChaosContextMapItem's. + * @member {object} [chaosParameters.chaosTargetFilter] List of cluster + * entities to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types + * or only to certain application instances. If ChaosTargetFilter is not + * used, Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] + * A list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the + * nodes of these node types. + * If a nodetype (say NodeTypeX) does not appear in the + * NodeTypeInclusionList, then node level faults (like NodeRestart) will + * never be enabled for the nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} + * [chaosParameters.chaosTargetFilter.applicationInclusionList] A list of + * application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas + * of these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement + * constraints and applicationX is absent from ApplicationInclusionList and + * nodeTypeY is absent from NodeTypeInclusionList, then applicationX will + * never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. + * @member {string} [status] Current status of the Chaos run. Possible values + * include: 'Invalid', 'Running', 'Stopped' + * @member {string} [scheduleStatus] Current status of the schedule. Possible + * values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending' + */ + constructor() { + } + + /** + * Defines the metadata of Chaos + * + * @returns {object} metadata of Chaos + * + */ + mapper() { + return { + required: false, + serializedName: 'Chaos', + type: { + name: 'Composite', + className: 'Chaos', + modelProperties: { + chaosParameters: { + required: false, + serializedName: 'ChaosParameters', + type: { + name: 'Composite', + className: 'ChaosParameters' + } + }, + status: { + required: false, + serializedName: 'Status', + type: { + name: 'String' + } + }, + scheduleStatus: { + required: false, + serializedName: 'ScheduleStatus', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Chaos; diff --git a/lib/services/serviceFabric/lib/models/chaosContext.js b/lib/services/serviceFabric/lib/models/chaosContext.js index 5e5e92a871..756ee2b62f 100644 --- a/lib/services/serviceFabric/lib/models/chaosContext.js +++ b/lib/services/serviceFabric/lib/models/chaosContext.js @@ -18,12 +18,12 @@ * This map is set by the starter of the Chaos run to optionally store the * context about the specific run. * - * */ class ChaosContext { /** * Create a ChaosContext. - * @member {object} [map] + * @member {object} [map] Describes a map that contains a collection of + * ChaosContextMapItem's. */ constructor() { } @@ -46,7 +46,14 @@ class ChaosContext { required: false, serializedName: 'Map', type: { - name: 'Object' + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } } } } diff --git a/lib/services/serviceFabric/lib/models/chaosEvent.js b/lib/services/serviceFabric/lib/models/chaosEvent.js index ca85df84cf..7383a5aec9 100644 --- a/lib/services/serviceFabric/lib/models/chaosEvent.js +++ b/lib/services/serviceFabric/lib/models/chaosEvent.js @@ -17,7 +17,8 @@ class ChaosEvent { /** * Create a ChaosEvent. - * @member {date} timeStampUtc + * @member {date} timeStampUtc The UTC timestamp when this Chaos event was + * generated. * @member {string} kind Polymorphic Discriminator */ constructor() { @@ -52,6 +53,7 @@ class ChaosEvent { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/chaosEventWrapper.js b/lib/services/serviceFabric/lib/models/chaosEventWrapper.js index f2ba1eeeec..6256cba6be 100644 --- a/lib/services/serviceFabric/lib/models/chaosEventWrapper.js +++ b/lib/services/serviceFabric/lib/models/chaosEventWrapper.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Wrapper object for Chaos event. * @@ -19,8 +17,10 @@ const models = require('./index'); class ChaosEventWrapper { /** * Create a ChaosEventWrapper. - * @member {object} [chaosEvent] - * @member {date} [chaosEvent.timeStampUtc] + * @member {object} [chaosEvent] Represents an event generated during a Chaos + * run. + * @member {date} [chaosEvent.timeStampUtc] The UTC timestamp when this Chaos + * event was generated. * @member {string} [chaosEvent.kind] Polymorphic Discriminator */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/chaosEventsSegment.js b/lib/services/serviceFabric/lib/models/chaosEventsSegment.js new file mode 100644 index 0000000000..ba24f300ca --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosEventsSegment.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'; + +/** + * Contains the list of Chaos events and the continuation token to get the next + * segment. + * + */ +class ChaosEventsSegment { + /** + * Create a ChaosEventsSegment. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [history] List of Chaos events that meet the user-supplied + * criteria. + */ + constructor() { + } + + /** + * Defines the metadata of ChaosEventsSegment + * + * @returns {object} metadata of ChaosEventsSegment + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosEventsSegment', + type: { + name: 'Composite', + className: 'ChaosEventsSegment', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + history: { + required: false, + serializedName: 'History', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ChaosEventWrapperElementType', + type: { + name: 'Composite', + className: 'ChaosEventWrapper' + } + } + } + } + } + } + }; + } +} + +module.exports = ChaosEventsSegment; diff --git a/lib/services/serviceFabric/lib/models/chaosMovePrimaryFaultScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosMovePrimaryFaultScheduledEvent.js new file mode 100644 index 0000000000..d70842c54f --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosMovePrimaryFaultScheduledEvent.js @@ -0,0 +1,129 @@ +/* + * 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'); + +/** + * Chaos Move Primary Fault Scheduled event. + * + * @extends models['PartitionEvent'] + */ +class ChaosMovePrimaryFaultScheduledEvent extends models['PartitionEvent'] { + /** + * Create a ChaosMovePrimaryFaultScheduledEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceName Service name. + * @member {string} nodeTo The name of a Service Fabric node. + * @member {boolean} forcedMove Indicates a forced move. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosMovePrimaryFaultScheduledEvent + * + * @returns {object} metadata of ChaosMovePrimaryFaultScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosMovePrimaryFaultScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosMovePrimaryFaultScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + }, + serviceName: { + required: true, + serializedName: 'ServiceName', + type: { + name: 'String' + } + }, + nodeTo: { + required: true, + serializedName: 'NodeTo', + type: { + name: 'String' + } + }, + forcedMove: { + required: true, + serializedName: 'ForcedMove', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ChaosMovePrimaryFaultScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosMoveSecondaryFaultScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosMoveSecondaryFaultScheduledEvent.js new file mode 100644 index 0000000000..ac81e8e6be --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosMoveSecondaryFaultScheduledEvent.js @@ -0,0 +1,137 @@ +/* + * 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'); + +/** + * Chaos Move Secondary Fault Scheduled event. + * + * @extends models['PartitionEvent'] + */ +class ChaosMoveSecondaryFaultScheduledEvent extends models['PartitionEvent'] { + /** + * Create a ChaosMoveSecondaryFaultScheduledEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceName Service name. + * @member {string} sourceNode The name of a Service Fabric node. + * @member {string} destinationNode The name of a Service Fabric node. + * @member {boolean} forcedMove Indicates a forced move. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosMoveSecondaryFaultScheduledEvent + * + * @returns {object} metadata of ChaosMoveSecondaryFaultScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosMoveSecondaryFaultScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosMoveSecondaryFaultScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + }, + serviceName: { + required: true, + serializedName: 'ServiceName', + type: { + name: 'String' + } + }, + sourceNode: { + required: true, + serializedName: 'SourceNode', + type: { + name: 'String' + } + }, + destinationNode: { + required: true, + serializedName: 'DestinationNode', + type: { + name: 'String' + } + }, + forcedMove: { + required: true, + serializedName: 'ForcedMove', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ChaosMoveSecondaryFaultScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosParameters.js b/lib/services/serviceFabric/lib/models/chaosParameters.js index 2e99c6bdab..c5f6328adf 100644 --- a/lib/services/serviceFabric/lib/models/chaosParameters.js +++ b/lib/services/serviceFabric/lib/models/chaosParameters.js @@ -10,52 +10,48 @@ 'use strict'; -const models = require('./index'); - /** * Defines all the parameters to configure a Chaos run. * - * */ class ChaosParameters { /** * Create a ChaosParameters. * @member {string} [timeToRunInSeconds] Total time (in seconds) for which * Chaos will run before automatically stopping. The maximum allowed value is - * 4,294,967,295 (System.UInt32.MaxValue). - * . Default value: '4294967295' . + * 4,294,967,295 (System.UInt32.MaxValue). Default value: '4294967295' . * @member {number} [maxClusterStabilizationTimeoutInSeconds] The maximum * amount of time to wait for all cluster entities to become stable and * healthy. Chaos executes in iterations and at the start of each iteration * it validates the health of cluster entities. * During validation if a cluster entity is not stable and healthy within * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation - * failed event. - * . Default value: 60 . + * failed event. Default value: 60 . * @member {number} [maxConcurrentFaults] MaxConcurrentFaults is the maximum * number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated * by a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise - * caution while moving up. - * . Default value: 1 . + * caution while moving up. Default value: 1 . * @member {boolean} [enableMoveReplicaFaults] Enables or disables the move - * primary and move secondary faults. - * . Default value: true . + * primary and move secondary faults. Default value: true . * @member {number} [waitTimeBetweenFaultsInSeconds] Wait time (in seconds) * between consecutive faults within a single iteration. * The larger the value, the lower the overlapping between faults and the * simpler the sequence of state transitions that the cluster goes through. * The recommendation is to start with a value between 1 and 5 and exercise - * caution while moving up. - * . Default value: 20 . + * caution while moving up. Default value: 20 . * @member {number} [waitTimeBetweenIterationsInSeconds] Time-separation (in * seconds) between two consecutive iterations of Chaos. - * The larger the value, the lower the fault injection rate. - * . Default value: 30 . - * @member {object} [clusterHealthPolicy] + * The larger the value, the lower the fault injection rate. Default value: + * 30 . + * @member {object} [clusterHealthPolicy] Passed-in cluster health policy is + * used to validate health of the cluster in between Chaos iterations. If the + * cluster health is in error or if an unexpected exception happens during + * fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The @@ -90,8 +86,76 @@ class ChaosParameters { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [context] - * @member {object} [context.map] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [context] Describes a map, which is a collection of + * (string, string) type key-value pairs. The map can be used to record + * information about + * the Chaos run. There cannot be more than 100 such pairs and each string + * (key or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [context.map] Describes a map that contains a collection + * of ChaosContextMapItem's. + * @member {object} [chaosTargetFilter] List of cluster entities to target + * for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types + * or only to certain application instances. If ChaosTargetFilter is not + * used, Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [chaosTargetFilter.nodeTypeInclusionList] A list of node + * types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the + * nodes of these node types. + * If a nodetype (say NodeTypeX) does not appear in the + * NodeTypeInclusionList, then node level faults (like NodeRestart) will + * never be enabled for the nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [chaosTargetFilter.applicationInclusionList] A list of + * application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas + * of these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement + * constraints and applicationX is absent from ApplicationInclusionList and + * nodeTypeY is absent from NodeTypeInclusionList, then applicationX will + * never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. */ constructor() { } @@ -189,6 +253,14 @@ class ChaosParameters { name: 'Composite', className: 'ChaosContext' } + }, + chaosTargetFilter: { + required: false, + serializedName: 'ChaosTargetFilter', + type: { + name: 'Composite', + className: 'ChaosTargetFilter' + } } } } diff --git a/lib/services/serviceFabric/lib/models/chaosParametersDictionaryItem.js b/lib/services/serviceFabric/lib/models/chaosParametersDictionaryItem.js new file mode 100644 index 0000000000..d9ca70a782 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosParametersDictionaryItem.js @@ -0,0 +1,203 @@ +/* + * 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'; + +/** + * Defines an item in ChaosParametersDictionary of the Chaos Schedule. + * + */ +class ChaosParametersDictionaryItem { + /** + * Create a ChaosParametersDictionaryItem. + * @member {string} key The key identifying the Chaos Parameter in the + * dictionary. This key is referenced by Chaos Schedule Jobs. + * @member {object} value Defines all the parameters to configure a Chaos + * run. + * @member {string} [value.timeToRunInSeconds] Total time (in seconds) for + * which Chaos will run before automatically stopping. The maximum allowed + * value is 4,294,967,295 (System.UInt32.MaxValue). + * @member {number} [value.maxClusterStabilizationTimeoutInSeconds] The + * maximum amount of time to wait for all cluster entities to become stable + * and healthy. Chaos executes in iterations and at the start of each + * iteration it validates the health of cluster entities. + * During validation if a cluster entity is not stable and healthy within + * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation + * failed event. + * @member {number} [value.maxConcurrentFaults] MaxConcurrentFaults is the + * maximum number of concurrent faults induced per iteration. + * Chaos executes in iterations and two consecutive iterations are separated + * by a validation phase. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. + * The recommendation is to start with a value of 2 or 3 and to exercise + * caution while moving up. + * @member {boolean} [value.enableMoveReplicaFaults] Enables or disables the + * move primary and move secondary faults. + * @member {number} [value.waitTimeBetweenFaultsInSeconds] Wait time (in + * seconds) between consecutive faults within a single iteration. + * The larger the value, the lower the overlapping between faults and the + * simpler the sequence of state transitions that the cluster goes through. + * The recommendation is to start with a value between 1 and 5 and exercise + * caution while moving up. + * @member {number} [value.waitTimeBetweenIterationsInSeconds] + * Time-separation (in seconds) between two consecutive iterations of Chaos. + * The larger the value, the lower the fault injection rate. + * @member {object} [value.clusterHealthPolicy] Passed-in cluster health + * policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected + * exception happens during fault execution--to provide the cluster with some + * time to recuperate--Chaos will wait for 30 minutes before the next + * health-check. + * @member {boolean} [value.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * @member {number} [value.clusterHealthPolicy.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} + * [value.clusterHealthPolicy.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 {array} [value.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [value.context] Describes a map, which is a collection of + * (string, string) type key-value pairs. The map can be used to record + * information about + * the Chaos run. There cannot be more than 100 such pairs and each string + * (key or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [value.context.map] Describes a map that contains a + * collection of ChaosContextMapItem's. + * @member {object} [value.chaosTargetFilter] List of cluster entities to + * target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types + * or only to certain application instances. If ChaosTargetFilter is not + * used, Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [value.chaosTargetFilter.nodeTypeInclusionList] A list of + * node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the + * nodes of these node types. + * If a nodetype (say NodeTypeX) does not appear in the + * NodeTypeInclusionList, then node level faults (like NodeRestart) will + * never be enabled for the nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [value.chaosTargetFilter.applicationInclusionList] A list + * of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas + * of these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement + * constraints and applicationX is absent from ApplicationInclusionList and + * nodeTypeY is absent from NodeTypeInclusionList, then applicationX will + * never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. + */ + constructor() { + } + + /** + * Defines the metadata of ChaosParametersDictionaryItem + * + * @returns {object} metadata of ChaosParametersDictionaryItem + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosParametersDictionaryItem', + type: { + name: 'Composite', + className: 'ChaosParametersDictionaryItem', + modelProperties: { + key: { + required: true, + serializedName: 'Key', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'Value', + type: { + name: 'Composite', + className: 'ChaosParameters' + } + } + } + } + }; + } +} + +module.exports = ChaosParametersDictionaryItem; diff --git a/lib/services/serviceFabric/lib/models/chaosRemoveReplicaFaultCompletedEvent.js b/lib/services/serviceFabric/lib/models/chaosRemoveReplicaFaultCompletedEvent.js new file mode 100644 index 0000000000..d2f959882e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosRemoveReplicaFaultCompletedEvent.js @@ -0,0 +1,120 @@ +/* + * 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'); + +/** + * Chaos Remove Replica Fault Completed event. + * + * @extends models['ReplicaEvent'] + */ +class ChaosRemoveReplicaFaultCompletedEvent extends models['ReplicaEvent'] { + /** + * Create a ChaosRemoveReplicaFaultCompletedEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosRemoveReplicaFaultCompletedEvent + * + * @returns {object} metadata of ChaosRemoveReplicaFaultCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosRemoveReplicaFaultCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosRemoveReplicaFaultCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + }, + serviceUri: { + required: true, + serializedName: 'ServiceUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosRemoveReplicaFaultCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosRemoveReplicaFaultScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosRemoveReplicaFaultScheduledEvent.js new file mode 100644 index 0000000000..2c52d3fc36 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosRemoveReplicaFaultScheduledEvent.js @@ -0,0 +1,120 @@ +/* + * 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'); + +/** + * Chaos Remove Replica Fault Scheduled event. + * + * @extends models['ReplicaEvent'] + */ +class ChaosRemoveReplicaFaultScheduledEvent extends models['ReplicaEvent'] { + /** + * Create a ChaosRemoveReplicaFaultScheduledEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosRemoveReplicaFaultScheduledEvent + * + * @returns {object} metadata of ChaosRemoveReplicaFaultScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosRemoveReplicaFaultScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosRemoveReplicaFaultScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + }, + serviceUri: { + required: true, + serializedName: 'ServiceUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosRemoveReplicaFaultScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosRestartCodePackageFaultCompletedEvent.js b/lib/services/serviceFabric/lib/models/chaosRestartCodePackageFaultCompletedEvent.js new file mode 100644 index 0000000000..600a07909e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosRestartCodePackageFaultCompletedEvent.js @@ -0,0 +1,138 @@ +/* + * 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'); + +/** + * Chaos Restart Code Package Fault Completed event. + * + * @extends models['ApplicationEvent'] + */ +class ChaosRestartCodePackageFaultCompletedEvent extends models['ApplicationEvent'] { + /** + * Create a ChaosRestartCodePackageFaultCompletedEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} serviceManifestName Service manifest name. + * @member {string} codePackageName Code package name. + * @member {string} servicePackageActivationId Id of Service package + * activation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosRestartCodePackageFaultCompletedEvent + * + * @returns {object} metadata of ChaosRestartCodePackageFaultCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosRestartCodePackageFaultCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosRestartCodePackageFaultCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + serviceManifestName: { + required: true, + serializedName: 'ServiceManifestName', + type: { + name: 'String' + } + }, + codePackageName: { + required: true, + serializedName: 'CodePackageName', + type: { + name: 'String' + } + }, + servicePackageActivationId: { + required: true, + serializedName: 'ServicePackageActivationId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosRestartCodePackageFaultCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosRestartCodePackageFaultScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosRestartCodePackageFaultScheduledEvent.js new file mode 100644 index 0000000000..664acfa537 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosRestartCodePackageFaultScheduledEvent.js @@ -0,0 +1,138 @@ +/* + * 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'); + +/** + * Chaos Restart Code Package Fault Scheduled event. + * + * @extends models['ApplicationEvent'] + */ +class ChaosRestartCodePackageFaultScheduledEvent extends models['ApplicationEvent'] { + /** + * Create a ChaosRestartCodePackageFaultScheduledEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} serviceManifestName Service manifest name. + * @member {string} codePackageName Code package name. + * @member {string} servicePackageActivationId Id of Service package + * activation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosRestartCodePackageFaultScheduledEvent + * + * @returns {object} metadata of ChaosRestartCodePackageFaultScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosRestartCodePackageFaultScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosRestartCodePackageFaultScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + serviceManifestName: { + required: true, + serializedName: 'ServiceManifestName', + type: { + name: 'String' + } + }, + codePackageName: { + required: true, + serializedName: 'CodePackageName', + type: { + name: 'String' + } + }, + servicePackageActivationId: { + required: true, + serializedName: 'ServicePackageActivationId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosRestartCodePackageFaultScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosRestartNodeFaultCompletedEvent.js b/lib/services/serviceFabric/lib/models/chaosRestartNodeFaultCompletedEvent.js new file mode 100644 index 0000000000..127f7bd434 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosRestartNodeFaultCompletedEvent.js @@ -0,0 +1,113 @@ +/* + * 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'); + +/** + * Chaos Restart Node Fault Completed event. + * + * @extends models['NodeEvent'] + */ +class ChaosRestartNodeFaultCompletedEvent extends models['NodeEvent'] { + /** + * Create a ChaosRestartNodeFaultCompletedEvent. + * @member {number} nodeInstanceId Id of Node instance. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosRestartNodeFaultCompletedEvent + * + * @returns {object} metadata of ChaosRestartNodeFaultCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosRestartNodeFaultCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosRestartNodeFaultCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstanceId: { + required: true, + serializedName: 'NodeInstanceId', + type: { + name: 'Number' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosRestartNodeFaultCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosRestartNodeFaultScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosRestartNodeFaultScheduledEvent.js new file mode 100644 index 0000000000..9b21ffa387 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosRestartNodeFaultScheduledEvent.js @@ -0,0 +1,113 @@ +/* + * 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'); + +/** + * Chaos Restart Node Fault Scheduled event. + * + * @extends models['NodeEvent'] + */ +class ChaosRestartNodeFaultScheduledEvent extends models['NodeEvent'] { + /** + * Create a ChaosRestartNodeFaultScheduledEvent. + * @member {number} nodeInstanceId Id of Node instance. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosRestartNodeFaultScheduledEvent + * + * @returns {object} metadata of ChaosRestartNodeFaultScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosRestartNodeFaultScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosRestartNodeFaultScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstanceId: { + required: true, + serializedName: 'NodeInstanceId', + type: { + name: 'Number' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosRestartNodeFaultScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosRestartReplicaFaultScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosRestartReplicaFaultScheduledEvent.js new file mode 100644 index 0000000000..aa0a7e71f2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosRestartReplicaFaultScheduledEvent.js @@ -0,0 +1,120 @@ +/* + * 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'); + +/** + * Chaos Restart Replica Fault Scheduled event. + * + * @extends models['ReplicaEvent'] + */ +class ChaosRestartReplicaFaultScheduledEvent extends models['ReplicaEvent'] { + /** + * Create a ChaosRestartReplicaFaultScheduledEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosRestartReplicaFaultScheduledEvent + * + * @returns {object} metadata of ChaosRestartReplicaFaultScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosRestartReplicaFaultScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosRestartReplicaFaultScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + }, + faultGroupId: { + required: true, + serializedName: 'FaultGroupId', + type: { + name: 'String' + } + }, + faultId: { + required: true, + serializedName: 'FaultId', + type: { + name: 'String' + } + }, + serviceUri: { + required: true, + serializedName: 'ServiceUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosRestartReplicaFaultScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosSchedule.js b/lib/services/serviceFabric/lib/models/chaosSchedule.js new file mode 100644 index 0000000000..0b2f37d50b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosSchedule.js @@ -0,0 +1,98 @@ +/* + * 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'; + +/** + * Defines the schedule used by Chaos. + * + */ +class ChaosSchedule { + /** + * Create a ChaosSchedule. + * @member {date} [startDate] The date and time Chaos will start using this + * schedule. Default value: new Date('1601-01-01T00:00:00Z') . + * @member {date} [expiryDate] The date and time Chaos will continue to use + * this schedule until. Default value: new Date('9999-12-31T23:59:59.999Z') . + * @member {array} [chaosParametersDictionary] A mapping of string names to + * Chaos Parameters to be referenced by Chaos Schedule Jobs. + * @member {array} [jobs] A list of all Chaos Schedule Jobs that will be + * automated by the schedule. + */ + constructor() { + } + + /** + * Defines the metadata of ChaosSchedule + * + * @returns {object} metadata of ChaosSchedule + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosSchedule', + type: { + name: 'Composite', + className: 'ChaosSchedule', + modelProperties: { + startDate: { + required: false, + serializedName: 'StartDate', + defaultValue: new Date('1601-01-01T00:00:00Z'), + type: { + name: 'DateTime' + } + }, + expiryDate: { + required: false, + serializedName: 'ExpiryDate', + defaultValue: new Date('9999-12-31T23:59:59.999Z'), + type: { + name: 'DateTime' + } + }, + chaosParametersDictionary: { + required: false, + serializedName: 'ChaosParametersDictionary', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ChaosParametersDictionaryItemElementType', + type: { + name: 'Composite', + className: 'ChaosParametersDictionaryItem' + } + } + } + }, + jobs: { + required: false, + serializedName: 'Jobs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ChaosScheduleJobElementType', + type: { + name: 'Composite', + className: 'ChaosScheduleJob' + } + } + } + } + } + } + }; + } +} + +module.exports = ChaosSchedule; diff --git a/lib/services/serviceFabric/lib/models/chaosScheduleDescription.js b/lib/services/serviceFabric/lib/models/chaosScheduleDescription.js new file mode 100644 index 0000000000..74ca7f3a63 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosScheduleDescription.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines the Chaos Schedule used by Chaos and the version of the Chaos + * Schedule. The version value wraps back to 0 after surpassing 2,147,483,647. + * + */ +class ChaosScheduleDescription { + /** + * Create a ChaosScheduleDescription. + * @member {number} [version] The version number of the Schedule. + * @member {object} [schedule] Defines the schedule used by Chaos. + * @member {date} [schedule.startDate] The date and time Chaos will start + * using this schedule. + * @member {date} [schedule.expiryDate] The date and time Chaos will continue + * to use this schedule until. + * @member {array} [schedule.chaosParametersDictionary] A mapping of string + * names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * @member {array} [schedule.jobs] A list of all Chaos Schedule Jobs that + * will be automated by the schedule. + */ + constructor() { + } + + /** + * Defines the metadata of ChaosScheduleDescription + * + * @returns {object} metadata of ChaosScheduleDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosScheduleDescription', + type: { + name: 'Composite', + className: 'ChaosScheduleDescription', + modelProperties: { + version: { + required: false, + serializedName: 'Version', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + schedule: { + required: false, + serializedName: 'Schedule', + type: { + name: 'Composite', + className: 'ChaosSchedule' + } + } + } + } + }; + } +} + +module.exports = ChaosScheduleDescription; diff --git a/lib/services/serviceFabric/lib/models/chaosScheduleJob.js b/lib/services/serviceFabric/lib/models/chaosScheduleJob.js new file mode 100644 index 0000000000..fbbaa37c30 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosScheduleJob.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines a repetition rule and parameters of Chaos to be used with the Chaos + * Schedule. + * + */ +class ChaosScheduleJob { + /** + * Create a ChaosScheduleJob. + * @member {string} [chaosParameters] A reference to which Chaos Parameters + * of the Chaos Schedule to use. + * @member {object} [days] Defines the days of the week that a Chaos Schedule + * Job will run for. + * @member {boolean} [days.sunday] Indicates if the Chaos Schedule Job will + * run on Sunday + * @member {boolean} [days.monday] Indicates if the Chaos Schedule Job will + * run on Monday + * @member {boolean} [days.tuesday] Indicates if the Chaos Schedule Job will + * run on Tuesday + * @member {boolean} [days.wednesday] Indicates if the Chaos Schedule Job + * will run on Wednesday + * @member {boolean} [days.thursday] Indicates if the Chaos Schedule Job will + * run on Thursday + * @member {boolean} [days.friday] Indicates if the Chaos Schedule Job will + * run on Friday + * @member {boolean} [days.saturday] Indicates if the Chaos Schedule Job will + * run on Saturday + * @member {array} [times] A list of Time Ranges that specify when during + * active days that this job will run. The times are interpreted as UTC. + */ + constructor() { + } + + /** + * Defines the metadata of ChaosScheduleJob + * + * @returns {object} metadata of ChaosScheduleJob + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosScheduleJob', + type: { + name: 'Composite', + className: 'ChaosScheduleJob', + modelProperties: { + chaosParameters: { + required: false, + serializedName: 'ChaosParameters', + type: { + name: 'String' + } + }, + days: { + required: false, + serializedName: 'Days', + type: { + name: 'Composite', + className: 'ChaosScheduleJobActiveDaysOfWeek' + } + }, + times: { + required: false, + serializedName: 'Times', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TimeRangeElementType', + type: { + name: 'Composite', + className: 'TimeRange' + } + } + } + } + } + } + }; + } +} + +module.exports = ChaosScheduleJob; diff --git a/lib/services/serviceFabric/lib/models/chaosScheduleJobActiveDaysOfWeek.js b/lib/services/serviceFabric/lib/models/chaosScheduleJobActiveDaysOfWeek.js new file mode 100644 index 0000000000..2fe33932e9 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosScheduleJobActiveDaysOfWeek.js @@ -0,0 +1,114 @@ +/* + * 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'; + +/** + * Defines the days of the week that a Chaos Schedule Job will run for. + * + */ +class ChaosScheduleJobActiveDaysOfWeek { + /** + * Create a ChaosScheduleJobActiveDaysOfWeek. + * @member {boolean} [sunday] Indicates if the Chaos Schedule Job will run on + * Sunday. Default value: false . + * @member {boolean} [monday] Indicates if the Chaos Schedule Job will run on + * Monday. Default value: false . + * @member {boolean} [tuesday] Indicates if the Chaos Schedule Job will run + * on Tuesday. Default value: false . + * @member {boolean} [wednesday] Indicates if the Chaos Schedule Job will run + * on Wednesday. Default value: false . + * @member {boolean} [thursday] Indicates if the Chaos Schedule Job will run + * on Thursday. Default value: false . + * @member {boolean} [friday] Indicates if the Chaos Schedule Job will run on + * Friday. Default value: false . + * @member {boolean} [saturday] Indicates if the Chaos Schedule Job will run + * on Saturday. Default value: false . + */ + constructor() { + } + + /** + * Defines the metadata of ChaosScheduleJobActiveDaysOfWeek + * + * @returns {object} metadata of ChaosScheduleJobActiveDaysOfWeek + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosScheduleJobActiveDaysOfWeek', + type: { + name: 'Composite', + className: 'ChaosScheduleJobActiveDaysOfWeek', + modelProperties: { + sunday: { + required: false, + serializedName: 'Sunday', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + monday: { + required: false, + serializedName: 'Monday', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + tuesday: { + required: false, + serializedName: 'Tuesday', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + wednesday: { + required: false, + serializedName: 'Wednesday', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + thursday: { + required: false, + serializedName: 'Thursday', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + friday: { + required: false, + serializedName: 'Friday', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + saturday: { + required: false, + serializedName: 'Saturday', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ChaosScheduleJobActiveDaysOfWeek; diff --git a/lib/services/serviceFabric/lib/models/chaosStartedEvent.js b/lib/services/serviceFabric/lib/models/chaosStartedEvent.js new file mode 100644 index 0000000000..261533277b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosStartedEvent.js @@ -0,0 +1,166 @@ +/* + * 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'); + +/** + * Chaos Started event. + * + * @extends models['ClusterEvent'] + */ +class ChaosStartedEvent extends models['ClusterEvent'] { + /** + * Create a ChaosStartedEvent. + * @member {number} maxConcurrentFaults Maximum number of concurrent faults. + * @member {number} timeToRunInSeconds Time to run in seconds. + * @member {number} maxClusterStabilizationTimeoutInSeconds Maximum timeout + * for cluster stabilization in seconds. + * @member {number} waitTimeBetweenIterationsInSeconds Wait time between + * iterations in seconds. + * @member {number} waitTimeBetweenFautlsInSeconds Wait time between faults + * in seconds. + * @member {boolean} moveReplicaFaultEnabled Indicates MoveReplica fault is + * enabled. + * @member {string} includedNodeTypeList List of included Node types. + * @member {string} includedApplicationList List of included Applications. + * @member {string} clusterHealthPolicy Health policy. + * @member {string} chaosContext Chaos Context. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosStartedEvent + * + * @returns {object} metadata of ChaosStartedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosStarted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosStartedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + maxConcurrentFaults: { + required: true, + serializedName: 'MaxConcurrentFaults', + type: { + name: 'Number' + } + }, + timeToRunInSeconds: { + required: true, + serializedName: 'TimeToRunInSeconds', + type: { + name: 'Number' + } + }, + maxClusterStabilizationTimeoutInSeconds: { + required: true, + serializedName: 'MaxClusterStabilizationTimeoutInSeconds', + type: { + name: 'Number' + } + }, + waitTimeBetweenIterationsInSeconds: { + required: true, + serializedName: 'WaitTimeBetweenIterationsInSeconds', + type: { + name: 'Number' + } + }, + waitTimeBetweenFautlsInSeconds: { + required: true, + serializedName: 'WaitTimeBetweenFautlsInSeconds', + type: { + name: 'Number' + } + }, + moveReplicaFaultEnabled: { + required: true, + serializedName: 'MoveReplicaFaultEnabled', + type: { + name: 'Boolean' + } + }, + includedNodeTypeList: { + required: true, + serializedName: 'IncludedNodeTypeList', + type: { + name: 'String' + } + }, + includedApplicationList: { + required: true, + serializedName: 'IncludedApplicationList', + type: { + name: 'String' + } + }, + clusterHealthPolicy: { + required: true, + serializedName: 'ClusterHealthPolicy', + type: { + name: 'String' + } + }, + chaosContext: { + required: true, + serializedName: 'ChaosContext', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosStartedEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosStoppedEvent.js b/lib/services/serviceFabric/lib/models/chaosStoppedEvent.js new file mode 100644 index 0000000000..0d8f89b95c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosStoppedEvent.js @@ -0,0 +1,90 @@ +/* + * 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'); + +/** + * Chaos Stopped event. + * + * @extends models['ClusterEvent'] + */ +class ChaosStoppedEvent extends models['ClusterEvent'] { + /** + * Create a ChaosStoppedEvent. + * @member {string} reason Describes reason. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosStoppedEvent + * + * @returns {object} metadata of ChaosStoppedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosStopped', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosStoppedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + reason: { + required: true, + serializedName: 'Reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ChaosStoppedEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosTargetFilter.js b/lib/services/serviceFabric/lib/models/chaosTargetFilter.js new file mode 100644 index 0000000000..a6f8ef0926 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosTargetFilter.js @@ -0,0 +1,120 @@ +/* + * 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'; + +/** + * Defines all filters for targeted Chaos faults, for example, faulting only + * certain node types or faulting only certain applications. + * If ChaosTargetFilter is not used, Chaos faults all cluster entities. If + * ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter + * specification. NodeTypeInclusionList and ApplicationInclusionList allow a + * union semantics only. It is not possible to specify an intersection + * of NodeTypeInclusionList and ApplicationInclusionList. For example, it is + * not possible to specify "fault this application only when it is on that node + * type." + * Once an entity is included in either NodeTypeInclusionList or + * ApplicationInclusionList, that entity cannot be excluded using + * ChaosTargetFilter. Even if + * applicationX does not appear in ApplicationInclusionList, in some Chaos + * iteration applicationX can be faulted because it happens to be on a node of + * nodeTypeY that is included + * in NodeTypeInclusionList. If both NodeTypeInclusionList and + * ApplicationInclusionList are null or empty, an ArgumentException is thrown. + * + */ +class ChaosTargetFilter { + /** + * Create a ChaosTargetFilter. + * @member {array} [nodeTypeInclusionList] A list of node types to include in + * Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the + * nodes of these node types. + * If a nodetype (say NodeTypeX) does not appear in the + * NodeTypeInclusionList, then node level faults (like NodeRestart) will + * never be enabled for the nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [applicationInclusionList] A list of application URI's to + * include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas + * of these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement + * constraints and applicationX is absent from ApplicationInclusionList and + * nodeTypeY is absent from NodeTypeInclusionList, then applicationX will + * never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. + */ + constructor() { + } + + /** + * Defines the metadata of ChaosTargetFilter + * + * @returns {object} metadata of ChaosTargetFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosTargetFilter', + type: { + name: 'Composite', + className: 'ChaosTargetFilter', + modelProperties: { + nodeTypeInclusionList: { + required: false, + serializedName: 'NodeTypeInclusionList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + applicationInclusionList: { + required: false, + serializedName: 'ApplicationInclusionList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ChaosTargetFilter; diff --git a/lib/services/serviceFabric/lib/models/checkExistsPropertyBatchOperation.js b/lib/services/serviceFabric/lib/models/checkExistsPropertyBatchOperation.js new file mode 100644 index 0000000000..9a68de6cd3 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/checkExistsPropertyBatchOperation.js @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a PropertyBatchOperation that compares the Boolean existence of a + * property with the Exists argument. + * The PropertyBatchOperation operation fails if the property's existence is + * not equal to the Exists argument. + * The CheckExistsPropertyBatchOperation is generally used as a precondition + * for the write operations in the batch. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. + * + * @extends models['PropertyBatchOperation'] + */ +class CheckExistsPropertyBatchOperation extends models['PropertyBatchOperation'] { + /** + * Create a CheckExistsPropertyBatchOperation. + * @member {boolean} exists Whether or not the property should exist for the + * operation to pass. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CheckExistsPropertyBatchOperation + * + * @returns {object} metadata of CheckExistsPropertyBatchOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckExists', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'CheckExistsPropertyBatchOperation', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + exists: { + required: true, + serializedName: 'Exists', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = CheckExistsPropertyBatchOperation; diff --git a/lib/services/serviceFabric/lib/models/checkSequencePropertyBatchOperation.js b/lib/services/serviceFabric/lib/models/checkSequencePropertyBatchOperation.js new file mode 100644 index 0000000000..c5c1baf7b1 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/checkSequencePropertyBatchOperation.js @@ -0,0 +1,84 @@ +/* + * 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'); + +/** + * Compares the Sequence Number of a property with the SequenceNumber argument. + * A property's sequence number can be thought of as that property's version. + * Every time the property is modified, its sequence number is increased. + * The sequence number can be found in a property's metadata. + * The comparison fails if the sequence numbers are not equal. + * CheckSequencePropertyBatchOperation is generally used as a precondition for + * the write operations in the batch. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. + * + * @extends models['PropertyBatchOperation'] + */ +class CheckSequencePropertyBatchOperation extends models['PropertyBatchOperation'] { + /** + * Create a CheckSequencePropertyBatchOperation. + * @member {string} sequenceNumber The expected sequence number. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CheckSequencePropertyBatchOperation + * + * @returns {object} metadata of CheckSequencePropertyBatchOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckSequence', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'CheckSequencePropertyBatchOperation', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckSequencePropertyBatchOperation; diff --git a/lib/services/serviceFabric/lib/models/checkValuePropertyBatchOperation.js b/lib/services/serviceFabric/lib/models/checkValuePropertyBatchOperation.js new file mode 100644 index 0000000000..c7a3657f03 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/checkValuePropertyBatchOperation.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a PropertyBatchOperation that compares the value of the property + * with the expected value. + * The CheckValuePropertyBatchOperation is generally used as a precondition for + * the write operations in the batch. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. + * + * @extends models['PropertyBatchOperation'] + */ +class CheckValuePropertyBatchOperation extends models['PropertyBatchOperation'] { + /** + * Create a CheckValuePropertyBatchOperation. + * @member {object} value The expected property value. + * @member {string} [value.kind] Polymorphic Discriminator + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CheckValuePropertyBatchOperation + * + * @returns {object} metadata of CheckValuePropertyBatchOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckValue', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'CheckValuePropertyBatchOperation', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'Value', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'PropertyValue' + } + } + } + } + }; + } +} + +module.exports = CheckValuePropertyBatchOperation; diff --git a/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js b/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js index 34fa26dd65..0f57bdfdd8 100644 --- a/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js +++ b/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js @@ -9,7 +9,8 @@ */ 'use strict'; -var moment = require('moment'); + +const moment = require('moment'); /** * Describes the parameters for a standalone cluster configuration upgrade. @@ -45,6 +46,12 @@ class ClusterConfigurationUpgradeDescription { * allowed percentage of upgrade domain delta health degradation during the * upgrade. Allowed values are integer values from zero to 100. 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. + * @member {array} [applicationHealthPolicies.applicationHealthPolicyMap] The + * wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ constructor() { } @@ -141,6 +148,14 @@ class ClusterConfigurationUpgradeDescription { type: { name: 'Number' } + }, + applicationHealthPolicies: { + required: false, + serializedName: 'ApplicationHealthPolicies', + type: { + name: 'Composite', + className: 'ApplicationHealthPolicies' + } } } } diff --git a/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeStatusInfo.js b/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeStatusInfo.js index 0ccf71759b..aa0c5cc4f1 100644 --- a/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeStatusInfo.js +++ b/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeStatusInfo.js @@ -17,8 +17,9 @@ class ClusterConfigurationUpgradeStatusInfo { /** * Create a ClusterConfigurationUpgradeStatusInfo. - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', + * @member {string} [upgradeState] The state of the upgrade domain. Possible + * values include: 'Invalid', 'RollingBackInProgress', + * 'RollingBackCompleted', 'RollingForwardPending', * 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed' * @member {number} [progressStatus] The cluster manifest version. * @member {string} [configVersion] The cluster configuration version. diff --git a/lib/services/serviceFabric/lib/models/clusterEvent.js b/lib/services/serviceFabric/lib/models/clusterEvent.js new file mode 100644 index 0000000000..e5d5f1deb2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterEvent.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Cluster Events. + * + * @extends models['FabricEvent'] + */ +class ClusterEvent extends models['FabricEvent'] { + /** + * Create a ClusterEvent. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterEvent + * + * @returns {object} metadata of ClusterEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ClusterEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterHealth.js b/lib/services/serviceFabric/lib/models/clusterHealth.js index 6b5630e79d..6c7f170f8f 100644 --- a/lib/services/serviceFabric/lib/models/clusterHealth.js +++ b/lib/services/serviceFabric/lib/models/clusterHealth.js @@ -18,7 +18,6 @@ const models = require('./index'); * node health states as well as the health events and the unhealthy * evaluations. * - * * @extends models['EntityHealth'] */ class ClusterHealth extends models['EntityHealth'] { diff --git a/lib/services/serviceFabric/lib/models/clusterHealthChunk.js b/lib/services/serviceFabric/lib/models/clusterHealthChunk.js index d142aef17c..7fbaf8850b 100644 --- a/lib/services/serviceFabric/lib/models/clusterHealthChunk.js +++ b/lib/services/serviceFabric/lib/models/clusterHealthChunk.js @@ -10,24 +10,30 @@ 'use strict'; -const models = require('./index'); - /** * Represents the health chunk of the cluster. * Contains the cluster aggregated health state, and the cluster entities that * respect the input filter. * - * */ class ClusterHealthChunk { /** * Create a ClusterHealthChunk. - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', + * @member {string} [healthState] The HealthState representing the aggregated + * health state of the cluster computed by Health Manager. + * The health evaluation of the entity reflects all events reported on the + * entity and its children (if any). + * The aggregation is done by applying the desired cluster health policy and + * the application health policies. Possible values include: 'Invalid', 'Ok', * 'Warning', 'Error', 'Unknown' - * @member {object} [nodeHealthStateChunks] + * @member {object} [nodeHealthStateChunks] The list of node health state + * chunks in the cluster that respect the filters in the cluster health chunk + * query description. * @member {array} [nodeHealthStateChunks.items] The list of node health * state chunks that respect the input filters in the chunk query. - * @member {object} [applicationHealthStateChunks] + * @member {object} [applicationHealthStateChunks] The list of application + * health state chunks in the cluster that respect the filters in the cluster + * health chunk query description. * @member {array} [applicationHealthStateChunks.items] The list of * application health state chunks that respect the input filters in the * chunk query. diff --git a/lib/services/serviceFabric/lib/models/clusterHealthChunkQueryDescription.js b/lib/services/serviceFabric/lib/models/clusterHealthChunkQueryDescription.js index c048b75f34..28bb2d0b1e 100644 --- a/lib/services/serviceFabric/lib/models/clusterHealthChunkQueryDescription.js +++ b/lib/services/serviceFabric/lib/models/clusterHealthChunkQueryDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The cluster health chunk query description, which can specify the health * policies to evaluate cluster health and very expressive filters to select @@ -40,7 +38,8 @@ class ClusterHealthChunkQueryDescription { * For example, it can specify a filter to return all applications with * health state Error and another filter to always include applications of a * specified application type. - * @member {object} [clusterHealthPolicy] + * @member {object} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The @@ -75,8 +74,35 @@ class ClusterHealthChunkQueryDescription { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [applicationHealthPolicies] - * @member {array} [applicationHealthPolicies.applicationHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [applicationHealthPolicies] Defines the application + * health policy map used to evaluate the health of an application or one of + * its children entities. + * @member {array} [applicationHealthPolicies.applicationHealthPolicyMap] The + * wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/clusterHealthPolicies.js b/lib/services/serviceFabric/lib/models/clusterHealthPolicies.js index eb4357128d..93e0f375cf 100644 --- a/lib/services/serviceFabric/lib/models/clusterHealthPolicies.js +++ b/lib/services/serviceFabric/lib/models/clusterHealthPolicies.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Health policies to evaluate cluster health. * @@ -19,8 +17,17 @@ const models = require('./index'); class ClusterHealthPolicies { /** * Create a ClusterHealthPolicies. - * @member {array} [applicationHealthPolicyMap] - * @member {object} [clusterHealthPolicy] + * @member {array} [applicationHealthPolicyMap] Defines a map that contains + * specific application health policies for different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * @member {object} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The @@ -55,6 +62,29 @@ class ClusterHealthPolicies { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/clusterHealthPolicy.js b/lib/services/serviceFabric/lib/models/clusterHealthPolicy.js index 6e47613e67..bbefc8351d 100644 --- a/lib/services/serviceFabric/lib/models/clusterHealthPolicy.js +++ b/lib/services/serviceFabric/lib/models/clusterHealthPolicy.js @@ -10,13 +10,10 @@ '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 { /** @@ -37,8 +34,7 @@ class ClusterHealthPolicy { * 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 . + * 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 @@ -53,9 +49,30 @@ class ClusterHealthPolicy { * 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 {array} [applicationTypeHealthPolicyMap] + * applications. Default percentage is zero. Default value: 0 . + * @member {array} [applicationTypeHealthPolicyMap] Defines a map with max + * percentage unhealthy applications for specific application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/clusterHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/clusterHealthReportCreatedEvent.js new file mode 100644 index 0000000000..9597ab33a9 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterHealthReportCreatedEvent.js @@ -0,0 +1,146 @@ +/* + * 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'); + +/** + * Cluster Health Report Created event. + * + * @extends models['ClusterEvent'] + */ +class ClusterHealthReportCreatedEvent extends models['ClusterEvent'] { + /** + * Create a ClusterHealthReportCreatedEvent. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterHealthReportCreatedEvent + * + * @returns {object} metadata of ClusterHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ClusterHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/clusterHealthReportExpiredEvent.js new file mode 100644 index 0000000000..aa8a98e62e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterHealthReportExpiredEvent.js @@ -0,0 +1,146 @@ +/* + * 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'); + +/** + * Cluster Health Report Expired event. + * + * @extends models['ClusterEvent'] + */ +class ClusterHealthReportExpiredEvent extends models['ClusterEvent'] { + /** + * Create a ClusterHealthReportExpiredEvent. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterHealthReportExpiredEvent + * + * @returns {object} metadata of ClusterHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ClusterHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeCompleteEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeCompleteEvent.js new file mode 100644 index 0000000000..19a9233ff5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeCompleteEvent.js @@ -0,0 +1,99 @@ +/* + * 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'); + +/** + * Cluster Upgrade Complete event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeCompleteEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeCompleteEvent. + * @member {string} targetClusterVersion Target Cluster version. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterUpgradeCompleteEvent + * + * @returns {object} metadata of ClusterUpgradeCompleteEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeComplete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeCompleteEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + targetClusterVersion: { + required: true, + serializedName: 'TargetClusterVersion', + type: { + name: 'String' + } + }, + overallUpgradeElapsedTimeInMs: { + required: true, + serializedName: 'OverallUpgradeElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ClusterUpgradeCompleteEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeDescriptionObject.js b/lib/services/serviceFabric/lib/models/clusterUpgradeDescriptionObject.js index 72a408f4c5..8ab4cb7040 100644 --- a/lib/services/serviceFabric/lib/models/clusterUpgradeDescriptionObject.js +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeDescriptionObject.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents a ServiceFabric cluster upgrade * @@ -19,26 +17,69 @@ const models = require('./index'); class ClusterUpgradeDescriptionObject { /** * Create a ClusterUpgradeDescriptionObject. - * @member {string} [configVersion] - * @member {string} [codeVersion] - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', + * @member {string} [configVersion] The cluster configuration version + * (specified in the cluster manifest). + * @member {string} [codeVersion] The ServiceFabric code version of the + * cluster. + * @member {string} [upgradeKind] The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health + * during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {boolean} [enableDeltaHealthEvaluation] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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 {boolean} [enableDeltaHealthEvaluation] When true, enables delta + * health evaluation rather than absolute health evaluation after completion + * of each upgrade domain. + * @member {object} [monitoringPolicy] Describes the parameters for + * monitoring an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} - * [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * [monitoringPolicy.healthCheckStableDurationInMilliseconds] 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [clusterHealthPolicy] + * 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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The @@ -73,7 +114,31 @@ class ClusterUpgradeDescriptionObject { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [clusterUpgradeHealthPolicy] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [clusterUpgradeHealthPolicy] Defines a health policy used + * to evaluate the health of the cluster during a cluster upgrade. * @member {number} * [clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] The maximum * allowed percentage of nodes health degradation allowed during cluster @@ -91,7 +156,15 @@ class ClusterUpgradeDescriptionObject { * 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. The default value is 15%. - * @member {array} [applicationHealthPolicyMap] + * @member {array} [applicationHealthPolicyMap] Defines a map that contains + * specific application health policies for different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeDomainCompleteEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeDomainCompleteEvent.js new file mode 100644 index 0000000000..482594cc81 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeDomainCompleteEvent.js @@ -0,0 +1,115 @@ +/* + * 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'); + +/** + * Cluster Upgrade Domain Complete event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeDomainCompleteEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeDomainCompleteEvent. + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} upgradeState State of upgrade. + * @member {string} upgradeDomains Upgrade domains. + * @member {number} upgradeDomainElapsedTimeInMs Duration of domain upgrade + * in milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterUpgradeDomainCompleteEvent + * + * @returns {object} metadata of ClusterUpgradeDomainCompleteEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeDomainComplete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeDomainCompleteEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + targetClusterVersion: { + required: true, + serializedName: 'TargetClusterVersion', + type: { + name: 'String' + } + }, + upgradeState: { + required: true, + serializedName: 'UpgradeState', + type: { + name: 'String' + } + }, + upgradeDomains: { + required: true, + serializedName: 'UpgradeDomains', + type: { + name: 'String' + } + }, + upgradeDomainElapsedTimeInMs: { + required: true, + serializedName: 'UpgradeDomainElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ClusterUpgradeDomainCompleteEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeProgressObject.js b/lib/services/serviceFabric/lib/models/clusterUpgradeProgressObject.js index 161d5b164a..80ca0268e5 100644 --- a/lib/services/serviceFabric/lib/models/clusterUpgradeProgressObject.js +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeProgressObject.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a cluster upgrade. * @@ -19,41 +17,93 @@ const models = require('./index'); class ClusterUpgradeProgressObject { /** * Create a ClusterUpgradeProgressObject. - * @member {string} [codeVersion] - * @member {string} [configVersion] - * @member {array} [upgradeDomains] - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', + * @member {string} [codeVersion] The ServiceFabric code version of the + * cluster. + * @member {string} [configVersion] The cluster configuration version + * (specified in the cluster manifest). + * @member {array} [upgradeDomains] List of upgrade domains and their + * statuses. + * @member {string} [upgradeState] The state of the upgrade domain. Possible + * values include: 'Invalid', 'RollingBackInProgress', + * 'RollingBackCompleted', 'RollingForwardPending', * 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed' - * @member {string} [nextUpgradeDomain] - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', + * @member {string} [nextUpgradeDomain] The name of the next upgrade domain + * to be processed. + * @member {string} [rollingUpgradeMode] The mode used to monitor health + * during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: * 'UnmonitoredAuto' . - * @member {object} [upgradeDescription] - * @member {string} [upgradeDescription.configVersion] - * @member {string} [upgradeDescription.codeVersion] - * @member {string} [upgradeDescription.upgradeKind] Possible values include: - * 'Invalid', 'Rolling' - * @member {string} [upgradeDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {object} [upgradeDescription] Represents a ServiceFabric cluster + * upgrade + * @member {string} [upgradeDescription.configVersion] The cluster + * configuration version (specified in the cluster manifest). + * @member {string} [upgradeDescription.codeVersion] The ServiceFabric code + * version of the cluster. + * @member {string} [upgradeDescription.upgradeKind] The kind of upgrade out + * of the following possible values. Possible values include: 'Invalid', + * 'Rolling' + * @member {string} [upgradeDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * @member {number} - * [upgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [upgradeDescription.forceRestart] - * @member {boolean} [upgradeDescription.enableDeltaHealthEvaluation] - * @member {object} [upgradeDescription.monitoringPolicy] - * @member {string} [upgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [upgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [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 {boolean} [upgradeDescription.enableDeltaHealthEvaluation] When + * true, enables delta health evaluation rather than absolute health + * evaluation after completion of each upgrade domain. + * @member {object} [upgradeDescription.monitoringPolicy] Describes the + * parameters for monitoring an upgrade in Monitored mode. + * @member {string} [upgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} * [upgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} - * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] 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} * [upgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [upgradeDescription.clusterHealthPolicy] + * 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} [upgradeDescription.clusterHealthPolicy] Defines a health + * policy used to evaluate the health of the cluster or of a cluster node. * @member {boolean} * [upgradeDescription.clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. @@ -92,7 +142,32 @@ class ClusterUpgradeProgressObject { * applications. Default percentage is zero. * @member {array} * [upgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [upgradeDescription.clusterUpgradeHealthPolicy] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [upgradeDescription.clusterUpgradeHealthPolicy] Defines a + * health policy used to evaluate the health of the cluster during a cluster + * upgrade. * @member {number} * [upgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] * The maximum allowed percentage of nodes health degradation allowed during @@ -110,20 +185,41 @@ class ClusterUpgradeProgressObject { * 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. The default value is 15%. - * @member {array} [upgradeDescription.applicationHealthPolicyMap] - * @member {string} [upgradeDurationInMilliseconds] - * @member {string} [upgradeDomainDurationInMilliseconds] - * @member {array} [unhealthyEvaluations] - * @member {object} [currentUpgradeDomainProgress] - * @member {string} [currentUpgradeDomainProgress.domainName] + * @member {array} [upgradeDescription.applicationHealthPolicyMap] Defines a + * map that contains specific application health policies for different + * applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * @member {string} [upgradeDurationInMilliseconds] The estimated elapsed + * time spent processing the current overall upgrade. + * @member {string} [upgradeDomainDurationInMilliseconds] The estimated + * elapsed time spent processing the current upgrade domain. + * @member {array} [unhealthyEvaluations] List of health evaluations that + * resulted in the current aggregated health state. + * @member {object} [currentUpgradeDomainProgress] Information about the + * current in-progress upgrade domain. + * @member {string} [currentUpgradeDomainProgress.domainName] The name of the + * upgrade domain * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] - * @member {string} [startTimestampUtc] - * @member {string} [failureTimestampUtc] - * @member {string} [failureReason] Possible values include: 'None', - * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'UpgradeTimeout' - * @member {object} [upgradeDomainProgressAtFailure] - * @member {string} [upgradeDomainProgressAtFailure.domainName] + * List of upgrading nodes and their statuses + * @member {string} [startTimestampUtc] The start time of the upgrade in UTC. + * @member {string} [failureTimestampUtc] The failure time of the upgrade in + * UTC. + * @member {string} [failureReason] The cause of an upgrade failure that + * resulted in FailureAction being executed. Possible values include: 'None', + * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', + * 'OverallUpgradeTimeout' + * @member {object} [upgradeDomainProgressAtFailure] The detailed upgrade + * progress for nodes in the current upgrade domain at the point of failure. + * @member {string} [upgradeDomainProgressAtFailure.domainName] The name of + * the upgrade domain * @member {array} [upgradeDomainProgressAtFailure.nodeUpgradeProgressList] + * List of upgrading nodes and their statuses */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackCompleteEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackCompleteEvent.js new file mode 100644 index 0000000000..17a02a44c8 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackCompleteEvent.js @@ -0,0 +1,107 @@ +/* + * 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'); + +/** + * Cluster Upgrade Rollback Complete event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeRollbackCompleteEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeRollbackCompleteEvent. + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} failureReason Describes failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterUpgradeRollbackCompleteEvent + * + * @returns {object} metadata of ClusterUpgradeRollbackCompleteEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeRollbackComplete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeRollbackCompleteEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + targetClusterVersion: { + required: true, + serializedName: 'TargetClusterVersion', + type: { + name: 'String' + } + }, + failureReason: { + required: true, + serializedName: 'FailureReason', + type: { + name: 'String' + } + }, + overallUpgradeElapsedTimeInMs: { + required: true, + serializedName: 'OverallUpgradeElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ClusterUpgradeRollbackCompleteEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackStartEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackStartEvent.js new file mode 100644 index 0000000000..780d100402 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackStartEvent.js @@ -0,0 +1,107 @@ +/* + * 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'); + +/** + * Cluster Upgrade Rollback Start event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeRollbackStartEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeRollbackStartEvent. + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} failureReason Describes failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterUpgradeRollbackStartEvent + * + * @returns {object} metadata of ClusterUpgradeRollbackStartEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeRollbackStart', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeRollbackStartEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + targetClusterVersion: { + required: true, + serializedName: 'TargetClusterVersion', + type: { + name: 'String' + } + }, + failureReason: { + required: true, + serializedName: 'FailureReason', + type: { + name: 'String' + } + }, + overallUpgradeElapsedTimeInMs: { + required: true, + serializedName: 'OverallUpgradeElapsedTimeInMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ClusterUpgradeRollbackStartEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeStartEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeStartEvent.js new file mode 100644 index 0000000000..0dc43c4998 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeStartEvent.js @@ -0,0 +1,122 @@ +/* + * 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'); + +/** + * Cluster Upgrade Start event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeStartEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeStartEvent. + * @member {string} currentClusterVersion Current Cluster version. + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} upgradeType Type of upgrade. + * @member {string} rollingUpgradeMode Mode of upgrade. + * @member {string} failureAction Action if failed. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterUpgradeStartEvent + * + * @returns {object} metadata of ClusterUpgradeStartEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeStart', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeStartEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + currentClusterVersion: { + required: true, + serializedName: 'CurrentClusterVersion', + type: { + name: 'String' + } + }, + targetClusterVersion: { + required: true, + serializedName: 'TargetClusterVersion', + type: { + name: 'String' + } + }, + upgradeType: { + required: true, + serializedName: 'UpgradeType', + type: { + name: 'String' + } + }, + rollingUpgradeMode: { + required: true, + serializedName: 'RollingUpgradeMode', + type: { + name: 'String' + } + }, + failureAction: { + required: true, + serializedName: 'FailureAction', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ClusterUpgradeStartEvent; diff --git a/lib/services/serviceFabric/lib/models/codePackageEntryPoint.js b/lib/services/serviceFabric/lib/models/codePackageEntryPoint.js index ad91c3880e..9c19f4c5ab 100644 --- a/lib/services/serviceFabric/lib/models/codePackageEntryPoint.js +++ b/lib/services/serviceFabric/lib/models/codePackageEntryPoint.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about setup or main entry point of a code package deployed on a * Service Fabric node. @@ -22,10 +20,11 @@ class CodePackageEntryPoint { * Create a CodePackageEntryPoint. * @member {string} [entryPointLocation] The location of entry point * executable on the node. - * @member {string} [processId] The process id of the entry point. + * @member {string} [processId] The process ID of the entry point. * @member {string} [runAsUserName] The user name under which entry point * executable is run on the node. - * @member {object} [codePackageEntryPointStatistics] + * @member {object} [codePackageEntryPointStatistics] Statistics about setup + * or main entry point of a code package deployed on a Service Fabric node. * @member {string} [codePackageEntryPointStatistics.lastExitCode] The last * exit code of the entry point. * @member {date} [codePackageEntryPointStatistics.lastActivationTime] The @@ -51,11 +50,15 @@ class CodePackageEntryPoint { * @member {string} * [codePackageEntryPointStatistics.continuousExitFailureCount] Number of * times the entry point continuously failed to exit gracefully. - * @member {string} [status] Possible values include: 'Invalid', 'Pending', - * 'Starting', 'Started', 'Stopping', 'Stopped' + * @member {string} [status] Specifies the status of the code package entry + * point deployed on a Service Fabric node. Possible values include: + * 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' * @member {date} [nextActivationTime] The time (in UTC) when the entry point * executable will be run next. - * @member {string} [instanceId] + * @member {string} [instanceId] The instance ID for current running entry + * point. For a code package setup entry point (if specified) runs first and + * after it finishes main entry point is started. Each time entry point + * executable is run, its instance id will change. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/composeDeploymentStatusInfo.js b/lib/services/serviceFabric/lib/models/composeDeploymentStatusInfo.js index 97d89a7923..15bff68c8b 100644 --- a/lib/services/serviceFabric/lib/models/composeDeploymentStatusInfo.js +++ b/lib/services/serviceFabric/lib/models/composeDeploymentStatusInfo.js @@ -17,11 +17,12 @@ class ComposeDeploymentStatusInfo { /** * Create a ComposeDeploymentStatusInfo. - * @member {string} [name] - * @member {string} [applicationName] - * @member {string} [status] Possible values include: 'Invalid', - * 'Provisioning', 'Creating', 'Ready', 'Unprovisioning', 'Deleting', - * 'Failed', 'Upgrading' + * @member {string} [name] The name of the deployment. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [status] The status of the compose deployment. Possible + * values include: 'Invalid', 'Provisioning', 'Creating', 'Ready', + * 'Unprovisioning', 'Deleting', 'Failed', 'Upgrading' * @member {string} [statusDetails] The status details of compose deployment * including failure message. */ diff --git a/lib/services/serviceFabric/lib/models/composeDeploymentUpgradeDescription.js b/lib/services/serviceFabric/lib/models/composeDeploymentUpgradeDescription.js index c0007bc739..c249db322c 100644 --- a/lib/services/serviceFabric/lib/models/composeDeploymentUpgradeDescription.js +++ b/lib/services/serviceFabric/lib/models/composeDeploymentUpgradeDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the parameters for a compose deployment upgrade. * @@ -19,33 +17,73 @@ const models = require('./index'); class ComposeDeploymentUpgradeDescription { /** * Create a ComposeDeploymentUpgradeDescription. - * @member {string} deploymentName + * @member {string} deploymentName The name of the deployment. * @member {string} composeFileContent The content of the compose file that * describes the deployment to create. - * @member {object} [registryCredential] + * @member {object} [registryCredential] Credential information to connect to + * container registry. * @member {string} [registryCredential.registryUserName] The user name to * connect to container registry. * @member {string} [registryCredential.registryPassword] The password for * supplied username to connect to container registry. * @member {boolean} [registryCredential.passwordEncrypted] Indicates that * supplied container registry password is encrypted. - * @member {string} upgradeKind Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', + * @member {string} upgradeKind The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health + * during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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} [monitoringPolicy] Describes the parameters for + * monitoring an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} - * [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * [monitoringPolicy.healthCheckStableDurationInMilliseconds] 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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 {boolean} [applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @member {number} @@ -61,6 +99,8 @@ class ComposeDeploymentUpgradeDescription { * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. @@ -101,7 +141,9 @@ class ComposeDeploymentUpgradeDescription { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @member {array} [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/serviceFabric/lib/models/composeDeploymentUpgradeProgressInfo.js b/lib/services/serviceFabric/lib/models/composeDeploymentUpgradeProgressInfo.js index 247ac90284..bf01c82727 100644 --- a/lib/services/serviceFabric/lib/models/composeDeploymentUpgradeProgressInfo.js +++ b/lib/services/serviceFabric/lib/models/composeDeploymentUpgradeProgressInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the parameters for a compose deployment upgrade. * @@ -19,31 +17,73 @@ const models = require('./index'); class ComposeDeploymentUpgradeProgressInfo { /** * Create a ComposeDeploymentUpgradeProgressInfo. - * @member {string} [deploymentName] - * @member {string} [applicationName] - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', + * @member {string} [deploymentName] The name of the target deployment. + * @member {string} [applicationName] The name of the target application, + * including the 'fabric:' URI scheme. + * @member {string} [upgradeState] The state of the compose deployment + * upgrade. Possible values include: 'Invalid', 'ProvisioningTarget', + * 'RollingForwardInProgress', 'RollingForwardPending', * 'UnprovisioningCurrent', 'RollingForwardCompleted', * 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', * 'Failed' - * @member {string} [upgradeStatusDetails] - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', + * @member {string} [upgradeStatusDetails] Additional detailed information + * about the status of the pending upgrade. + * @member {string} [upgradeKind] The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health + * during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: * 'UnmonitoredAuto' . - * @member {boolean} [forceRestart] - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @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 {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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 {object} [monitoringPolicy] Describes the parameters for + * monitoring an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} - * [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * [monitoringPolicy.healthCheckStableDurationInMilliseconds] 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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 {boolean} [applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @member {number} @@ -59,6 +99,8 @@ class ComposeDeploymentUpgradeProgressInfo { * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. @@ -99,22 +141,44 @@ class ComposeDeploymentUpgradeProgressInfo { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] - * @member {string} [targetApplicationTypeVersion] - * @member {string} [upgradeDuration] - * @member {string} [currentUpgradeDomainDuration] - * @member {array} [applicationUnhealthyEvaluations] - * @member {object} [currentUpgradeDomainProgress] - * @member {string} [currentUpgradeDomainProgress.domainName] + * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The + * map with service type health policy per service type name. The map is + * empty by default. + * @member {string} [targetApplicationTypeVersion] The target application + * type version (found in the application manifest) for the application + * upgrade. + * @member {string} [upgradeDuration] The estimated amount of time that the + * overall upgrade elapsed. 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} [currentUpgradeDomainDuration] The estimated amount of + * time spent processing current 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 {array} [applicationUnhealthyEvaluations] List of health + * evaluations that resulted in the current aggregated health state. + * @member {object} [currentUpgradeDomainProgress] Information about the + * current in-progress upgrade domain. + * @member {string} [currentUpgradeDomainProgress.domainName] The name of the + * upgrade domain * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] - * @member {string} [startTimestampUtc] - * @member {string} [failureTimestampUtc] - * @member {string} [failureReason] Possible values include: 'None', - * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'UpgradeTimeout' - * @member {object} [upgradeDomainProgressAtFailure] - * @member {string} [upgradeDomainProgressAtFailure.domainName] + * List of upgrading nodes and their statuses + * @member {string} [startTimestampUtc] The estimated UTC datetime when the + * upgrade started. + * @member {string} [failureTimestampUtc] The estimated UTC datetime when the + * upgrade failed and FailureAction was executed. + * @member {string} [failureReason] The cause of an upgrade failure that + * resulted in FailureAction being executed. Possible values include: 'None', + * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', + * 'OverallUpgradeTimeout' + * @member {object} [upgradeDomainProgressAtFailure] Information about the + * upgrade domain progress at the time of upgrade failure. + * @member {string} [upgradeDomainProgressAtFailure.domainName] The name of + * the upgrade domain * @member {array} [upgradeDomainProgressAtFailure.nodeUpgradeProgressList] - * @member {string} [applicationUpgradeStatusDetails] + * List of upgrading nodes and their statuses + * @member {string} [applicationUpgradeStatusDetails] Additional details of + * application upgrade including failure message. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/containerApiRequestBody.js b/lib/services/serviceFabric/lib/models/containerApiRequestBody.js new file mode 100644 index 0000000000..501c4398a5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerApiRequestBody.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * parameters for making container API call. + * + */ +class ContainerApiRequestBody { + /** + * Create a ContainerApiRequestBody. + * @member {string} [httpVerb] HTTP verb of container REST API, defaults to + * "GET" + * @member {string} uriPath URI path of container REST API + * @member {string} [contentType] Content type of container REST API request, + * defaults to "application/json" + * @member {string} [body] HTTP request body of container REST API + */ + constructor() { + } + + /** + * Defines the metadata of ContainerApiRequestBody + * + * @returns {object} metadata of ContainerApiRequestBody + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerApiRequestBody', + type: { + name: 'Composite', + className: 'ContainerApiRequestBody', + modelProperties: { + httpVerb: { + required: false, + serializedName: 'HttpVerb', + type: { + name: 'String' + } + }, + uriPath: { + required: true, + serializedName: 'UriPath', + type: { + name: 'String' + } + }, + contentType: { + required: false, + serializedName: 'Content-Type', + type: { + name: 'String' + } + }, + body: { + required: false, + serializedName: 'Body', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerApiRequestBody; diff --git a/lib/services/serviceFabric/lib/models/containerApiResponse.js b/lib/services/serviceFabric/lib/models/containerApiResponse.js new file mode 100644 index 0000000000..b7224482cb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerApiResponse.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * Response body that wraps container API result. + * + */ +class ContainerApiResponse { + /** + * Create a ContainerApiResponse. + * @member {object} containerApiResult Container API result. + * @member {number} [containerApiResult.status] HTTP status code returned by + * the target container API + * @member {string} [containerApiResult.contentType] HTTP content type + * @member {string} [containerApiResult.contentEncoding] HTTP content + * encoding + * @member {string} [containerApiResult.body] container API result body + */ + constructor() { + } + + /** + * Defines the metadata of ContainerApiResponse + * + * @returns {object} metadata of ContainerApiResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerApiResponse', + type: { + name: 'Composite', + className: 'ContainerApiResponse', + modelProperties: { + containerApiResult: { + required: true, + serializedName: 'ContainerApiResult', + type: { + name: 'Composite', + className: 'ContainerApiResult' + } + } + } + } + }; + } +} + +module.exports = ContainerApiResponse; diff --git a/lib/services/serviceFabric/lib/models/containerApiResult.js b/lib/services/serviceFabric/lib/models/containerApiResult.js new file mode 100644 index 0000000000..5099b215bf --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerApiResult.js @@ -0,0 +1,77 @@ +/* + * 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'; + +/** + * Container API result. + * + */ +class ContainerApiResult { + /** + * Create a ContainerApiResult. + * @member {number} status HTTP status code returned by the target container + * API + * @member {string} [contentType] HTTP content type + * @member {string} [contentEncoding] HTTP content encoding + * @member {string} [body] container API result body + */ + constructor() { + } + + /** + * Defines the metadata of ContainerApiResult + * + * @returns {object} metadata of ContainerApiResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerApiResult', + type: { + name: 'Composite', + className: 'ContainerApiResult', + modelProperties: { + status: { + required: true, + serializedName: 'Status', + type: { + name: 'Number' + } + }, + contentType: { + required: false, + serializedName: 'Content-Type', + type: { + name: 'String' + } + }, + contentEncoding: { + required: false, + serializedName: 'Content-Encoding', + type: { + name: 'String' + } + }, + body: { + required: false, + serializedName: 'Body', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerApiResult; diff --git a/lib/services/serviceFabric/lib/models/containerCodePackageProperties.js b/lib/services/serviceFabric/lib/models/containerCodePackageProperties.js new file mode 100644 index 0000000000..fd9c7a00ba --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerCodePackageProperties.js @@ -0,0 +1,258 @@ +/* + * 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 a container and its runtime properties. + * + */ +class ContainerCodePackageProperties { + /** + * Create a ContainerCodePackageProperties. + * @member {string} name The name of the code package. + * @member {string} image The Container image to use. + * @member {object} [imageRegistryCredential] Image registry credential. + * @member {string} [imageRegistryCredential.server] Docker image registry + * server, without protocol such as `http` and `https`. + * @member {string} [imageRegistryCredential.username] The username for the + * private registry. + * @member {string} [imageRegistryCredential.password] The password for the + * private registry. + * @member {string} [entrypoint] Override for the default entry point in the + * container. + * @member {array} [commands] Command array to execute within the container + * in exec form. + * @member {array} [environmentVariables] The environment variables to set in + * this container + * @member {array} [settings] The settings to set in this container. The + * setting file path can be fetched from environment variable + * "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The + * path for Linux container is "/var/secrets". + * @member {array} [labels] The labels to set in this container. + * @member {array} [endpoints] The endpoints exposed by this container. + * @member {object} resources This type describes the resource requirements + * for a container or a service. + * @member {object} [resources.requests] Describes the requested resources + * for a given container. + * @member {number} [resources.requests.memoryInGB] The memory request in GB + * for this container. + * @member {number} [resources.requests.cpu] Requested number of CPU cores. + * At present, only full cores are supported. + * @member {object} [resources.limits] Describes the maximum limits on the + * resources for a given container. + * @member {number} [resources.limits.memoryInGB] The memory limit in GB. + * @member {number} [resources.limits.cpu] CPU limits in cores. At present, + * only full cores are supported. + * @member {array} [volumeRefs] The volumes to be attached to the container. + * @member {object} [instanceView] Runtime information of a container + * instance. + * @member {number} [instanceView.restartCount] The number of times the + * container has been restarted. + * @member {object} [instanceView.currentState] Current container instance + * state. + * @member {string} [instanceView.currentState.state] The state of this + * container + * @member {date} [instanceView.currentState.startTime] Date/time when the + * container state started. + * @member {string} [instanceView.currentState.exitCode] The container exit + * code. + * @member {date} [instanceView.currentState.finishTime] Date/time when the + * container state finished. + * @member {string} [instanceView.currentState.detailStatus] Human-readable + * status of this state. + * @member {object} [instanceView.previousState] Previous container instance + * state. + * @member {string} [instanceView.previousState.state] The state of this + * container + * @member {date} [instanceView.previousState.startTime] Date/time when the + * container state started. + * @member {string} [instanceView.previousState.exitCode] The container exit + * code. + * @member {date} [instanceView.previousState.finishTime] Date/time when the + * container state finished. + * @member {string} [instanceView.previousState.detailStatus] Human-readable + * status of this state. + * @member {array} [instanceView.events] The events of this container + * instance. + * @member {object} [diagnostics] Reference to sinks in + * DiagnosticsDescription. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.sinkRefs] List of sinks to be used if + * enabled. References the list of sinks in DiagnosticsDescription. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerCodePackageProperties + * + * @returns {object} metadata of ContainerCodePackageProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerCodePackageProperties', + type: { + name: 'Composite', + className: 'ContainerCodePackageProperties', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + image: { + required: true, + serializedName: 'image', + type: { + name: 'String' + } + }, + imageRegistryCredential: { + required: false, + serializedName: 'imageRegistryCredential', + type: { + name: 'Composite', + className: 'ImageRegistryCredential' + } + }, + entrypoint: { + required: false, + serializedName: 'entrypoint', + type: { + name: 'String' + } + }, + commands: { + required: false, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + environmentVariables: { + required: false, + serializedName: 'environmentVariables', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EnvironmentVariableElementType', + type: { + name: 'Composite', + className: 'EnvironmentVariable' + } + } + } + }, + settings: { + required: false, + serializedName: 'settings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SettingElementType', + type: { + name: 'Composite', + className: 'Setting' + } + } + } + }, + labels: { + required: false, + serializedName: 'labels', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerLabelElementType', + type: { + name: 'Composite', + className: 'ContainerLabel' + } + } + } + }, + endpoints: { + required: false, + serializedName: 'endpoints', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EndpointPropertiesElementType', + type: { + name: 'Composite', + className: 'EndpointProperties' + } + } + } + }, + resources: { + required: true, + serializedName: 'resources', + type: { + name: 'Composite', + className: 'ResourceRequirements' + } + }, + volumeRefs: { + required: false, + serializedName: 'volumeRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerVolumeElementType', + type: { + name: 'Composite', + className: 'ContainerVolume' + } + } + } + }, + instanceView: { + required: false, + readOnly: true, + serializedName: 'instanceView', + type: { + name: 'Composite', + className: 'ContainerInstanceView' + } + }, + diagnostics: { + required: false, + serializedName: 'diagnostics', + type: { + name: 'Composite', + className: 'DiagnosticsRef' + } + } + } + } + }; + } +} + +module.exports = ContainerCodePackageProperties; diff --git a/lib/services/serviceFabric/lib/models/containerDeactivatedEvent.js b/lib/services/serviceFabric/lib/models/containerDeactivatedEvent.js new file mode 100644 index 0000000000..c6897eab49 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerDeactivatedEvent.js @@ -0,0 +1,187 @@ +/* + * 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'); + +/** + * Container Deactivated event. + * + * @extends models['ApplicationEvent'] + */ +class ContainerDeactivatedEvent extends models['ApplicationEvent'] { + /** + * Create a ContainerDeactivatedEvent. + * @member {string} serviceName Name of Service. + * @member {string} servicePackageName Name of Service package. + * @member {string} servicePackageActivationId Activation Id of Service + * package. + * @member {boolean} isExclusive Indicates IsExclusive flag. + * @member {string} codePackageName Name of Code package. + * @member {string} entryPointType Type of EntryPoint. + * @member {string} imageName Name of Container image. + * @member {string} containerName Name of Container. + * @member {string} hostId Host Id. + * @member {number} exitCode Exit code of process. + * @member {boolean} unexpectedTermination Indicates if termination is + * unexpected. + * @member {date} startTime Start time of process. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ContainerDeactivatedEvent + * + * @returns {object} metadata of ContainerDeactivatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerDeactivated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ContainerDeactivatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + serviceName: { + required: true, + serializedName: 'ServiceName', + type: { + name: 'String' + } + }, + servicePackageName: { + required: true, + serializedName: 'ServicePackageName', + type: { + name: 'String' + } + }, + servicePackageActivationId: { + required: true, + serializedName: 'ServicePackageActivationId', + type: { + name: 'String' + } + }, + isExclusive: { + required: true, + serializedName: 'IsExclusive', + type: { + name: 'Boolean' + } + }, + codePackageName: { + required: true, + serializedName: 'CodePackageName', + type: { + name: 'String' + } + }, + entryPointType: { + required: true, + serializedName: 'EntryPointType', + type: { + name: 'String' + } + }, + imageName: { + required: true, + serializedName: 'ImageName', + type: { + name: 'String' + } + }, + containerName: { + required: true, + serializedName: 'ContainerName', + type: { + name: 'String' + } + }, + hostId: { + required: true, + serializedName: 'HostId', + type: { + name: 'String' + } + }, + exitCode: { + required: true, + serializedName: 'ExitCode', + type: { + name: 'Number' + } + }, + unexpectedTermination: { + required: true, + serializedName: 'UnexpectedTermination', + type: { + name: 'Boolean' + } + }, + startTime: { + required: true, + serializedName: 'StartTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ContainerDeactivatedEvent; diff --git a/lib/services/serviceFabric/lib/models/containerEvent.js b/lib/services/serviceFabric/lib/models/containerEvent.js new file mode 100644 index 0000000000..ac09182ea5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerEvent.js @@ -0,0 +1,92 @@ +/* + * 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'; + +/** + * A container event. + * + */ +class ContainerEvent { + /** + * Create a ContainerEvent. + * @member {string} [name] The name of the container event. + * @member {number} [count] The count of the event. + * @member {string} [firstTimestamp] Date/time of the first event. + * @member {string} [lastTimestamp] Date/time of the last event. + * @member {string} [message] The event message + * @member {string} [type] The event type. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerEvent + * + * @returns {object} metadata of ContainerEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerEvent', + type: { + name: 'Composite', + className: 'ContainerEvent', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + count: { + required: false, + serializedName: 'count', + type: { + name: 'Number' + } + }, + firstTimestamp: { + required: false, + serializedName: 'firstTimestamp', + type: { + name: 'String' + } + }, + lastTimestamp: { + required: false, + serializedName: 'lastTimestamp', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerEvent; diff --git a/lib/services/serviceFabric/lib/models/containerInstanceEvent.js b/lib/services/serviceFabric/lib/models/containerInstanceEvent.js new file mode 100644 index 0000000000..9cf71318ce --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerInstanceEvent.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Container Events. + * + * @extends models['FabricEvent'] + */ +class ContainerInstanceEvent extends models['FabricEvent'] { + /** + * Create a ContainerInstanceEvent. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ContainerInstanceEvent + * + * @returns {object} metadata of ContainerInstanceEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerInstanceEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ContainerInstanceEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerInstanceEvent; diff --git a/lib/services/serviceFabric/lib/models/containerInstanceView.js b/lib/services/serviceFabric/lib/models/containerInstanceView.js new file mode 100644 index 0000000000..588f9a45f3 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerInstanceView.js @@ -0,0 +1,103 @@ +/* + * 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'; + +/** + * Runtime information of a container instance. + * + */ +class ContainerInstanceView { + /** + * Create a ContainerInstanceView. + * @member {number} [restartCount] The number of times the container has been + * restarted. + * @member {object} [currentState] Current container instance state. + * @member {string} [currentState.state] The state of this container + * @member {date} [currentState.startTime] Date/time when the container state + * started. + * @member {string} [currentState.exitCode] The container exit code. + * @member {date} [currentState.finishTime] Date/time when the container + * state finished. + * @member {string} [currentState.detailStatus] Human-readable status of this + * state. + * @member {object} [previousState] Previous container instance state. + * @member {string} [previousState.state] The state of this container + * @member {date} [previousState.startTime] Date/time when the container + * state started. + * @member {string} [previousState.exitCode] The container exit code. + * @member {date} [previousState.finishTime] Date/time when the container + * state finished. + * @member {string} [previousState.detailStatus] Human-readable status of + * this state. + * @member {array} [events] The events of this container instance. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerInstanceView + * + * @returns {object} metadata of ContainerInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerInstanceView', + type: { + name: 'Composite', + className: 'ContainerInstanceView', + modelProperties: { + restartCount: { + required: false, + serializedName: 'restartCount', + type: { + name: 'Number' + } + }, + currentState: { + required: false, + serializedName: 'currentState', + type: { + name: 'Composite', + className: 'ContainerState' + } + }, + previousState: { + required: false, + serializedName: 'previousState', + type: { + name: 'Composite', + className: 'ContainerState' + } + }, + events: { + required: false, + serializedName: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerEventElementType', + type: { + name: 'Composite', + className: 'ContainerEvent' + } + } + } + } + } + } + }; + } +} + +module.exports = ContainerInstanceView; diff --git a/lib/services/serviceFabric/lib/models/containerLabel.js b/lib/services/serviceFabric/lib/models/containerLabel.js new file mode 100644 index 0000000000..c58a8e0983 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerLabel.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'; + +/** + * Describes a container label. + * + */ +class ContainerLabel { + /** + * Create a ContainerLabel. + * @member {string} name The name of the container label. + * @member {string} value The value of the container label. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerLabel + * + * @returns {object} metadata of ContainerLabel + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerLabel', + type: { + name: 'Composite', + className: 'ContainerLabel', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerLabel; diff --git a/lib/services/serviceFabric/lib/models/containerLogs.js b/lib/services/serviceFabric/lib/models/containerLogs.js new file mode 100644 index 0000000000..d6285b54d5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerLogs.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Container logs. + * + */ +class ContainerLogs { + /** + * Create a ContainerLogs. + * @member {string} [content] Container logs. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerLogs + * + * @returns {object} metadata of ContainerLogs + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerLogs', + type: { + name: 'Composite', + className: 'ContainerLogs', + modelProperties: { + content: { + required: false, + serializedName: 'Content', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerLogs; diff --git a/lib/services/serviceFabric/lib/models/containerState.js b/lib/services/serviceFabric/lib/models/containerState.js new file mode 100644 index 0000000000..88c924ee34 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerState.js @@ -0,0 +1,84 @@ +/* + * 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 container state. + * + */ +class ContainerState { + /** + * Create a ContainerState. + * @member {string} [state] The state of this container + * @member {date} [startTime] Date/time when the container state started. + * @member {string} [exitCode] The container exit code. + * @member {date} [finishTime] Date/time when the container state finished. + * @member {string} [detailStatus] Human-readable status of this state. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerState + * + * @returns {object} metadata of ContainerState + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerState', + type: { + name: 'Composite', + className: 'ContainerState', + modelProperties: { + state: { + required: false, + serializedName: 'state', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + exitCode: { + required: false, + serializedName: 'exitCode', + type: { + name: 'String' + } + }, + finishTime: { + required: false, + serializedName: 'finishTime', + type: { + name: 'DateTime' + } + }, + detailStatus: { + required: false, + serializedName: 'detailStatus', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerState; diff --git a/lib/services/serviceFabric/lib/models/containerVolume.js b/lib/services/serviceFabric/lib/models/containerVolume.js new file mode 100644 index 0000000000..e1d36eba43 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/containerVolume.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes how a volume is attached to a container. + * + */ +class ContainerVolume { + /** + * Create a ContainerVolume. + * @member {string} name Name of the volume. + * @member {boolean} [readOnly] The flag indicating whether the volume is + * read only. Default is 'false'. + * @member {string} destinationPath The path within the container at which + * the volume should be mounted. Only valid path characters are allowed. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerVolume + * + * @returns {object} metadata of ContainerVolume + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerVolume', + type: { + name: 'Composite', + className: 'ContainerVolume', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + readOnly: { + required: false, + serializedName: 'readOnly', + type: { + name: 'Boolean' + } + }, + destinationPath: { + required: true, + serializedName: 'destinationPath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerVolume; diff --git a/lib/services/serviceFabric/lib/models/createComposeDeploymentDescription.js b/lib/services/serviceFabric/lib/models/createComposeDeploymentDescription.js index af0583ae49..ee0f46b31b 100644 --- a/lib/services/serviceFabric/lib/models/createComposeDeploymentDescription.js +++ b/lib/services/serviceFabric/lib/models/createComposeDeploymentDescription.js @@ -10,20 +10,18 @@ 'use strict'; -const models = require('./index'); - /** * Defines description for creating a Service Fabric compose deployment. * - * */ class CreateComposeDeploymentDescription { /** * Create a CreateComposeDeploymentDescription. - * @member {string} deploymentName + * @member {string} deploymentName The name of the deployment. * @member {string} composeFileContent The content of the compose file that * describes the deployment to create. - * @member {object} [registryCredential] + * @member {object} [registryCredential] Credential information to connect to + * container registry. * @member {string} [registryCredential.registryUserName] The user name to * connect to container registry. * @member {string} [registryCredential.registryPassword] The password for diff --git a/lib/services/serviceFabric/lib/models/currentUpgradeDomainProgressInfo.js b/lib/services/serviceFabric/lib/models/currentUpgradeDomainProgressInfo.js index 9d80ef50b8..cffc8d4b57 100644 --- a/lib/services/serviceFabric/lib/models/currentUpgradeDomainProgressInfo.js +++ b/lib/services/serviceFabric/lib/models/currentUpgradeDomainProgressInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about the current in-progress upgrade domain. * @@ -19,8 +17,9 @@ const models = require('./index'); class CurrentUpgradeDomainProgressInfo { /** * Create a CurrentUpgradeDomainProgressInfo. - * @member {string} [domainName] - * @member {array} [nodeUpgradeProgressList] + * @member {string} [domainName] The name of the upgrade domain + * @member {array} [nodeUpgradeProgressList] List of upgrading nodes and + * their statuses */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/deactivationIntentDescription.js b/lib/services/serviceFabric/lib/models/deactivationIntentDescription.js index f781eadf08..d46ab60f5e 100644 --- a/lib/services/serviceFabric/lib/models/deactivationIntentDescription.js +++ b/lib/services/serviceFabric/lib/models/deactivationIntentDescription.js @@ -18,13 +18,8 @@ class DeactivationIntentDescription { /** * Create a DeactivationIntentDescription. * @member {string} [deactivationIntent] Describes the intent or reason for - * deactivating the node. The possible values are following. - * - Pause - Indicates that the node should be paused. The value is 1. - * - Restart - Indicates that the intent is for the node to be restarted - * after a short period of time. The value is 2. - * - RemoveData - Indicates the intent is for the node to remove data. The - * value is 3. - * . Possible values include: 'Pause', 'Restart', 'RemoveData' + * deactivating the node. The possible values are following. Possible values + * include: 'Pause', 'Restart', 'RemoveData' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/deletePropertyBatchOperation.js b/lib/services/serviceFabric/lib/models/deletePropertyBatchOperation.js new file mode 100644 index 0000000000..e3f22deff3 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deletePropertyBatchOperation.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a PropertyBatchOperation that deletes a specified property if it + * exists. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. + * + * @extends models['PropertyBatchOperation'] + */ +class DeletePropertyBatchOperation extends models['PropertyBatchOperation'] { + /** + * Create a DeletePropertyBatchOperation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletePropertyBatchOperation + * + * @returns {object} metadata of DeletePropertyBatchOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'Delete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'DeletePropertyBatchOperation', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletePropertyBatchOperation; diff --git a/lib/services/serviceFabric/lib/models/deltaNodesCheckHealthEvaluation.js b/lib/services/serviceFabric/lib/models/deltaNodesCheckHealthEvaluation.js index faf0623275..7709e7988a 100644 --- a/lib/services/serviceFabric/lib/models/deltaNodesCheckHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/deltaNodesCheckHealthEvaluation.js @@ -18,7 +18,6 @@ const models = require('./index'); * Can be returned during cluster upgrade when the aggregated health state of * the cluster is Warning or Error. * - * * @extends models['HealthEvaluation'] */ class DeltaNodesCheckHealthEvaluation extends models['HealthEvaluation'] { @@ -32,7 +31,10 @@ class DeltaNodesCheckHealthEvaluation extends models['HealthEvaluation'] { * @member {number} [maxPercentDeltaUnhealthyNodes] Maximum allowed * percentage of delta unhealthy nodes from the ClusterUpgradeHealthPolicy. * @member {number} [totalCount] Total number of nodes in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. + * Includes all the unhealthy NodeHealthEvaluation that impacted the + * aggregated health. */ constructor() { super(); @@ -50,6 +52,11 @@ class DeltaNodesCheckHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'DeltaNodesCheck', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'DeltaNodesCheckHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -69,6 +76,7 @@ class DeltaNodesCheckHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployServicePackageToNodeDescription.js b/lib/services/serviceFabric/lib/models/deployServicePackageToNodeDescription.js index 4d4c48059e..6c58a4cfb0 100644 --- a/lib/services/serviceFabric/lib/models/deployServicePackageToNodeDescription.js +++ b/lib/services/serviceFabric/lib/models/deployServicePackageToNodeDescription.js @@ -10,22 +10,23 @@ 'use strict'; -const models = require('./index'); - /** * Defines description for downloading packages associated with a service * manifest to image cache on a Service Fabric node. * - * */ class DeployServicePackageToNodeDescription { /** * Create a DeployServicePackageToNodeDescription. - * @member {string} serviceManifestName - * @member {string} applicationTypeName - * @member {string} applicationTypeVersion - * @member {string} nodeName - * @member {array} [packageSharingPolicy] + * @member {string} serviceManifestName The name of service manifest whose + * packages need to be downloaded. + * @member {string} applicationTypeName The application type name as defined + * in the application manifest. + * @member {string} applicationTypeVersion The version of the application + * type as defined in the application manifest. + * @member {string} nodeName The name of a Service Fabric node. + * @member {array} [packageSharingPolicy] List of package sharing policy + * information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealth.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealth.js index 06f02c57b4..1c46502156 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationHealth.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealth.js @@ -21,9 +21,13 @@ const models = require('./index'); class DeployedApplicationHealth extends models['EntityHealth'] { /** * Create a DeployedApplicationHealth. - * @member {string} [name] - * @member {string} [nodeName] - * @member {array} [deployedServicePackageHealthStates] + * @member {string} [name] Name of the application deployed on the node whose + * health information is described by this object. + * @member {string} [nodeName] Name of the node where this application is + * deployed. + * @member {array} [deployedServicePackageHealthStates] Deployed service + * package health states for the current deployed application as found in the + * health store. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthEvaluation.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthEvaluation.js index e108140f4a..6005877235 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthEvaluation.js @@ -17,15 +17,19 @@ const models = require('./index'); * information about the data and the algorithm used by the health store to * evaluate health. * - * * @extends models['HealthEvaluation'] */ class DeployedApplicationHealthEvaluation extends models['HealthEvaluation'] { /** * Create a DeployedApplicationHealthEvaluation. - * @member {string} [nodeName] - * @member {string} [applicationName] - * @member {array} [unhealthyEvaluations] + * @member {string} [nodeName] Name of the node where the application is + * deployed to. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the deployed application. + * The types of the unhealthy evaluations can be + * DeployedServicePackagesHealthEvaluation or EventHealthEvaluation. */ constructor() { super(); @@ -43,6 +47,11 @@ class DeployedApplicationHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'DeployedApplication', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'DeployedApplicationHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -62,6 +71,7 @@ class DeployedApplicationHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportCreatedEvent.js new file mode 100644 index 0000000000..9f4fcc0936 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportCreatedEvent.js @@ -0,0 +1,169 @@ +/* + * 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'); + +/** + * Deployed Application Health Report Created event. + * + * @extends models['ApplicationEvent'] + */ +class DeployedApplicationHealthReportCreatedEvent extends models['ApplicationEvent'] { + /** + * Create a DeployedApplicationHealthReportCreatedEvent. + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeployedApplicationHealthReportCreatedEvent + * + * @returns {object} metadata of DeployedApplicationHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'DeployedApplicationHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'DeployedApplicationHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationInstanceId: { + required: true, + serializedName: 'ApplicationInstanceId', + type: { + name: 'Number' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = DeployedApplicationHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportExpiredEvent.js new file mode 100644 index 0000000000..86e7698dd6 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportExpiredEvent.js @@ -0,0 +1,169 @@ +/* + * 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'); + +/** + * Deployed Application Health Report Expired event. + * + * @extends models['ApplicationEvent'] + */ +class DeployedApplicationHealthReportExpiredEvent extends models['ApplicationEvent'] { + /** + * Create a DeployedApplicationHealthReportExpiredEvent. + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeployedApplicationHealthReportExpiredEvent + * + * @returns {object} metadata of DeployedApplicationHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'DeployedApplicationHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'DeployedApplicationHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + applicationInstanceId: { + required: true, + serializedName: 'ApplicationInstanceId', + type: { + name: 'Number' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = DeployedApplicationHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthState.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthState.js index 65091ef9b1..1fc9eea20e 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationHealthState.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthState.js @@ -21,8 +21,10 @@ const models = require('./index'); class DeployedApplicationHealthState extends models['EntityHealthState'] { /** * Create a DeployedApplicationHealthState. - * @member {string} [nodeName] - * @member {string} [applicationName] + * @member {string} [nodeName] Name of the node on which the service package + * is deployed. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunk.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunk.js index e2914387c9..1404ee6475 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunk.js @@ -18,7 +18,6 @@ const models = require('./index'); * any deployed service packages that respect the chunk query description * filters. * - * * @extends models['EntityHealthStateChunk'] */ class DeployedApplicationHealthStateChunk extends models['EntityHealthStateChunk'] { @@ -26,7 +25,10 @@ class DeployedApplicationHealthStateChunk extends models['EntityHealthStateChunk * Create a DeployedApplicationHealthStateChunk. * @member {string} [nodeName] The name of node where the application is * deployed. - * @member {object} [deployedServicePackageHealthStateChunks] + * @member {object} [deployedServicePackageHealthStateChunks] The list of + * deployed service package health state chunks belonging to the deployed + * application that respect the filters in the cluster health chunk query + * description. * @member {array} [deployedServicePackageHealthStateChunks.items] The list * of deployed service package health state chunks that respect the input * filters in the chunk query. diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunkList.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunkList.js index 7a42f1eb1d..048e451c8e 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunkList.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateChunkList.js @@ -10,14 +10,11 @@ 'use strict'; -const models = require('./index'); - /** * The list of deployed application health state chunks that respect the input * filters in the chunk query. Returned by get cluster health state chunks * query. * - * */ class DeployedApplicationHealthStateChunkList { /** diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateFilter.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateFilter.js index 3fea4babe0..4b547f2433 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateFilter.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthStateFilter.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Defines matching criteria to determine whether a deployed application should * be included as a child of an application in the cluster health chunk. @@ -20,7 +18,6 @@ const models = require('./index'); * One filter can match zero, one or multiple deployed applications, depending * on its properties. * - * */ class DeployedApplicationHealthStateFilter { /** @@ -47,7 +44,7 @@ class DeployedApplicationHealthStateFilter { * If not specified, default value is None, unless the node name is * specified. If the filter has default value and node name is specified, the * matching deployed application is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches deployed applications * with HealthState value of OK (2) and Warning (4). @@ -62,8 +59,7 @@ class DeployedApplicationHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The * value is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [deployedServicePackageFilters] Defines a list of filters * that specify which deployed service packages to be included in the * returned cluster health chunk as children of the parent deployed diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationInfo.js b/lib/services/serviceFabric/lib/models/deployedApplicationInfo.js index 6e218d800b..9d89d8d637 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationInfo.js @@ -17,11 +17,21 @@ class DeployedApplicationInfo { /** * Create a DeployedApplicationInfo. - * @member {string} [id] - * @member {string} [name] - * @member {string} [typeName] - * @member {string} [status] Possible values include: 'Invalid', - * 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating' + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" + * in previous versions. + * @member {string} [name] The name of the application, including the + * 'fabric:' URI scheme. + * @member {string} [typeName] The application type name as defined in the + * application manifest. + * @member {string} [status] The status of the application deployed on the + * node. Following are the possible values. Possible values include: + * 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', + * 'Deactivating' * @member {string} [workDirectory] The work directory of the application on * the node. The work directory can be used to store application data. * @member {string} [logDirectory] The log directory of the application on @@ -29,6 +39,9 @@ class DeployedApplicationInfo { * @member {string} [tempDirectory] The temp directory of the application on * the node. The code packages belonging to the application are forked with * this directory set as their temporary directory. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' */ constructor() { } @@ -95,6 +108,13 @@ class DeployedApplicationInfo { type: { name: 'String' } + }, + healthState: { + required: false, + serializedName: 'HealthState', + type: { + name: 'String' + } } } } diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationsHealthEvaluation.js b/lib/services/serviceFabric/lib/models/deployedApplicationsHealthEvaluation.js index 055c9ae35d..69128a318a 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationsHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationsHealthEvaluation.js @@ -19,7 +19,6 @@ const models = require('./index'); * Can be returned when evaluating application health and the aggregated health * state is either Error or Warning. * - * * @extends models['HealthEvaluation'] */ class DeployedApplicationsHealthEvaluation extends models['HealthEvaluation'] { @@ -30,7 +29,9 @@ class DeployedApplicationsHealthEvaluation extends models['HealthEvaluation'] { * ApplicationHealthPolicy. * @member {number} [totalCount] Total number of deployed applications of the * application in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * DeployedApplicationHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -48,6 +49,11 @@ class DeployedApplicationsHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'DeployedApplications', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'DeployedApplicationsHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -67,6 +73,7 @@ class DeployedApplicationsHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployedCodePackageInfo.js b/lib/services/serviceFabric/lib/models/deployedCodePackageInfo.js index 9e1a356352..322fab5bf0 100644 --- a/lib/services/serviceFabric/lib/models/deployedCodePackageInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedCodePackageInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about code package deployed on a Service Fabric node. * @@ -19,27 +17,42 @@ const models = require('./index'); class DeployedCodePackageInfo { /** * Create a DeployedCodePackageInfo. - * @member {string} [name] + * @member {string} [name] The name of the code package. * @member {string} [version] The version of the code package specified in * service manifest. - * @member {string} [serviceManifestName] - * @member {string} [servicePackageActivationId] - * @member {string} [hostType] Possible values include: 'Invalid', 'ExeHost', - * 'ContainerHost' - * @member {string} [hostIsolationMode] Possible values include: 'None', + * @member {string} [serviceManifestName] The name of service manifest that + * specified this code package. + * @member {string} [servicePackageActivationId] The ActivationId of a + * deployed service package. If ServicePackageActivationMode specified at the + * time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults + * to 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * @member {string} [hostType] Specifies the type of host for main entry + * point of a code package as specified in service manifest. Possible values + * include: 'Invalid', 'ExeHost', 'ContainerHost' + * @member {string} [hostIsolationMode] Specifies the isolation mode of main + * entry point of a code package when it's host type is ContainerHost. This + * is specified as part of container host policies in application manifest + * while importing service manifest. Possible values include: 'None', * 'Process', 'HyperV' - * @member {string} [status] Possible values include: 'Invalid', - * 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating' + * @member {string} [status] Specifies the status of a deployed application + * or service package on a Service Fabric node. Possible values include: + * 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', + * 'Deactivating' * @member {string} [runFrequencyInterval] The interval at which code package * is run. This is used for periodic code package. - * @member {object} [setupEntryPoint] + * @member {object} [setupEntryPoint] Information about setup or main entry + * point of a code package deployed on a Service Fabric node. * @member {string} [setupEntryPoint.entryPointLocation] The location of * entry point executable on the node. - * @member {string} [setupEntryPoint.processId] The process id of the entry + * @member {string} [setupEntryPoint.processId] The process ID of the entry * point. * @member {string} [setupEntryPoint.runAsUserName] The user name under which * entry point executable is run on the node. * @member {object} [setupEntryPoint.codePackageEntryPointStatistics] + * Statistics about setup or main entry point of a code package deployed on + * a Service Fabric node. * @member {string} * [setupEntryPoint.codePackageEntryPointStatistics.lastExitCode] The last * exit code of the entry point. @@ -73,19 +86,27 @@ class DeployedCodePackageInfo { * @member {string} * [setupEntryPoint.codePackageEntryPointStatistics.continuousExitFailureCount] * Number of times the entry point continuously failed to exit gracefully. - * @member {string} [setupEntryPoint.status] Possible values include: - * 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' + * @member {string} [setupEntryPoint.status] Specifies the status of the code + * package entry point deployed on a Service Fabric node. Possible values + * include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', + * 'Stopped' * @member {date} [setupEntryPoint.nextActivationTime] The time (in UTC) when * the entry point executable will be run next. - * @member {string} [setupEntryPoint.instanceId] - * @member {object} [mainEntryPoint] + * @member {string} [setupEntryPoint.instanceId] The instance ID for current + * running entry point. For a code package setup entry point (if specified) + * runs first and after it finishes main entry point is started. Each time + * entry point executable is run, its instance id will change. + * @member {object} [mainEntryPoint] Information about setup or main entry + * point of a code package deployed on a Service Fabric node. * @member {string} [mainEntryPoint.entryPointLocation] The location of entry * point executable on the node. - * @member {string} [mainEntryPoint.processId] The process id of the entry + * @member {string} [mainEntryPoint.processId] The process ID of the entry * point. * @member {string} [mainEntryPoint.runAsUserName] The user name under which * entry point executable is run on the node. * @member {object} [mainEntryPoint.codePackageEntryPointStatistics] + * Statistics about setup or main entry point of a code package deployed on + * a Service Fabric node. * @member {string} * [mainEntryPoint.codePackageEntryPointStatistics.lastExitCode] The last * exit code of the entry point. @@ -119,11 +140,16 @@ class DeployedCodePackageInfo { * @member {string} * [mainEntryPoint.codePackageEntryPointStatistics.continuousExitFailureCount] * Number of times the entry point continuously failed to exit gracefully. - * @member {string} [mainEntryPoint.status] Possible values include: - * 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' + * @member {string} [mainEntryPoint.status] Specifies the status of the code + * package entry point deployed on a Service Fabric node. Possible values + * include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', + * 'Stopped' * @member {date} [mainEntryPoint.nextActivationTime] The time (in UTC) when * the entry point executable will be run next. - * @member {string} [mainEntryPoint.instanceId] + * @member {string} [mainEntryPoint.instanceId] The instance ID for current + * running entry point. For a code package setup entry point (if specified) + * runs first and after it finishes main entry point is started. Each time + * entry point executable is run, its instance id will change. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/deployedServiceHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/deployedServiceHealthReportCreatedEvent.js new file mode 100644 index 0000000000..705e8b2012 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deployedServiceHealthReportCreatedEvent.js @@ -0,0 +1,186 @@ +/* + * 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'); + +/** + * Deployed Service Health Report Created event. + * + * @extends models['ApplicationEvent'] + */ +class DeployedServiceHealthReportCreatedEvent extends models['ApplicationEvent'] { + /** + * Create a DeployedServiceHealthReportCreatedEvent. + * @member {string} serviceManifestName Service manifest name. + * @member {number} servicePackageInstanceId Id of Service package instance. + * @member {string} servicePackageActivationId Id of Service package + * activation. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} tTLTimespan Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeployedServiceHealthReportCreatedEvent + * + * @returns {object} metadata of DeployedServiceHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'DeployedServiceHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'DeployedServiceHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + serviceManifestName: { + required: true, + serializedName: 'ServiceManifestName', + type: { + name: 'String' + } + }, + servicePackageInstanceId: { + required: true, + serializedName: 'ServicePackageInstanceId', + type: { + name: 'Number' + } + }, + servicePackageActivationId: { + required: true, + serializedName: 'ServicePackageActivationId', + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + tTLTimespan: { + required: true, + serializedName: 'TTLTimespan', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = DeployedServiceHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/deployedServiceHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/deployedServiceHealthReportExpiredEvent.js new file mode 100644 index 0000000000..9e460c44bf --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deployedServiceHealthReportExpiredEvent.js @@ -0,0 +1,186 @@ +/* + * 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'); + +/** + * Deployed Service Health Report Expired event. + * + * @extends models['ApplicationEvent'] + */ +class DeployedServiceHealthReportExpiredEvent extends models['ApplicationEvent'] { + /** + * Create a DeployedServiceHealthReportExpiredEvent. + * @member {string} serviceManifest Service manifest name. + * @member {number} servicePackageInstanceId Id of Service package instance. + * @member {string} servicePackageActivationId Id of Service package + * activation. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} tTLTimespan Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeployedServiceHealthReportExpiredEvent + * + * @returns {object} metadata of DeployedServiceHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'DeployedServiceHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'DeployedServiceHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + serviceManifest: { + required: true, + serializedName: 'ServiceManifest', + type: { + name: 'String' + } + }, + servicePackageInstanceId: { + required: true, + serializedName: 'ServicePackageInstanceId', + type: { + name: 'Number' + } + }, + servicePackageActivationId: { + required: true, + serializedName: 'ServicePackageActivationId', + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + tTLTimespan: { + required: true, + serializedName: 'TTLTimespan', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = DeployedServiceHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageHealth.js b/lib/services/serviceFabric/lib/models/deployedServicePackageHealth.js index 5bb93a9cae..2f915e3dab 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackageHealth.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageHealth.js @@ -21,9 +21,11 @@ const models = require('./index'); class DeployedServicePackageHealth extends models['EntityHealth'] { /** * Create a DeployedServicePackageHealth. - * @member {string} [applicationName] - * @member {string} [serviceManifestName] - * @member {string} [nodeName] + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [serviceManifestName] Name of the service manifest. + * @member {string} [nodeName] Name of the node where this service package is + * deployed. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthEvaluation.js b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthEvaluation.js index c04e76bca8..c33f139776 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthEvaluation.js @@ -23,10 +23,13 @@ const models = require('./index'); class DeployedServicePackageHealthEvaluation extends models['HealthEvaluation'] { /** * Create a DeployedServicePackageHealthEvaluation. - * @member {string} [nodeName] - * @member {string} [applicationName] - * @member {string} [serviceManifestName] - * @member {array} [unhealthyEvaluations] + * @member {string} [nodeName] The name of a Service Fabric node. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [serviceManifestName] The name of the service manifest. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state. The type of the unhealthy + * evaluations can be EventHealthEvaluation. */ constructor() { super(); @@ -44,6 +47,11 @@ class DeployedServicePackageHealthEvaluation extends models['HealthEvaluation'] serializedName: 'DeployedServicePackage', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'DeployedServicePackageHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -63,6 +71,7 @@ class DeployedServicePackageHealthEvaluation extends models['HealthEvaluation'] kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthState.js b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthState.js index ef6b84d2ec..382364d420 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthState.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthState.js @@ -21,10 +21,18 @@ const models = require('./index'); class DeployedServicePackageHealthState extends models['EntityHealthState'] { /** * Create a DeployedServicePackageHealthState. - * @member {string} [nodeName] - * @member {string} [applicationName] - * @member {string} [serviceManifestName] - * @member {string} [servicePackageActivationId] + * @member {string} [nodeName] Name of the node on which the service package + * is deployed. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [serviceManifestName] Name of the manifest describing the + * service package. + * @member {string} [servicePackageActivationId] The ActivationId of a + * deployed service package. If ServicePackageActivationMode specified at the + * time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults + * to 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunk.js b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunk.js index 3bdb82ade5..f0ba3783aa 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunk.js @@ -17,14 +17,18 @@ const models = require('./index'); * contains the service manifest name and the service package aggregated health * state. * - * * @extends models['EntityHealthStateChunk'] */ class DeployedServicePackageHealthStateChunk extends models['EntityHealthStateChunk'] { /** * Create a DeployedServicePackageHealthStateChunk. - * @member {string} [serviceManifestName] - * @member {string} [servicePackageActivationId] + * @member {string} [serviceManifestName] The name of the service manifest. + * @member {string} [servicePackageActivationId] The ActivationId of a + * deployed service package. If ServicePackageActivationMode specified at the + * time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults + * to 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunkList.js b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunkList.js index 61fdad93d5..863f9fc165 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunkList.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateChunkList.js @@ -10,14 +10,11 @@ 'use strict'; -const models = require('./index'); - /** * The list of deployed service package health state chunks that respect the * input filters in the chunk query. Returned by get cluster health state * chunks query. * - * */ class DeployedServicePackageHealthStateChunkList { /** diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateFilter.js b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateFilter.js index 6366e94b96..37270373fe 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateFilter.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthStateFilter.js @@ -21,7 +21,6 @@ * One filter can match zero, one or multiple deployed service packages, * depending on its properties. * - * */ class DeployedServicePackageHealthStateFilter { /** @@ -52,10 +51,10 @@ class DeployedServicePackageHealthStateFilter { * All deployed service packages are used to evaluate the parent deployed * application aggregated health state. * If not specified, default value is None, unless the deployed service - * package id is specified. If the filter has default value and deployed - * service package id is specified, the matching deployed service package is + * package ID is specified. If the filter has default value and deployed + * service package ID is specified, the matching deployed service package is * returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches deployed service * packages with HealthState value of OK (2) and Warning (4). @@ -70,8 +69,7 @@ class DeployedServicePackageHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The * value is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageInfo.js b/lib/services/serviceFabric/lib/models/deployedServicePackageInfo.js index 515726ced4..7f1839e6fb 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackageInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageInfo.js @@ -17,12 +17,20 @@ class DeployedServicePackageInfo { /** * Create a DeployedServicePackageInfo. - * @member {string} [name] + * @member {string} [name] The name of the service package as specified in + * the service manifest. * @member {string} [version] The version of the service package specified in * service manifest. - * @member {string} [status] Possible values include: 'Invalid', - * 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating' - * @member {string} [servicePackageActivationId] + * @member {string} [status] Specifies the status of a deployed application + * or service package on a Service Fabric node. Possible values include: + * 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', + * 'Deactivating' + * @member {string} [servicePackageActivationId] The ActivationId of a + * deployed service package. If ServicePackageActivationMode specified at the + * time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults + * to 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackagesHealthEvaluation.js b/lib/services/serviceFabric/lib/models/deployedServicePackagesHealthEvaluation.js index beb9109bda..cbf4a5eb9c 100644 --- a/lib/services/serviceFabric/lib/models/deployedServicePackagesHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/deployedServicePackagesHealthEvaluation.js @@ -26,7 +26,10 @@ class DeployedServicePackagesHealthEvaluation extends models['HealthEvaluation'] * Create a DeployedServicePackagesHealthEvaluation. * @member {number} [totalCount] Total number of deployed service packages of * the deployed application in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * DeployedServicePackageHealthEvaluation that impacted the aggregated + * health. */ constructor() { super(); @@ -44,6 +47,11 @@ class DeployedServicePackagesHealthEvaluation extends models['HealthEvaluation'] serializedName: 'DeployedServicePackages', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'DeployedServicePackagesHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -63,6 +71,7 @@ class DeployedServicePackagesHealthEvaluation extends models['HealthEvaluation'] kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployedServiceReplicaDetailInfo.js b/lib/services/serviceFabric/lib/models/deployedServiceReplicaDetailInfo.js index 2da18d334c..c7a580be49 100644 --- a/lib/services/serviceFabric/lib/models/deployedServiceReplicaDetailInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedServiceReplicaDetailInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a Service Fabric service replica deployed on a node. * @@ -19,13 +17,20 @@ const models = require('./index'); class DeployedServiceReplicaDetailInfo { /** * Create a DeployedServiceReplicaDetailInfo. - * @member {string} [serviceName] - * @member {uuid} [partitionId] - * @member {string} [currentServiceOperation] Possible values include: - * 'Unknown', 'None', 'Open', 'ChangeRole', 'Close', 'Abort' + * @member {string} [serviceName] Full hierarchical name of the service in + * URI format starting with `fabric:`. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. + * @member {string} [currentServiceOperation] Specifies the current active + * life-cycle operation on a stateful service replica or stateless service + * instance. Possible values include: 'Unknown', 'None', 'Open', + * 'ChangeRole', 'Close', 'Abort' * @member {date} [currentServiceOperationStartTimeUtc] The start time of the * current service operation in UTC format. - * @member {array} [reportedLoad] + * @member {array} [reportedLoad] List of load reported by replica. * @member {string} serviceKind Polymorphic Discriminator */ constructor() { @@ -96,6 +101,7 @@ class DeployedServiceReplicaDetailInfo { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployedServiceReplicaInfo.js b/lib/services/serviceFabric/lib/models/deployedServiceReplicaInfo.js index 6377425b09..1d67da0be9 100644 --- a/lib/services/serviceFabric/lib/models/deployedServiceReplicaInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedServiceReplicaInfo.js @@ -17,19 +17,33 @@ class DeployedServiceReplicaInfo { /** * Create a DeployedServiceReplicaInfo. - * @member {string} [serviceName] - * @member {string} [serviceTypeName] - * @member {string} [serviceManifestName] - * @member {string} [codePackageName] - * @member {uuid} [partitionId] - * @member {string} [replicaStatus] Possible values include: 'Invalid', - * 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped' + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {string} [serviceTypeName] Name of the service type as specified + * in the service manifest. + * @member {string} [serviceManifestName] The name of the service manifest in + * which this service type is defined. + * @member {string} [codePackageName] The name of the code package that hosts + * this replica. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. + * @member {string} [replicaStatus] The status of a replica of a service. + * Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', + * 'Dropped' * @member {string} [address] The last address returned by the replica in * Open or ChangeRole. - * @member {string} [servicePackageActivationId] - * @member {string} [hostProcessId] Host process id of the process that is + * @member {string} [servicePackageActivationId] The ActivationId of a + * deployed service package. If ServicePackageActivationMode specified at the + * time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults + * to 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * @member {string} [hostProcessId] Host process ID of the process that is * hosting the replica. This will be zero if the replica is down. In hyper-v - * containers this host process id will be from different kernel. + * containers this host process ID will be from different kernel. * @member {string} serviceKind Polymorphic Discriminator */ constructor() { @@ -120,6 +134,7 @@ class DeployedServiceReplicaInfo { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployedServiceTypeInfo.js b/lib/services/serviceFabric/lib/models/deployedServiceTypeInfo.js index 8429729957..df6f841cb9 100644 --- a/lib/services/serviceFabric/lib/models/deployedServiceTypeInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedServiceTypeInfo.js @@ -18,12 +18,21 @@ class DeployedServiceTypeInfo { /** * Create a DeployedServiceTypeInfo. - * @member {string} [serviceTypeName] - * @member {string} [serviceManifestName] - * @member {string} [codePackageName] - * @member {string} [status] Possible values include: 'Invalid', 'Disabled', - * 'Enabled', 'Registered' - * @member {string} [servicePackageActivationId] + * @member {string} [serviceTypeName] Name of the service type as specified + * in the service manifest. + * @member {string} [serviceManifestName] The name of the service manifest in + * which this service type is defined. + * @member {string} [codePackageName] The name of the code package that + * registered the service type. + * @member {string} [status] The status of the service type registration on + * the node. Possible values include: 'Invalid', 'Disabled', 'Enabled', + * 'Registered' + * @member {string} [servicePackageActivationId] The ActivationId of a + * deployed service package. If ServicePackageActivationMode specified at the + * time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults + * to 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaDetailInfo.js b/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaDetailInfo.js index ecb3ea19ca..3364e5f124 100644 --- a/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaDetailInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaDetailInfo.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * Information about a stateful replica running in a code package. Please note + * Information about a stateful replica running in a code package. Note * DeployedServiceReplicaQueryResult will contain duplicate data like * ServiceKind, ServiceName, PartitionId and replicaId. * @@ -22,17 +22,31 @@ const models = require('./index'); class DeployedStatefulServiceReplicaDetailInfo extends models['DeployedServiceReplicaDetailInfo'] { /** * Create a DeployedStatefulServiceReplicaDetailInfo. - * @member {string} [replicaId] - * @member {string} [currentReplicatorOperation] Possible values include: + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId + * is used by Service Fabric to uniquely identify a replica of a partition. + * It is unique within a partition and does not change for the lifetime of + * the replica. If a replica gets dropped and another replica gets created on + * the same node for the same partition, it will get a different value for + * the id. Sometimes the id of a stateless service instance is also referred + * as a replica id. + * @member {string} [currentReplicatorOperation] Specifies the operation + * currently being executed by the Replicator. Possible values include: * 'Invalid', 'None', 'Open', 'ChangeRole', 'UpdateEpoch', 'Close', 'Abort', * 'OnDataLoss', 'WaitForCatchup', 'Build' - * @member {string} [readStatus] Possible values include: 'Invalid', - * 'Granted', 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum' - * @member {string} [writeStatus] Possible values include: 'Invalid', - * 'Granted', 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum' - * @member {object} [replicatorStatus] + * @member {string} [readStatus] Specifies the access status of the + * partition. Possible values include: 'Invalid', 'Granted', + * 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum' + * @member {string} [writeStatus] Specifies the access status of the + * partition. Possible values include: 'Invalid', 'Granted', + * 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum' + * @member {object} [replicatorStatus] Represents a base class for primary or + * secondary replicator status. + * Contains information about the service fabric replicator like the + * replication/copy queue utilization, last acknowledgement received + * timestamp, etc. * @member {string} [replicatorStatus.kind] Polymorphic Discriminator - * @member {object} [replicaStatus] + * @member {object} [replicaStatus] Key value store related information for + * the replica. * @member {string} [replicaStatus.databaseRowCountEstimate] Value indicating * the estimated number of rows in the underlying database. * @member {string} [replicaStatus.databaseLogicalSizeEstimate] Value @@ -45,24 +59,36 @@ class DeployedStatefulServiceReplicaDetailInfo extends models['DeployedServiceRe * there is no pending callback. * @member {string} [replicaStatus.statusDetails] Value indicating the * current status details of the replica. - * @member {object} [deployedServiceReplicaQueryResult] - * @member {string} [deployedServiceReplicaQueryResult.replicaId] - * @member {string} [deployedServiceReplicaQueryResult.replicaRole] Possible - * values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', - * 'ActiveSecondary' + * @member {object} [deployedServiceReplicaQueryResult] Information about a + * stateful service replica deployed on a node. + * @member {string} [deployedServiceReplicaQueryResult.replicaId] Id of a + * stateful service replica. ReplicaId is used by Service Fabric to uniquely + * identify a replica of a partition. It is unique within a partition and + * does not change for the lifetime of the replica. If a replica gets dropped + * and another replica gets created on the same node for the same partition, + * it will get a different value for the id. Sometimes the id of a stateless + * service instance is also referred as a replica id. + * @member {string} [deployedServiceReplicaQueryResult.replicaRole] The role + * of a replica of a stateful service. Possible values include: 'Unknown', + * 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' * @member {object} - * [deployedServiceReplicaQueryResult.reconfigurationInformation] + * [deployedServiceReplicaQueryResult.reconfigurationInformation] Information + * about current reconfiguration like phase, type, previous configuration + * role of replica and reconfiguration start date time. * @member {string} * [deployedServiceReplicaQueryResult.reconfigurationInformation.previousConfigurationRole] - * Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', - * 'ActiveSecondary' + * Replica role before reconfiguration started. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' * @member {string} * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationPhase] - * Possible values include: 'Unknown', 'None', 'Phase0', 'Phase1', 'Phase2', - * 'Phase3', 'Phase4', 'AbortPhaseZero' + * Current phase of ongoing reconfiguration. If no reconfiguration is taking + * place then this value will be "None". Possible values include: 'Unknown', + * 'None', 'Phase0', 'Phase1', 'Phase2', 'Phase3', 'Phase4', 'AbortPhaseZero' * @member {string} * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationType] - * Possible values include: 'Unknown', 'SwapPrimary', 'Failover', 'Other' + * Type of current ongoing reconfiguration. If no reconfiguration is taking + * place then this value will be "None". Possible values include: 'Unknown', + * 'SwapPrimary', 'Failover', 'Other' * @member {date} * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationStartTimeUtc] * Start time (in UTC) of the ongoing reconfiguration. If no reconfiguration @@ -84,6 +110,11 @@ class DeployedStatefulServiceReplicaDetailInfo extends models['DeployedServiceRe serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'DeployedServiceReplicaDetailInfo', className: 'DeployedStatefulServiceReplicaDetailInfo', modelProperties: { serviceName: { @@ -132,6 +163,7 @@ class DeployedStatefulServiceReplicaDetailInfo extends models['DeployedServiceRe serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } @@ -182,6 +214,11 @@ class DeployedStatefulServiceReplicaDetailInfo extends models['DeployedServiceRe serializedName: 'ReplicaStatus', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ReplicaStatusBase', className: 'KeyValueStoreReplicaStatus' } }, @@ -190,6 +227,11 @@ class DeployedStatefulServiceReplicaDetailInfo extends models['DeployedServiceRe serializedName: 'DeployedServiceReplicaQueryResult', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'DeployedServiceReplicaInfo', className: 'DeployedStatefulServiceReplicaInfo' } } diff --git a/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaInfo.js b/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaInfo.js index 226d8509b1..53e90cbab7 100644 --- a/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedStatefulServiceReplicaInfo.js @@ -20,18 +20,30 @@ const models = require('./index'); class DeployedStatefulServiceReplicaInfo extends models['DeployedServiceReplicaInfo'] { /** * Create a DeployedStatefulServiceReplicaInfo. - * @member {string} [replicaId] - * @member {string} [replicaRole] Possible values include: 'Unknown', 'None', - * 'Primary', 'IdleSecondary', 'ActiveSecondary' - * @member {object} [reconfigurationInformation] + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId + * is used by Service Fabric to uniquely identify a replica of a partition. + * It is unique within a partition and does not change for the lifetime of + * the replica. If a replica gets dropped and another replica gets created on + * the same node for the same partition, it will get a different value for + * the id. Sometimes the id of a stateless service instance is also referred + * as a replica id. + * @member {string} [replicaRole] The role of a replica of a stateful + * service. Possible values include: 'Unknown', 'None', 'Primary', + * 'IdleSecondary', 'ActiveSecondary' + * @member {object} [reconfigurationInformation] Information about current + * reconfiguration like phase, type, previous configuration role of replica + * and reconfiguration start date time. * @member {string} [reconfigurationInformation.previousConfigurationRole] - * Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', - * 'ActiveSecondary' - * @member {string} [reconfigurationInformation.reconfigurationPhase] - * Possible values include: 'Unknown', 'None', 'Phase0', 'Phase1', 'Phase2', - * 'Phase3', 'Phase4', 'AbortPhaseZero' - * @member {string} [reconfigurationInformation.reconfigurationType] Possible - * values include: 'Unknown', 'SwapPrimary', 'Failover', 'Other' + * Replica role before reconfiguration started. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' + * @member {string} [reconfigurationInformation.reconfigurationPhase] Current + * phase of ongoing reconfiguration. If no reconfiguration is taking place + * then this value will be "None". Possible values include: 'Unknown', + * 'None', 'Phase0', 'Phase1', 'Phase2', 'Phase3', 'Phase4', 'AbortPhaseZero' + * @member {string} [reconfigurationInformation.reconfigurationType] Type of + * current ongoing reconfiguration. If no reconfiguration is taking place + * then this value will be "None". Possible values include: 'Unknown', + * 'SwapPrimary', 'Failover', 'Other' * @member {date} [reconfigurationInformation.reconfigurationStartTimeUtc] * Start time (in UTC) of the ongoing reconfiguration. If no reconfiguration * is taking place then this value will be zero date-time. @@ -52,6 +64,11 @@ class DeployedStatefulServiceReplicaInfo extends models['DeployedServiceReplicaI serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'DeployedServiceReplicaInfo', className: 'DeployedStatefulServiceReplicaInfo', modelProperties: { serviceName: { @@ -120,6 +137,7 @@ class DeployedStatefulServiceReplicaInfo extends models['DeployedServiceReplicaI serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceDetailInfo.js b/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceDetailInfo.js index ad2bfc0520..9cb69352bd 100644 --- a/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceDetailInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceDetailInfo.js @@ -13,8 +13,8 @@ const models = require('./index'); /** - * Information about a stateless instance running in a code package. Please - * note that DeployedServiceReplicaQueryResult will contain duplicate data like + * Information about a stateless instance running in a code package. Note that + * DeployedServiceReplicaQueryResult will contain duplicate data like * ServiceKind, ServiceName, PartitionId and InstanceId. * * @extends models['DeployedServiceReplicaDetailInfo'] @@ -22,9 +22,20 @@ const models = require('./index'); class DeployedStatelessServiceInstanceDetailInfo extends models['DeployedServiceReplicaDetailInfo'] { /** * Create a DeployedStatelessServiceInstanceDetailInfo. - * @member {string} [instanceId] - * @member {object} [deployedServiceReplicaQueryResult] - * @member {string} [deployedServiceReplicaQueryResult.instanceId] + * @member {string} [instanceId] Id of a stateless service instance. + * InstanceId is used by Service Fabric to uniquely identify an instance of a + * partition of a stateless service. It is unique within a partition and does + * not change for the lifetime of the instance. If the instance has failed + * over on the same or different node, it will get a different value for the + * InstanceId. + * @member {object} [deployedServiceReplicaQueryResult] Information about a + * stateless service instance deployed on a node. + * @member {string} [deployedServiceReplicaQueryResult.instanceId] Id of a + * stateless service instance. InstanceId is used by Service Fabric to + * uniquely identify an instance of a partition of a stateless service. It is + * unique within a partition and does not change for the lifetime of the + * instance. If the instance has failed over on the same or different node, + * it will get a different value for the InstanceId. */ constructor() { super(); @@ -42,6 +53,11 @@ class DeployedStatelessServiceInstanceDetailInfo extends models['DeployedService serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'DeployedServiceReplicaDetailInfo', className: 'DeployedStatelessServiceInstanceDetailInfo', modelProperties: { serviceName: { @@ -90,6 +106,7 @@ class DeployedStatelessServiceInstanceDetailInfo extends models['DeployedService serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } @@ -106,6 +123,11 @@ class DeployedStatelessServiceInstanceDetailInfo extends models['DeployedService serializedName: 'DeployedServiceReplicaQueryResult', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'DeployedServiceReplicaInfo', className: 'DeployedStatelessServiceInstanceInfo' } } diff --git a/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceInfo.js b/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceInfo.js index 26ecbdca84..c800cbc9e6 100644 --- a/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceInfo.js +++ b/lib/services/serviceFabric/lib/models/deployedStatelessServiceInstanceInfo.js @@ -20,7 +20,12 @@ const models = require('./index'); class DeployedStatelessServiceInstanceInfo extends models['DeployedServiceReplicaInfo'] { /** * Create a DeployedStatelessServiceInstanceInfo. - * @member {string} [instanceId] + * @member {string} [instanceId] Id of a stateless service instance. + * InstanceId is used by Service Fabric to uniquely identify an instance of a + * partition of a stateless service. It is unique within a partition and does + * not change for the lifetime of the instance. If the instance has failed + * over on the same or different node, it will get a different value for the + * InstanceId. */ constructor() { super(); @@ -38,6 +43,11 @@ class DeployedStatelessServiceInstanceInfo extends models['DeployedServiceReplic serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'DeployedServiceReplicaInfo', className: 'DeployedStatelessServiceInstanceInfo', modelProperties: { serviceName: { @@ -106,6 +116,7 @@ class DeployedStatelessServiceInstanceInfo extends models['DeployedServiceReplic serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/diagnosticsDescription.js b/lib/services/serviceFabric/lib/models/diagnosticsDescription.js new file mode 100644 index 0000000000..9b44d203ed --- /dev/null +++ b/lib/services/serviceFabric/lib/models/diagnosticsDescription.js @@ -0,0 +1,90 @@ +/* + * 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 diagnostics options available + * + */ +class DiagnosticsDescription { + /** + * Create a DiagnosticsDescription. + * @member {array} [sinks] List of supported sinks that can be referenced. + * @member {boolean} [enabled] Status of whether or not sinks are enabled. + * @member {array} [defaultSinkRefs] The sinks to be used if diagnostics is + * enabled. Sink choices can be overridden at the service and code package + * level. + */ + constructor() { + } + + /** + * Defines the metadata of DiagnosticsDescription + * + * @returns {object} metadata of DiagnosticsDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticsDescription', + type: { + name: 'Composite', + className: 'DiagnosticsDescription', + modelProperties: { + sinks: { + required: false, + serializedName: 'sinks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiagnosticsSinkPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'DiagnosticsSinkProperties', + className: 'DiagnosticsSinkProperties' + } + } + } + }, + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + defaultSinkRefs: { + required: false, + serializedName: 'defaultSinkRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = DiagnosticsDescription; diff --git a/lib/services/serviceFabric/lib/models/diagnosticsRef.js b/lib/services/serviceFabric/lib/models/diagnosticsRef.js new file mode 100644 index 0000000000..9eecc2c1ad --- /dev/null +++ b/lib/services/serviceFabric/lib/models/diagnosticsRef.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Reference to sinks in DiagnosticsDescription. + * + */ +class DiagnosticsRef { + /** + * Create a DiagnosticsRef. + * @member {boolean} [enabled] Status of whether or not sinks are enabled. + * @member {array} [sinkRefs] List of sinks to be used if enabled. References + * the list of sinks in DiagnosticsDescription. + */ + constructor() { + } + + /** + * Defines the metadata of DiagnosticsRef + * + * @returns {object} metadata of DiagnosticsRef + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticsRef', + type: { + name: 'Composite', + className: 'DiagnosticsRef', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + sinkRefs: { + required: false, + serializedName: 'sinkRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = DiagnosticsRef; diff --git a/lib/services/serviceFabric/lib/models/diagnosticsSinkProperties.js b/lib/services/serviceFabric/lib/models/diagnosticsSinkProperties.js new file mode 100644 index 0000000000..ceeca226a5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/diagnosticsSinkProperties.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'; + +/** + * Properties of a DiagnosticsSink. + * + */ +class DiagnosticsSinkProperties { + /** + * Create a DiagnosticsSinkProperties. + * @member {string} [name] Name of the sink. This value is referenced by + * DiagnosticsReferenceDescription + * @member {string} [description] A description of the sink. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of DiagnosticsSinkProperties + * + * @returns {object} metadata of DiagnosticsSinkProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticsSinkProperties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'DiagnosticsSinkProperties', + className: 'DiagnosticsSinkProperties', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiagnosticsSinkProperties; diff --git a/lib/services/serviceFabric/lib/models/doublePropertyValue.js b/lib/services/serviceFabric/lib/models/doublePropertyValue.js new file mode 100644 index 0000000000..1066da0a37 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/doublePropertyValue.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Service Fabric property value of type Double. + * + * @extends models['PropertyValue'] + */ +class DoublePropertyValue extends models['PropertyValue'] { + /** + * Create a DoublePropertyValue. + * @member {number} data The data of the property value. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DoublePropertyValue + * + * @returns {object} metadata of DoublePropertyValue + * + */ + mapper() { + return { + required: false, + serializedName: 'Double', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'DoublePropertyValue', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + data: { + required: true, + serializedName: 'Data', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = DoublePropertyValue; diff --git a/lib/services/serviceFabric/lib/models/enableBackupDescription.js b/lib/services/serviceFabric/lib/models/enableBackupDescription.js new file mode 100644 index 0000000000..2c7d427aaf --- /dev/null +++ b/lib/services/serviceFabric/lib/models/enableBackupDescription.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Specifies the parameters needed to enable periodic backup. + * + */ +class EnableBackupDescription { + /** + * Create a EnableBackupDescription. + * @member {string} backupPolicyName Name of the backup policy to be used for + * enabling periodic backups. + */ + constructor() { + } + + /** + * Defines the metadata of EnableBackupDescription + * + * @returns {object} metadata of EnableBackupDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'EnableBackupDescription', + type: { + name: 'Composite', + className: 'EnableBackupDescription', + modelProperties: { + backupPolicyName: { + required: true, + serializedName: 'BackupPolicyName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EnableBackupDescription; diff --git a/lib/services/serviceFabric/lib/models/endpointProperties.js b/lib/services/serviceFabric/lib/models/endpointProperties.js new file mode 100644 index 0000000000..1e8205744b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/endpointProperties.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'; + +/** + * Describes a container endpoint. + * + */ +class EndpointProperties { + /** + * Create a EndpointProperties. + * @member {string} name The name of the endpoint. + * @member {number} [port] Port used by the container. + */ + constructor() { + } + + /** + * Defines the metadata of EndpointProperties + * + * @returns {object} metadata of EndpointProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'EndpointProperties', + type: { + name: 'Composite', + className: 'EndpointProperties', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + port: { + required: false, + serializedName: 'port', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = EndpointProperties; diff --git a/lib/services/serviceFabric/lib/models/ensureAvailabilitySafetyCheck.js b/lib/services/serviceFabric/lib/models/ensureAvailabilitySafetyCheck.js index aa2b4b5f5e..cea6ae9582 100644 --- a/lib/services/serviceFabric/lib/models/ensureAvailabilitySafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/ensureAvailabilitySafetyCheck.js @@ -39,11 +39,17 @@ class EnsureAvailabilitySafetyCheck extends models['PartitionSafetyCheck'] { serializedName: 'EnsureAvailability', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'EnsureAvailabilitySafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/ensurePartitionQurumSafetyCheck.js b/lib/services/serviceFabric/lib/models/ensurePartitionQurumSafetyCheck.js index 532d7105db..d2764e7596 100644 --- a/lib/services/serviceFabric/lib/models/ensurePartitionQurumSafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/ensurePartitionQurumSafetyCheck.js @@ -38,11 +38,17 @@ class EnsurePartitionQurumSafetyCheck extends models['PartitionSafetyCheck'] { serializedName: 'EnsurePartitionQuorum', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'EnsurePartitionQurumSafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/entityHealth.js b/lib/services/serviceFabric/lib/models/entityHealth.js index ce2e2e4a07..6da0ee06d3 100644 --- a/lib/services/serviceFabric/lib/models/entityHealth.js +++ b/lib/services/serviceFabric/lib/models/entityHealth.js @@ -10,23 +10,26 @@ 'use strict'; -const models = require('./index'); - /** * Health information common to all entities in the cluster. It contains the * aggregated health state, health events and unhealthy evaluation. * - * */ class EntityHealth { /** * Create a EntityHealth. - * @member {string} [aggregatedHealthState] Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [aggregatedHealthState] The HealthState representing the + * aggregated health state of the entity computed by Health Manager. + * The health evaluation of the entity reflects all events reported on the + * entity and its children (if any). + * The aggregation is done by applying the desired health policy. Possible + * values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' * @member {array} [healthEvents] The list of health events reported on the * entity. - * @member {array} [unhealthyEvaluations] - * @member {object} [healthStatistics] + * @member {array} [unhealthyEvaluations] The unhealthy evaluations that show + * why the current aggregated health state was returned by Health Manager. + * @member {object} [healthStatistics] Shows the health statistics for all + * children types of the queried entity. * @member {array} [healthStatistics.healthStateCountList] List of health * state counts per entity kind, which keeps track of how many children of * the queried entity are in Ok, Warning and Error state. diff --git a/lib/services/serviceFabric/lib/models/entityHealthState.js b/lib/services/serviceFabric/lib/models/entityHealthState.js index 69910b5535..7f47b6a4db 100644 --- a/lib/services/serviceFabric/lib/models/entityHealthState.js +++ b/lib/services/serviceFabric/lib/models/entityHealthState.js @@ -18,8 +18,10 @@ class EntityHealthState { /** * Create a EntityHealthState. - * @member {string} [aggregatedHealthState] Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [aggregatedHealthState] The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/entityHealthStateChunk.js b/lib/services/serviceFabric/lib/models/entityHealthStateChunk.js index fb5d680e5a..e8c38e8328 100644 --- a/lib/services/serviceFabric/lib/models/entityHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/entityHealthStateChunk.js @@ -18,8 +18,9 @@ class EntityHealthStateChunk { /** * Create a EntityHealthStateChunk. - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/entityKindHealthStateCount.js b/lib/services/serviceFabric/lib/models/entityKindHealthStateCount.js index da363bc1a6..5ba525c551 100644 --- a/lib/services/serviceFabric/lib/models/entityKindHealthStateCount.js +++ b/lib/services/serviceFabric/lib/models/entityKindHealthStateCount.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents health state count for entities of the specified entity kind. * @@ -19,10 +17,12 @@ const models = require('./index'); class EntityKindHealthStateCount { /** * Create a EntityKindHealthStateCount. - * @member {string} [entityKind] Possible values include: 'Invalid', 'Node', - * 'Partition', 'Service', 'Application', 'Replica', 'DeployedApplication', + * @member {string} [entityKind] The entity kind for which health states are + * evaluated. Possible values include: 'Invalid', 'Node', 'Partition', + * 'Service', 'Application', 'Replica', 'DeployedApplication', * 'DeployedServicePackage', 'Cluster' - * @member {object} [healthStateCount] + * @member {object} [healthStateCount] The health state count for the + * entities of the specified kind. * @member {number} [healthStateCount.okCount] The number of health entities * with aggregated health state Ok. * @member {number} [healthStateCount.warningCount] The number of health diff --git a/lib/services/serviceFabric/lib/models/environmentVariable.js b/lib/services/serviceFabric/lib/models/environmentVariable.js new file mode 100644 index 0000000000..7581ab7c63 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/environmentVariable.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'; + +/** + * Describes an environment variable for the container. + * + */ +class EnvironmentVariable { + /** + * Create a EnvironmentVariable. + * @member {string} [name] The name of the environment variable. + * @member {string} [value] The value of the environment variable. + */ + constructor() { + } + + /** + * Defines the metadata of EnvironmentVariable + * + * @returns {object} metadata of EnvironmentVariable + * + */ + mapper() { + return { + required: false, + serializedName: 'EnvironmentVariable', + type: { + name: 'Composite', + className: 'EnvironmentVariable', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EnvironmentVariable; diff --git a/lib/services/serviceFabric/lib/models/epoch.js b/lib/services/serviceFabric/lib/models/epoch.js index 28738ea73f..fbae64cfe6 100644 --- a/lib/services/serviceFabric/lib/models/epoch.js +++ b/lib/services/serviceFabric/lib/models/epoch.js @@ -17,7 +17,6 @@ * replica are said to be a new Epoch from the ones which were sent by the old * Primary replica. * - * */ class Epoch { /** diff --git a/lib/services/serviceFabric/lib/models/eventHealthEvaluation.js b/lib/services/serviceFabric/lib/models/eventHealthEvaluation.js index 89d14f17a1..347ee6b8fa 100644 --- a/lib/services/serviceFabric/lib/models/eventHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/eventHealthEvaluation.js @@ -18,7 +18,6 @@ const models = require('./index'); * The health evaluation is returned when evaluating health of an entity * results in Error or Warning. * - * * @extends models['HealthEvaluation'] */ class EventHealthEvaluation extends models['HealthEvaluation'] { @@ -27,7 +26,9 @@ class EventHealthEvaluation extends models['HealthEvaluation'] { * @member {boolean} [considerWarningAsError] Indicates whether warnings are * treated with the same severity as errors. The field is specified in the * health policy used to evaluate the entity. - * @member {object} [unhealthyEvent] + * @member {object} [unhealthyEvent] Represents health information reported + * on a health entity, such as cluster, application or node, with additional + * metadata added by the Health Manager. * @member {boolean} [unhealthyEvent.isExpired] Returns true if the health * event is expired, otherwise false. * @member {date} [unhealthyEvent.sourceUtcTimestamp] The date and time when @@ -88,6 +89,11 @@ class EventHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Event', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'EventHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -107,6 +113,7 @@ class EventHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/executingFaultsChaosEvent.js b/lib/services/serviceFabric/lib/models/executingFaultsChaosEvent.js index ca72bf12f6..854024414f 100644 --- a/lib/services/serviceFabric/lib/models/executingFaultsChaosEvent.js +++ b/lib/services/serviceFabric/lib/models/executingFaultsChaosEvent.js @@ -22,7 +22,8 @@ const models = require('./index'); class ExecutingFaultsChaosEvent extends models['ChaosEvent'] { /** * Create a ExecutingFaultsChaosEvent. - * @member {array} [faults] + * @member {array} [faults] List of string description of the faults that + * Chaos decided to execute in an iteration. */ constructor() { super(); @@ -40,6 +41,11 @@ class ExecutingFaultsChaosEvent extends models['ChaosEvent'] { serializedName: 'ExecutingFaults', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ChaosEvent', className: 'ExecutingFaultsChaosEvent', modelProperties: { timeStampUtc: { @@ -52,6 +58,7 @@ class ExecutingFaultsChaosEvent extends models['ChaosEvent'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/externalStoreProvisionApplicationTypeDescription.js b/lib/services/serviceFabric/lib/models/externalStoreProvisionApplicationTypeDescription.js new file mode 100644 index 0000000000..b6a9c563a7 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/externalStoreProvisionApplicationTypeDescription.js @@ -0,0 +1,101 @@ +/* + * 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 the operation to register or provision an application type using + * an application package from an external store instead of a package uploaded + * to the Service Fabric image store. + * + * @extends models['ProvisionApplicationTypeDescriptionBase'] + */ +class ExternalStoreProvisionApplicationTypeDescription extends models['ProvisionApplicationTypeDescriptionBase'] { + /** + * Create a ExternalStoreProvisionApplicationTypeDescription. + * @member {string} applicationPackageDownloadUri The path to the '.sfpkg' + * application package from where the application package can be downloaded + * using HTTP or HTTPS protocols. The application package can be stored in an + * external store that provides GET operation to download the file. Supported + * protocols are HTTP and HTTPS, and the path must allow READ access. + * @member {string} applicationTypeName The application type name represents + * the name of the application type found in the application manifest. + * @member {string} applicationTypeVersion The application type version + * represents the version of the application type found in the application + * manifest. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ExternalStoreProvisionApplicationTypeDescription + * + * @returns {object} metadata of ExternalStoreProvisionApplicationTypeDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ExternalStore', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ProvisionApplicationTypeDescriptionBase', + className: 'ExternalStoreProvisionApplicationTypeDescription', + modelProperties: { + async: { + required: true, + serializedName: 'Async', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationPackageDownloadUri: { + required: true, + serializedName: 'ApplicationPackageDownloadUri', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExternalStoreProvisionApplicationTypeDescription; diff --git a/lib/services/serviceFabric/lib/models/fabricError.js b/lib/services/serviceFabric/lib/models/fabricError.js index 08ff1c4327..cd678c7145 100644 --- a/lib/services/serviceFabric/lib/models/fabricError.js +++ b/lib/services/serviceFabric/lib/models/fabricError.js @@ -10,20 +10,123 @@ 'use strict'; -const models = require('./index'); - /** * The REST API operations for Service Fabric return standard HTTP status * codes. This type defines the additional information returned from the * Service Fabric API operations that are not successful. * - * */ class FabricError { /** * Create a FabricError. - * @member {object} error - * @member {string} [error.code] Possible values include: + * @member {object} error Error object containing error code and error + * message. + * @member {string} [error.code] Defines the fabric error codes that be + * returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values + * that can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request + * Entity Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: * 'FABRIC_E_INVALID_PARTITION_KEY', * 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', * 'FABRIC_E_APPLICATION_NOT_UPGRADING', @@ -67,7 +170,19 @@ class FabricError { * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', - * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP' + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' * @member {string} [error.message] Error message. */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/fabricErrorError.js b/lib/services/serviceFabric/lib/models/fabricErrorError.js index 87b7225f10..9a51254db6 100644 --- a/lib/services/serviceFabric/lib/models/fabricErrorError.js +++ b/lib/services/serviceFabric/lib/models/fabricErrorError.js @@ -17,7 +17,112 @@ class FabricErrorError { /** * Create a FabricErrorError. - * @member {string} code Possible values include: + * @member {string} code Defines the fabric error codes that be returned as + * part of the error object in response to Service Fabric API operations that + * are not successful. Following are the error code values that can be + * returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request + * Entity Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: * 'FABRIC_E_INVALID_PARTITION_KEY', * 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', * 'FABRIC_E_APPLICATION_NOT_UPGRADING', @@ -61,7 +166,19 @@ class FabricErrorError { * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', - * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP' + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' * @member {string} [message] Error message. */ constructor() { @@ -76,7 +193,7 @@ class FabricErrorError { mapper() { return { required: false, - serializedName: 'FabricError_Error', + serializedName: 'FabricErrorError', type: { name: 'Composite', className: 'FabricErrorError', diff --git a/lib/services/serviceFabric/lib/models/fabricEvent.js b/lib/services/serviceFabric/lib/models/fabricEvent.js new file mode 100644 index 0000000000..21f62dbe8d --- /dev/null +++ b/lib/services/serviceFabric/lib/models/fabricEvent.js @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Represents the base for all Fabric Events. + * + */ +class FabricEvent { + /** + * Create a FabricEvent. + * @member {uuid} eventInstanceId The identifier for the FabricEvent + * instance. + * @member {date} timeStamp The time event was logged. + * @member {boolean} [hasCorrelatedEvents] Shows there is existing related + * events available. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of FabricEvent + * + * @returns {object} metadata of FabricEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'FabricEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'FabricEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FabricEvent; diff --git a/lib/services/serviceFabric/lib/models/failedPropertyBatchInfo.js b/lib/services/serviceFabric/lib/models/failedPropertyBatchInfo.js new file mode 100644 index 0000000000..d003ff8f08 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/failedPropertyBatchInfo.js @@ -0,0 +1,81 @@ +/* + * 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'); + +/** + * Derived from PropertyBatchInfo. Represents the property batch failing. + * Contains information about the specific batch failure. + * + * @extends models['PropertyBatchInfo'] + */ +class FailedPropertyBatchInfo extends models['PropertyBatchInfo'] { + /** + * Create a FailedPropertyBatchInfo. + * @member {string} [errorMessage] The error message of the failed operation. + * Describes the exception thrown due to the first unsuccessful operation in + * the property batch. + * @member {number} [operationIndex] The index of the unsuccessful operation + * in the property batch. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FailedPropertyBatchInfo + * + * @returns {object} metadata of FailedPropertyBatchInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'Failed', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchInfo', + className: 'FailedPropertyBatchInfo', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + errorMessage: { + required: false, + serializedName: 'ErrorMessage', + type: { + name: 'String' + } + }, + operationIndex: { + required: false, + serializedName: 'OperationIndex', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = FailedPropertyBatchInfo; diff --git a/lib/services/serviceFabric/lib/models/failedUpgradeDomainProgressObject.js b/lib/services/serviceFabric/lib/models/failedUpgradeDomainProgressObject.js index 2ce9974bec..69bbeff1f3 100644 --- a/lib/services/serviceFabric/lib/models/failedUpgradeDomainProgressObject.js +++ b/lib/services/serviceFabric/lib/models/failedUpgradeDomainProgressObject.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The detailed upgrade progress for nodes in the current upgrade domain at the * point of failure. @@ -20,8 +18,9 @@ const models = require('./index'); class FailedUpgradeDomainProgressObject { /** * Create a FailedUpgradeDomainProgressObject. - * @member {string} [domainName] - * @member {array} [nodeUpgradeProgressList] + * @member {string} [domainName] The name of the upgrade domain + * @member {array} [nodeUpgradeProgressList] List of upgrading nodes and + * their statuses */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/failureUpgradeDomainProgressInfo.js b/lib/services/serviceFabric/lib/models/failureUpgradeDomainProgressInfo.js index e046ae125e..167c29eb52 100644 --- a/lib/services/serviceFabric/lib/models/failureUpgradeDomainProgressInfo.js +++ b/lib/services/serviceFabric/lib/models/failureUpgradeDomainProgressInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about the upgrade domain progress at the time of upgrade * failure. @@ -20,8 +18,9 @@ const models = require('./index'); class FailureUpgradeDomainProgressInfo { /** * Create a FailureUpgradeDomainProgressInfo. - * @member {string} [domainName] - * @member {array} [nodeUpgradeProgressList] + * @member {string} [domainName] The name of the upgrade domain + * @member {array} [nodeUpgradeProgressList] List of upgrading nodes and + * their statuses */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/fileInfo.js b/lib/services/serviceFabric/lib/models/fileInfo.js index aa63386d43..50cc92eacd 100644 --- a/lib/services/serviceFabric/lib/models/fileInfo.js +++ b/lib/services/serviceFabric/lib/models/fileInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a image store file. * @@ -20,12 +18,16 @@ class FileInfo { /** * Create a FileInfo. * @member {string} [fileSize] The size of file in bytes. - * @member {object} [fileVersion] - * @member {string} [fileVersion.versionNumber] The current iamge store + * @member {object} [fileVersion] Information about the version of image + * store file. + * @member {string} [fileVersion.versionNumber] The current image store * version number for the file is used in image store for checking whether it * need to be updated. * @member {string} [fileVersion.epochDataLossNumber] The epoch data loss - * number of image store file is used to indicate the status of data loss. + * number of image store replica when this file entry was updated or created. + * @member {string} [fileVersion.epochConfigurationNumber] The epoch + * configuration version number of the image store replica when this file + * entry was created or updated. * @member {date} [modifiedDate] The date and time when the image store file * was last modified. * @member {string} [storeRelativePath] The file path relative to the image diff --git a/lib/services/serviceFabric/lib/models/fileShareBackupStorageDescription.js b/lib/services/serviceFabric/lib/models/fileShareBackupStorageDescription.js new file mode 100644 index 0000000000..e050cf6adb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/fileShareBackupStorageDescription.js @@ -0,0 +1,114 @@ +/* + * 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 the parameters for file share storage used for storing or + * enumerating backups. + * + * @extends models['BackupStorageDescription'] + */ +class FileShareBackupStorageDescription extends models['BackupStorageDescription'] { + /** + * Create a FileShareBackupStorageDescription. + * @member {string} path UNC path of the file share where to store or + * enumerate backups from. + * @member {string} [primaryUserName] Primary user name to access the file + * share. + * @member {string} [primaryPassword] Primary password to access the share + * location. + * @member {string} [secondaryUserName] Secondary user name to access the + * file share. + * @member {string} [secondaryPassword] Secondary password to access the + * share location + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FileShareBackupStorageDescription + * + * @returns {object} metadata of FileShareBackupStorageDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'FileShare', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'StorageKind', + clientName: 'storageKind' + }, + uberParent: 'BackupStorageDescription', + className: 'FileShareBackupStorageDescription', + modelProperties: { + friendlyName: { + required: false, + serializedName: 'FriendlyName', + type: { + name: 'String' + } + }, + storageKind: { + required: true, + serializedName: 'StorageKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + path: { + required: true, + serializedName: 'Path', + type: { + name: 'String' + } + }, + primaryUserName: { + required: false, + serializedName: 'PrimaryUserName', + type: { + name: 'String' + } + }, + primaryPassword: { + required: false, + serializedName: 'PrimaryPassword', + type: { + name: 'String' + } + }, + secondaryUserName: { + required: false, + serializedName: 'SecondaryUserName', + type: { + name: 'String' + } + }, + secondaryPassword: { + required: false, + serializedName: 'SecondaryPassword', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FileShareBackupStorageDescription; diff --git a/lib/services/serviceFabric/lib/models/fileVersion.js b/lib/services/serviceFabric/lib/models/fileVersion.js index f355841593..d786d21170 100644 --- a/lib/services/serviceFabric/lib/models/fileVersion.js +++ b/lib/services/serviceFabric/lib/models/fileVersion.js @@ -17,11 +17,14 @@ class FileVersion { /** * Create a FileVersion. - * @member {string} [versionNumber] The current iamge store version number + * @member {string} [versionNumber] The current image store version number * for the file is used in image store for checking whether it need to be * updated. * @member {string} [epochDataLossNumber] The epoch data loss number of image - * store file is used to indicate the status of data loss. + * store replica when this file entry was updated or created. + * @member {string} [epochConfigurationNumber] The epoch configuration + * version number of the image store replica when this file entry was created + * or updated. */ constructor() { } @@ -53,6 +56,13 @@ class FileVersion { type: { name: 'String' } + }, + epochConfigurationNumber: { + required: false, + serializedName: 'EpochConfigurationNumber', + type: { + name: 'String' + } } } } diff --git a/lib/services/serviceFabric/lib/models/folderInfo.js b/lib/services/serviceFabric/lib/models/folderInfo.js index 53c5c18e5c..7e8bbfe572 100644 --- a/lib/services/serviceFabric/lib/models/folderInfo.js +++ b/lib/services/serviceFabric/lib/models/folderInfo.js @@ -11,16 +11,17 @@ 'use strict'; /** - * Information about a image store folder. It inclues how many files this + * Information about a image store folder. It includes how many files this * folder contains and its image store relative path. * */ class FolderInfo { /** * Create a FolderInfo. - * @member {string} [storeRelativePath] - * @member {uuid} [fileCount] The number of files from within the image store - * folder. + * @member {string} [storeRelativePath] The remote location within image + * store. This path is relative to the image store root. + * @member {string} [fileCount] The number of files from within the image + * store folder. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/frequencyBasedBackupScheduleDescription.js b/lib/services/serviceFabric/lib/models/frequencyBasedBackupScheduleDescription.js new file mode 100644 index 0000000000..903d9d123e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/frequencyBasedBackupScheduleDescription.js @@ -0,0 +1,71 @@ +/* + * 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 the frequency based backup schedule. + * + * @extends models['BackupScheduleDescription'] + */ +class FrequencyBasedBackupScheduleDescription extends models['BackupScheduleDescription'] { + /** + * Create a FrequencyBasedBackupScheduleDescription. + * @member {moment.duration} interval Defines the interval with which backups + * are periodically taken. It should be specified in ISO8601 format. Timespan + * in seconds is not supported and will be ignored while creating the policy. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FrequencyBasedBackupScheduleDescription + * + * @returns {object} metadata of FrequencyBasedBackupScheduleDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'FrequencyBased', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ScheduleKind', + clientName: 'scheduleKind' + }, + uberParent: 'BackupScheduleDescription', + className: 'FrequencyBasedBackupScheduleDescription', + modelProperties: { + scheduleKind: { + required: true, + serializedName: 'ScheduleKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + interval: { + required: true, + serializedName: 'Interval', + type: { + name: 'TimeSpan' + } + } + } + } + }; + } +} + +module.exports = FrequencyBasedBackupScheduleDescription; diff --git a/lib/services/serviceFabric/lib/models/getBackupByStorageQueryDescription.js b/lib/services/serviceFabric/lib/models/getBackupByStorageQueryDescription.js new file mode 100644 index 0000000000..c41da59959 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/getBackupByStorageQueryDescription.js @@ -0,0 +1,114 @@ +/* + * 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 additional filters to be applied, while listing backups, and + * backup storage details from where to fetch the backups. + * + */ +class GetBackupByStorageQueryDescription { + /** + * Create a GetBackupByStorageQueryDescription. + * @member {date} [startDateTimeFilter] Specifies the start date time in + * ISO8601 from which to enumerate backups. If not specified, backups are + * enumerated from the beginning. + * @member {date} [endDateTimeFilter] Specifies the end date time in ISO8601 + * till which to enumerate backups. If not specified, backups are enumerated + * till the end. + * @member {boolean} [latest] If specified as true, gets the most recent + * backup (within the specified time range) for every partition under the + * specified backup entity. Default value: false . + * @member {object} storage Describes the parameters for the backup storage + * from where to enumerate backups. This is optional and by default backups + * are enumerated from the backup storage where this backup entity is + * currently being backed up (as specified in backup policy). This parameter + * is useful to be able to enumerate backups from another cluster where you + * may intend to restore. + * @member {string} [storage.friendlyName] Friendly name for this backup + * storage. + * @member {string} [storage.storageKind] Polymorphic Discriminator + * @member {object} backupEntity Indicates the entity for which to enumerate + * backups. + * @member {string} [backupEntity.entityKind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of GetBackupByStorageQueryDescription + * + * @returns {object} metadata of GetBackupByStorageQueryDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'GetBackupByStorageQueryDescription', + type: { + name: 'Composite', + className: 'GetBackupByStorageQueryDescription', + modelProperties: { + startDateTimeFilter: { + required: false, + serializedName: 'StartDateTimeFilter', + type: { + name: 'DateTime' + } + }, + endDateTimeFilter: { + required: false, + serializedName: 'EndDateTimeFilter', + type: { + name: 'DateTime' + } + }, + latest: { + required: false, + serializedName: 'Latest', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + storage: { + required: true, + serializedName: 'Storage', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'StorageKind', + clientName: 'storageKind' + }, + uberParent: 'BackupStorageDescription', + className: 'BackupStorageDescription' + } + }, + backupEntity: { + required: true, + serializedName: 'BackupEntity', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'EntityKind', + clientName: 'entityKind' + }, + uberParent: 'BackupEntity', + className: 'BackupEntity' + } + } + } + } + }; + } +} + +module.exports = GetBackupByStorageQueryDescription; diff --git a/lib/services/serviceFabric/lib/models/getPropertyBatchOperation.js b/lib/services/serviceFabric/lib/models/getPropertyBatchOperation.js new file mode 100644 index 0000000000..6b09399140 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/getPropertyBatchOperation.js @@ -0,0 +1,83 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a PropertyBatchOperation that gets the specified property if it + * exists. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. + * + * @extends models['PropertyBatchOperation'] + */ +class GetPropertyBatchOperation extends models['PropertyBatchOperation'] { + /** + * Create a GetPropertyBatchOperation. + * @member {boolean} [includeValue] Whether or not to return the property + * value with the metadata. + * True if values should be returned with the metadata; False to return only + * property metadata. Default value: false . + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GetPropertyBatchOperation + * + * @returns {object} metadata of GetPropertyBatchOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'Get', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'GetPropertyBatchOperation', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + includeValue: { + required: false, + serializedName: 'IncludeValue', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = GetPropertyBatchOperation; diff --git a/lib/services/serviceFabric/lib/models/guidPropertyValue.js b/lib/services/serviceFabric/lib/models/guidPropertyValue.js new file mode 100644 index 0000000000..4f84cc41b7 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/guidPropertyValue.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Service Fabric property value of type Guid. + * + * @extends models['PropertyValue'] + */ +class GuidPropertyValue extends models['PropertyValue'] { + /** + * Create a GuidPropertyValue. + * @member {uuid} data The data of the property value. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GuidPropertyValue + * + * @returns {object} metadata of GuidPropertyValue + * + */ + mapper() { + return { + required: false, + serializedName: 'Guid', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'GuidPropertyValue', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + data: { + required: true, + serializedName: 'Data', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GuidPropertyValue; diff --git a/lib/services/serviceFabric/lib/models/healthEvaluation.js b/lib/services/serviceFabric/lib/models/healthEvaluation.js index bdb437e637..00cdb40983 100644 --- a/lib/services/serviceFabric/lib/models/healthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/healthEvaluation.js @@ -18,8 +18,10 @@ class HealthEvaluation { /** * Create a HealthEvaluation. - * @member {string} [aggregatedHealthState] Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [aggregatedHealthState] The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * @member {string} [description] Description of the health evaluation, which * represents a summary of the evaluation process. * @member {string} kind Polymorphic Discriminator @@ -63,6 +65,7 @@ class HealthEvaluation { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/healthEvaluationWrapper.js b/lib/services/serviceFabric/lib/models/healthEvaluationWrapper.js index b718b640b3..c9d263baaf 100644 --- a/lib/services/serviceFabric/lib/models/healthEvaluationWrapper.js +++ b/lib/services/serviceFabric/lib/models/healthEvaluationWrapper.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Wrapper object for health evaluation. * @@ -19,9 +17,13 @@ const models = require('./index'); class HealthEvaluationWrapper { /** * Create a HealthEvaluationWrapper. - * @member {object} [healthEvaluation] - * @member {string} [healthEvaluation.aggregatedHealthState] Possible values - * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {object} [healthEvaluation] Represents a health evaluation which + * describes the data and the algorithm used by health manager to evaluate + * the health of an entity. + * @member {string} [healthEvaluation.aggregatedHealthState] The health state + * of a Service Fabric entity such as Cluster, Node, Application, Service, + * Partition, Replica etc. Possible values include: 'Invalid', 'Ok', + * 'Warning', 'Error', 'Unknown' * @member {string} [healthEvaluation.description] Description of the health * evaluation, which represents a summary of the evaluation process. * @member {string} [healthEvaluation.kind] Polymorphic Discriminator diff --git a/lib/services/serviceFabric/lib/models/healthEvent.js b/lib/services/serviceFabric/lib/models/healthEvent.js index 8703299134..cd367ded46 100644 --- a/lib/services/serviceFabric/lib/models/healthEvent.js +++ b/lib/services/serviceFabric/lib/models/healthEvent.js @@ -16,7 +16,6 @@ const models = require('./index'); * Represents health information reported on a health entity, such as cluster, * application or node, with additional metadata added by the Health Manager. * - * * @extends models['HealthInformation'] */ class HealthEvent extends models['HealthInformation'] { diff --git a/lib/services/serviceFabric/lib/models/healthInformation.js b/lib/services/serviceFabric/lib/models/healthInformation.js index 7aeaa50e51..1b7c07718f 100644 --- a/lib/services/serviceFabric/lib/models/healthInformation.js +++ b/lib/services/serviceFabric/lib/models/healthInformation.js @@ -15,13 +15,12 @@ * reports sent to health store and in all health events returned by health * queries. * - * */ class HealthInformation { /** * Create a HealthInformation. - * @member {string} sourceId The source name which identifies the - * client/watchdog/system component which generated the health information. + * @member {string} sourceId The source name that identifies the + * client/watchdog/system component that generated the health information. * @member {string} property The property of the health information. An * entity can have health reports for different properties. * The property is a string and not a fixed enumeration to allow the reporter @@ -36,10 +35,11 @@ class HealthInformation { * * Together with the SourceId, the property uniquely identifies the health * information. - * @member {string} healthState Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' + * @member {string} healthState The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' * @member {moment.duration} [timeToLiveInMilliSeconds] The duration for - * which this health report is valid. This field is using ISO8601 format for + * which this health report is valid. This field uses ISO8601 format for * specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -69,7 +69,7 @@ class HealthInformation { * when a report is added. * @member {boolean} [removeWhenExpired] Value that indicates whether the * report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. diff --git a/lib/services/serviceFabric/lib/models/healthStateCount.js b/lib/services/serviceFabric/lib/models/healthStateCount.js index 1181728f0d..0ff5b722ed 100644 --- a/lib/services/serviceFabric/lib/models/healthStateCount.js +++ b/lib/services/serviceFabric/lib/models/healthStateCount.js @@ -14,7 +14,6 @@ * Represents information about how many health entities are in Ok, Warning and * Error health state. * - * */ class HealthStateCount { /** diff --git a/lib/services/serviceFabric/lib/models/healthStatistics.js b/lib/services/serviceFabric/lib/models/healthStatistics.js index 9ce21b7f8d..1051a13b96 100644 --- a/lib/services/serviceFabric/lib/models/healthStatistics.js +++ b/lib/services/serviceFabric/lib/models/healthStatistics.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The health statistics of an entity, returned as part of the health query * result when the query description is configured to include statistics. @@ -22,7 +20,6 @@ const models = require('./index'); * applications and deployed service packages. * For partition, the health statistics include health counts for replicas. * - * */ class HealthStatistics { /** diff --git a/lib/services/serviceFabric/lib/models/imageRegistryCredential.js b/lib/services/serviceFabric/lib/models/imageRegistryCredential.js new file mode 100644 index 0000000000..f4d7693a3c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/imageRegistryCredential.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Image registry credential. + * + */ +class ImageRegistryCredential { + /** + * Create a ImageRegistryCredential. + * @member {string} server Docker image registry server, without protocol + * such as `http` and `https`. + * @member {string} username The username for the private registry. + * @member {string} [password] The password for the private registry. + */ + constructor() { + } + + /** + * Defines the metadata of ImageRegistryCredential + * + * @returns {object} metadata of ImageRegistryCredential + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageRegistryCredential', + type: { + name: 'Composite', + className: 'ImageRegistryCredential', + modelProperties: { + server: { + required: true, + serializedName: 'server', + type: { + name: 'String' + } + }, + username: { + required: true, + serializedName: 'username', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImageRegistryCredential; diff --git a/lib/services/serviceFabric/lib/models/imageStoreContent.js b/lib/services/serviceFabric/lib/models/imageStoreContent.js index 99a625f20a..33369c2a6e 100644 --- a/lib/services/serviceFabric/lib/models/imageStoreContent.js +++ b/lib/services/serviceFabric/lib/models/imageStoreContent.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about the image store content. * @@ -21,9 +19,8 @@ class ImageStoreContent { * Create a ImageStoreContent. * @member {array} [storeFiles] The list of image store file info objects * represents files found under the given image store relative path. - * @member {array} [storeFolders] The list of image store folder info - * objectes represents subfolders found under the given image store relative - * path. + * @member {array} [storeFolders] The list of image store folder info objects + * represents subfolders found under the given image store relative path. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/index.d.ts b/lib/services/serviceFabric/lib/models/index.d.ts index 7a5ece902f..4a03fc06ff 100644 --- a/lib/services/serviceFabric/lib/models/index.d.ts +++ b/lib/services/serviceFabric/lib/models/index.d.ts @@ -41,7 +41,8 @@ export interface AadMetadata { * cluster. * * @member {string} [type] The client authentication method. - * @member {object} [metadata] + * @member {object} [metadata] Azure Active Directory metadata used for secured + * connection to cluster. * @member {string} [metadata.authority] The AAD authority url. * @member {string} [metadata.client] The AAD client application Id. * @member {string} [metadata.cluster] The AAD cluster application Id. @@ -55,6 +56,57 @@ export interface AadMetadataObject { metadata?: AadMetadata; } +/** + * @class + * Initializes a new instance of the AnalysisEventMetadata class. + * @constructor + * Metadata about an Analysis Event. + * + * @member {moment.duration} [delay] The analysis delay. + * @member {moment.duration} [duration] The duration of analysis. + */ +export interface AnalysisEventMetadata { + delay?: moment.Duration; + duration?: moment.Duration; +} + +/** + * @class + * Initializes a new instance of the FabricEvent class. + * @constructor + * Represents the base for all Fabric Events. + * + * @member {uuid} eventInstanceId The identifier for the FabricEvent instance. + * @member {date} timeStamp The time event was logged. + * @member {boolean} [hasCorrelatedEvents] Shows there is existing related + * events available. + * @member {string} kind Polymorphic Discriminator + */ +export interface FabricEvent { + eventInstanceId: string; + timeStamp: Date; + hasCorrelatedEvents?: boolean; + kind: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationEvent class. + * @constructor + * Represents the base for all Application Events. + * + * @member {string} applicationId The identity of the application. This is an + * encoded representation of the application name. This is used in the REST + * APIs to identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in + * previous versions. + */ +export interface ApplicationEvent extends FabricEvent { + applicationId: string; +} + /** * @class * Initializes a new instance of the EntityHealthState class. @@ -62,8 +114,10 @@ export interface AadMetadataObject { * A base type for the health state of various entities in the cluster. It * contains the aggregated health state. * - * @member {string} [aggregatedHealthState] Possible values include: 'Invalid', - * 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [aggregatedHealthState] The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' */ export interface EntityHealthState { aggregatedHealthState?: string; @@ -76,7 +130,8 @@ export interface EntityHealthState { * Represents the health state of a service, which contains the service * identifier and its aggregated health state. * - * @member {string} [serviceName] + * @member {string} [serviceName] Name of the service whose health state is + * represented by this object. */ export interface ServiceHealthState extends EntityHealthState { serviceName?: string; @@ -89,8 +144,10 @@ export interface ServiceHealthState extends EntityHealthState { * Represents the health state of a deployed application, which contains the * entity identifier and the aggregated health state. * - * @member {string} [nodeName] - * @member {string} [applicationName] + * @member {string} [nodeName] Name of the node on which the service package is + * deployed. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. */ export interface DeployedApplicationHealthState extends EntityHealthState { nodeName?: string; @@ -104,13 +161,18 @@ export interface DeployedApplicationHealthState extends EntityHealthState { * Health information common to all entities in the cluster. It contains the * aggregated health state, health events and unhealthy evaluation. * - * - * @member {string} [aggregatedHealthState] Possible values include: 'Invalid', - * 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [aggregatedHealthState] The HealthState representing the + * aggregated health state of the entity computed by Health Manager. + * The health evaluation of the entity reflects all events reported on the + * entity and its children (if any). + * The aggregation is done by applying the desired health policy. Possible + * values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' * @member {array} [healthEvents] The list of health events reported on the * entity. - * @member {array} [unhealthyEvaluations] - * @member {object} [healthStatistics] + * @member {array} [unhealthyEvaluations] The unhealthy evaluations that show + * why the current aggregated health state was returned by Health Manager. + * @member {object} [healthStatistics] Shows the health statistics for all + * children types of the queried entity. * @member {array} [healthStatistics.healthStateCountList] List of health state * counts per entity kind, which keeps track of how many children of the * queried entity are in Ok, Warning and Error state. @@ -130,7 +192,8 @@ export interface EntityHealth { * aggregated health state and the service and deployed application health * states. * - * @member {string} [name] + * @member {string} [name] The name of the application, including the 'fabric:' + * URI scheme. * @member {array} [serviceHealthStates] Service health states as found in the * health store. * @member {array} [deployedApplicationHealthStates] Deployed application @@ -149,8 +212,10 @@ export interface ApplicationHealth extends EntityHealth { * Represents a health evaluation which describes the data and the algorithm * used by health manager to evaluate the health of an entity. * - * @member {string} [aggregatedHealthState] Possible values include: 'Invalid', - * 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [aggregatedHealthState] The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * @member {string} [description] Description of the health evaluation, which * represents a summary of the evaluation process. * @member {string} kind Polymorphic Discriminator @@ -167,9 +232,13 @@ export interface HealthEvaluation { * @constructor * Wrapper object for health evaluation. * - * @member {object} [healthEvaluation] - * @member {string} [healthEvaluation.aggregatedHealthState] Possible values - * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {object} [healthEvaluation] Represents a health evaluation which + * describes the data and the algorithm used by health manager to evaluate the + * health of an entity. + * @member {string} [healthEvaluation.aggregatedHealthState] The health state + * of a Service Fabric entity such as Cluster, Node, Application, Service, + * Partition, Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', + * 'Error', 'Unknown' * @member {string} [healthEvaluation.description] Description of the health * evaluation, which represents a summary of the evaluation process. * @member {string} [healthEvaluation.kind] Polymorphic Discriminator @@ -186,8 +255,12 @@ export interface HealthEvaluationWrapper { * about the data and the algorithm used by the health store to evaluate * health. * - * @member {string} [applicationName] - * @member {array} [unhealthyEvaluations] + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the application. The types of + * the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, + * ServicesHealthEvaluation or EventHealthEvaluation. */ export interface ApplicationHealthEvaluation extends HealthEvaluation { applicationName?: string; @@ -201,7 +274,6 @@ export interface ApplicationHealthEvaluation extends HealthEvaluation { * Represents the health policy used to evaluate the health of services * belonging to a service type. * - * * @member {number} [maxPercentUnhealthyPartitionsPerService] The maximum * allowed percentage of unhealthy partitions per service. Allowed values are * Byte values from zero to 100 @@ -213,8 +285,7 @@ export interface ApplicationHealthEvaluation extends HealthEvaluation { * 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 . + * 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. @@ -226,8 +297,7 @@ export interface ApplicationHealthEvaluation extends HealthEvaluation { * 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 . + * 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. @@ -240,8 +310,7 @@ export interface ApplicationHealthEvaluation extends HealthEvaluation { * 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. - * . Default value: 0 . + * services. Default percentage is zero. Default value: 0 . */ export interface ServiceTypeHealthPolicy { maxPercentUnhealthyPartitionsPerService?: number; @@ -255,10 +324,10 @@ export interface ServiceTypeHealthPolicy { * @constructor * Defines an item in ServiceTypeHealthPolicyMap. * - * * @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 {object} value The value of the service type health policy map item. + * This is the ServiceTypeHealthPolicy for this service type. * @member {number} [value.maxPercentUnhealthyPartitionsPerService] The maximum * allowed percentage of unhealthy partitions per service. Allowed values are * Byte values from zero to 100 @@ -309,7 +378,6 @@ export interface ServiceTypeHealthPolicyMapItem { * Defines a health policy used to evaluate the health of an application or one * of its children entities. * - * * @member {boolean} [considerWarningAsError] Indicates whether warnings are * treated with the same severity as errors. Default value: false . * @member {number} [maxPercentUnhealthyDeployedApplications] The maximum @@ -322,9 +390,9 @@ export interface ServiceTypeHealthPolicyMapItem { * 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. - * . Default value: 0 . - * @member {object} [defaultServiceTypeHealthPolicy] + * Default percentage is zero. Default value: 0 . + * @member {object} [defaultServiceTypeHealthPolicy] The health policy used by + * default to evaluate the health of a service type. * @member {number} * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] The * maximum allowed percentage of unhealthy partitions per service. Allowed @@ -365,7 +433,8 @@ export interface ServiceTypeHealthPolicyMapItem { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [serviceTypeHealthPolicyMap] + * @member {array} [serviceTypeHealthPolicyMap] The map with service type + * health policy per service type name. The map is empty by default. */ export interface ApplicationHealthPolicy { considerWarningAsError?: boolean; @@ -380,9 +449,10 @@ export interface ApplicationHealthPolicy { * @constructor * Defines an item in ApplicationHealthPolicyMap. * - * - * @member {string} key - * @member {object} value + * @member {string} key The key of the application health policy map item. This + * is the name of the application. + * @member {object} value The value of the application health policy map item. + * This is the ApplicationHealthPolicy for this application. * @member {boolean} [value.considerWarningAsError] Indicates whether warnings * are treated with the same severity as errors. * @member {number} [value.maxPercentUnhealthyDeployedApplications] The maximum @@ -396,7 +466,8 @@ export interface ApplicationHealthPolicy { * the cluster. * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. - * @member {object} [value.defaultServiceTypeHealthPolicy] + * @member {object} [value.defaultServiceTypeHealthPolicy] The health policy + * used by default to evaluate the health of a service type. * @member {number} * [value.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed @@ -437,7 +508,8 @@ export interface ApplicationHealthPolicy { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [value.serviceTypeHealthPolicyMap] + * @member {array} [value.serviceTypeHealthPolicyMap] The map with service type + * health policy per service type name. The map is empty by default. */ export interface ApplicationHealthPolicyMapItem { key: string; @@ -451,8 +523,9 @@ export interface ApplicationHealthPolicyMapItem { * Defines the application health policy map used to evaluate the health of an * application or one of its children entities. * - * - * @member {array} [applicationHealthPolicyMap] + * @member {array} [applicationHealthPolicyMap] The wrapper that contains the + * map with application health policies used to evaluate specific applications + * in the cluster. */ export interface ApplicationHealthPolicies { applicationHealthPolicyMap?: ApplicationHealthPolicyMapItem[]; @@ -465,8 +538,8 @@ export interface ApplicationHealthPolicies { * Represents the health state of an application, which contains the * application identifier and the aggregated health state. * - * - * @member {string} [name] + * @member {string} [name] The name of the application, including the 'fabric:' + * URI scheme. */ export interface ApplicationHealthState extends EntityHealthState { name?: string; @@ -479,8 +552,9 @@ export interface ApplicationHealthState extends EntityHealthState { * A base type for the health state chunk of various entities in the cluster. * It contains the aggregated health state. * - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' */ export interface EntityHealthStateChunk { healthState?: string; @@ -495,8 +569,16 @@ export interface EntityHealthStateChunk { * The replica health state contains the replica ID and its aggregated health * state. * - * - * @member {string} [replicaOrInstanceId] + * @member {string} [replicaOrInstanceId] Id of a stateful service replica or a + * stateless service instance. This ID is used in the queries that apply to + * both stateful and stateless services. It is used by Service Fabric to + * uniquely identify a replica of a partition of a stateful service or an + * instance of a stateless service partition. It is unique within a partition + * and does not change for the lifetime of the replica or the instance. If a + * stateful replica gets dropped and another replica gets created on the same + * node for the same partition, it will get a different value for the ID. If a + * stateless instance is failed over on the same or different node it will get + * a different value for the ID. */ export interface ReplicaHealthStateChunk extends EntityHealthStateChunk { replicaOrInstanceId?: string; @@ -509,7 +591,6 @@ export interface ReplicaHealthStateChunk extends EntityHealthStateChunk { * The list of replica health state chunks that respect the input filters in * the chunk query. Returned by get cluster health state chunks query. * - * * @member {array} [items] The list of replica health state chunks that respect * the input filters in the chunk query. */ @@ -522,12 +603,13 @@ export interface ReplicaHealthStateChunkList { * Initializes a new instance of the PartitionHealthStateChunk class. * @constructor * Represents the health state chunk of a partition, which contains the - * partition id, its aggregated health state and any replicas that respect the + * partition ID, its aggregated health state and any replicas that respect the * filters in the cluster health chunk query description. * - * - * @member {uuid} [partitionId] - * @member {object} [replicaHealthStateChunks] + * @member {uuid} [partitionId] The Id of the partition. + * @member {object} [replicaHealthStateChunks] The list of replica health state + * chunks belonging to the partition that respect the filters in the cluster + * health chunk query description. * @member {array} [replicaHealthStateChunks.items] The list of replica health * state chunks that respect the input filters in the chunk query. */ @@ -545,7 +627,6 @@ export interface PartitionHealthStateChunk extends EntityHealthStateChunk { * Returned by get cluster health state chunks query as part of the parent * application hierarchy. * - * * @member {array} [items] The list of partition health state chunks that * respect the input filters in the chunk query. */ @@ -561,9 +642,11 @@ export interface PartitionHealthStateChunkList { * name, its aggregated health state and any partitions that respect the * filters in the cluster health chunk query description. * - * - * @member {string} [serviceName] - * @member {object} [partitionHealthStateChunks] + * @member {string} [serviceName] The name of the service whose health state + * chunk is provided in this object. + * @member {object} [partitionHealthStateChunks] The list of partition health + * state chunks belonging to the service that respect the filters in the + * cluster health chunk query description. * @member {array} [partitionHealthStateChunks.items] The list of partition * health state chunks that respect the input filters in the chunk query. */ @@ -579,7 +662,6 @@ export interface ServiceHealthStateChunk extends EntityHealthStateChunk { * The list of service health state chunks that respect the input filters in * the chunk query. Returned by get cluster health state chunks query. * - * * @member {array} [items] The list of service health state chunks that respect * the input filters in the chunk query. */ @@ -595,9 +677,13 @@ export interface ServiceHealthStateChunkList { * contains the service manifest name and the service package aggregated health * state. * - * - * @member {string} [serviceManifestName] - * @member {string} [servicePackageActivationId] + * @member {string} [serviceManifestName] The name of the service manifest. + * @member {string} [servicePackageActivationId] The ActivationId of a deployed + * service package. If ServicePackageActivationMode specified at the time of + * creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ export interface DeployedServicePackageHealthStateChunk extends EntityHealthStateChunk { serviceManifestName?: string; @@ -612,7 +698,6 @@ export interface DeployedServicePackageHealthStateChunk extends EntityHealthStat * input filters in the chunk query. Returned by get cluster health state * chunks query. * - * * @member {array} [items] The list of deployed service package health state * chunks that respect the input filters in the chunk query. */ @@ -629,10 +714,12 @@ export interface DeployedServicePackageHealthStateChunkList { * any deployed service packages that respect the chunk query description * filters. * - * * @member {string} [nodeName] The name of node where the application is * deployed. - * @member {object} [deployedServicePackageHealthStateChunks] + * @member {object} [deployedServicePackageHealthStateChunks] The list of + * deployed service package health state chunks belonging to the deployed + * application that respect the filters in the cluster health chunk query + * description. * @member {array} [deployedServicePackageHealthStateChunks.items] The list of * deployed service package health state chunks that respect the input filters * in the chunk query. @@ -650,7 +737,6 @@ export interface DeployedApplicationHealthStateChunk extends EntityHealthStateCh * filters in the chunk query. Returned by get cluster health state chunks * query. * - * * @member {array} [items] The list of deployed application health state chunks * that respect the input filters in the chunk query. */ @@ -667,13 +753,18 @@ export interface DeployedApplicationHealthStateChunkList { * aggregated health state and any children services and deployed applications * that respect the filters in cluster health chunk query description. * - * - * @member {string} [applicationName] - * @member {string} [applicationTypeName] - * @member {object} [serviceHealthStateChunks] + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [applicationTypeName] The application type name as defined + * in the application manifest. + * @member {object} [serviceHealthStateChunks] The list of service health state + * chunks in the cluster that respect the filters in the cluster health chunk + * query description. * @member {array} [serviceHealthStateChunks.items] The list of service health * state chunks that respect the input filters in the chunk query. - * @member {object} [deployedApplicationHealthStateChunks] + * @member {object} [deployedApplicationHealthStateChunks] The list of deployed + * application health state chunks in the cluster that respect the filters in + * the cluster health chunk query description. * @member {array} [deployedApplicationHealthStateChunks.items] The list of * deployed application health state chunks that respect the input filters in * the chunk query. @@ -708,7 +799,6 @@ export interface EntityHealthStateChunkList { * input filters in the chunk query. Returned by get cluster health state * chunks query. * - * * @member {array} [items] The list of application health state chunks that * respect the input filters in the chunk query. */ @@ -729,9 +819,8 @@ export interface ApplicationHealthStateChunkList extends EntityHealthStateChunkL * One filter can match zero, one or multiple replicas, depending on its * properties. * - * * @member {string} [replicaOrInstanceIdFilter] Id of the stateful service - * replica or stateles service instance that matches the filter. The filter is + * replica or stateless service instance that matches the filter. The filter is * applied only to the specified replica, if it exists. * If the replica doesn't exist, no replica is returned in the cluster health * chunk based on this filter. @@ -746,10 +835,10 @@ export interface ApplicationHealthStateChunkList extends EntityHealthStateChunkL * The possible values are integer value of one of the following health states. * Only replicas that match the filter are returned. All replicas are used to * evaluate the parent partition aggregated health state. - * If not specified, default value is None, unless the replica id is specified. - * If the filter has default value and replica id is specified, the matching + * If not specified, default value is None, unless the replica ID is specified. + * If the filter has default value and replica ID is specified, the matching * replica is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches replicas with * HealthState value of OK (2) and Warning (4). @@ -763,8 +852,7 @@ export interface ApplicationHealthStateChunkList extends EntityHealthStateChunkL * - Error - Filter that matches input with HealthState value Error. The value * is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . */ export interface ReplicaHealthStateFilter { replicaOrInstanceIdFilter?: string; @@ -783,7 +871,6 @@ export interface ReplicaHealthStateFilter { * One filter can match zero, one or multiple partitions, depending on its * properties. * - * * @member {uuid} [partitionIdFilter] ID of the partition that matches the * filter. The filter is applied only to the specified partition, if it exists. * If the partition doesn't exist, no partition is returned in the cluster @@ -799,10 +886,10 @@ export interface ReplicaHealthStateFilter { * The possible values are integer value of one of the following health states. * Only partitions that match the filter are returned. All partitions are used * to evaluate the cluster aggregated health state. - * If not specified, default value is None, unless the partition id is - * specified. If the filter has default value and partition id is specified, + * If not specified, default value is None, unless the partition ID is + * specified. If the filter has default value and partition ID is specified, * the matching partition is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches partitions with * HealthState value of OK (2) and Warning (4). @@ -816,8 +903,7 @@ export interface ReplicaHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The value * is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [replicaFilters] Defines a list of filters that specify * which replicas to be included in the returned cluster health chunk as * children of the parent partition. The replicas are returned only if the @@ -847,7 +933,6 @@ export interface PartitionHealthStateFilter { * One filter can match zero, one or multiple services, depending on its * properties. * - * * @member {string} [serviceNameFilter] The name of the service that matches * the filter. The filter is applied only to the specified service, if it * exists. @@ -867,7 +952,7 @@ export interface PartitionHealthStateFilter { * If not specified, default value is None, unless the service name is * specified. If the filter has default value and service name is specified, * the matching service is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches services with * HealthState value of OK (2) and Warning (4). @@ -881,8 +966,7 @@ export interface PartitionHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The value * is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [partitionFilters] Defines a list of filters that specify * which partitions to be included in the returned cluster health chunk as * children of the service. The partitions are returned only if the parent @@ -893,7 +977,7 @@ export interface PartitionHealthStateFilter { * The service filter may specify multiple partition filters. * For example, it can specify a filter to return all partitions with health * state Error and another filter to always include a partition identified by - * its partition id. + * its partition ID. */ export interface ServiceHealthStateFilter { serviceNameFilter?: string; @@ -915,7 +999,6 @@ export interface ServiceHealthStateFilter { * One filter can match zero, one or multiple deployed service packages, * depending on its properties. * - * * @member {string} [serviceManifestNameFilter] The name of the service * manifest which identifies the deployed service packages that matches the * filter. @@ -942,9 +1025,9 @@ export interface ServiceHealthStateFilter { * deployed service packages are used to evaluate the parent deployed * application aggregated health state. * If not specified, default value is None, unless the deployed service package - * id is specified. If the filter has default value and deployed service - * package id is specified, the matching deployed service package is returned. - * The state values are flag based enumeration, so the value could be a + * ID is specified. If the filter has default value and deployed service + * package ID is specified, the matching deployed service package is returned. + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches deployed service * packages with HealthState value of OK (2) and Warning (4). @@ -958,8 +1041,7 @@ export interface ServiceHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The value * is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . */ export interface DeployedServicePackageHealthStateFilter { serviceManifestNameFilter?: string; @@ -978,7 +1060,6 @@ export interface DeployedServicePackageHealthStateFilter { * One filter can match zero, one or multiple deployed applications, depending * on its properties. * - * * @member {string} [nodeNameFilter] The name of the node where the application * is deployed in order to match the filter. * If specified, the filter is applied only to the application deployed on the @@ -1000,7 +1081,7 @@ export interface DeployedServicePackageHealthStateFilter { * If not specified, default value is None, unless the node name is specified. * If the filter has default value and node name is specified, the matching * deployed application is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches deployed applications * with HealthState value of OK (2) and Warning (4). @@ -1014,8 +1095,7 @@ export interface DeployedServicePackageHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The value * is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [deployedServicePackageFilters] Defines a list of filters * that specify which deployed service packages to be included in the returned * cluster health chunk as children of the parent deployed application. The @@ -1045,7 +1125,6 @@ export interface DeployedApplicationHealthStateFilter { * One filter can match zero, one or multiple applications, depending on its * properties. * - * * @member {string} [applicationNameFilter] The name of the application that * matches the filter, as a fabric uri. The filter is applied only to the * specified application, if it exists. @@ -1074,7 +1153,7 @@ export interface DeployedApplicationHealthStateFilter { * If not specified, default value is None, unless the application name or the * application type name are specified. If the filter has default value and * application name is specified, the matching application is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches applications with * HealthState value of OK (2) and Warning (4). @@ -1088,8 +1167,7 @@ export interface DeployedApplicationHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The value * is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [serviceFilters] Defines a list of filters that specify * which services to be included in the returned cluster health chunk as * children of the application. The services are returned only if the parent @@ -1142,17 +1220,29 @@ export interface ApplicationParameter { * @constructor * Information about a Service Fabric application. * - * @member {string} [id] - * @member {string} [name] - * @member {string} [typeName] - * @member {string} [typeVersion] - * @member {string} [status] Possible values include: 'Invalid', 'Ready', - * 'Upgrading', 'Creating', 'Deleting', 'Failed' - * @member {array} [parameters] - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [applicationDefinitionKind] Possible values include: - * 'Invalid', 'ServiceFabricApplicationDescription', 'Compose' + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * @member {string} [name] The name of the application, including the 'fabric:' + * URI scheme. + * @member {string} [typeName] The application type name as defined in the + * application manifest. + * @member {string} [typeVersion] The version of the application type as + * defined in the application manifest. + * @member {string} [status] The status of the application. Possible values + * include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {array} [parameters] List of application parameters with overridden + * values from their default values specified in the application manifest. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [applicationDefinitionKind] The mechanism used to define a + * Service Fabric application. Possible values include: 'Invalid', + * 'ServiceFabricApplicationDescription', 'Compose' */ export interface ApplicationInfo { id?: string; @@ -1173,7 +1263,6 @@ export interface ApplicationInfo { * can be used to limit the total consumption of this metric by the services of * this application. * - * * @member {string} [name] The name of the metric. * @member {number} [maximumCapacity] The maximum node capacity for Service * Fabric application. @@ -1219,7 +1308,13 @@ export interface ApplicationMetricDescription { * @constructor * Load Information about a Service Fabric application. * - * @member {string} [id] + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in + * previous versions. * @member {number} [minimumNodes] The minimum number of nodes for this * application. * It is the number of nodes where Service Fabric will reserve Capacity in the @@ -1236,7 +1331,8 @@ export interface ApplicationMetricDescription { * is instantiated. * For applications that do not have application capacity defined this value * will be zero. - * @member {array} [applicationLoadMetricInformation] + * @member {array} [applicationLoadMetricInformation] List of application + * capacity metric description. */ export interface ApplicationLoadInfo { id?: string; @@ -1252,8 +1348,15 @@ export interface ApplicationLoadInfo { * @constructor * Information about the application name. * - * @member {string} [id] - * @member {string} [name] + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * @member {string} [name] The name of the application, including the 'fabric:' + * URI scheme. */ export interface ApplicationNameInfo { id?: string; @@ -1272,7 +1375,9 @@ export interface ApplicationNameInfo { * percentage of unhealthy applications from the ClusterHealthPolicy. * @member {number} [totalCount] Total number of applications from the health * store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ApplicationHealthEvaluation that impacted the aggregated health. */ export interface ApplicationsHealthEvaluation extends HealthEvaluation { maxPercentUnhealthyApplications?: number; @@ -1291,13 +1396,17 @@ export interface ApplicationsHealthEvaluation extends HealthEvaluation { * application of the included application type that impacted current * aggregated health state. * - * @member {string} [applicationTypeName] + * @member {string} [applicationTypeName] The application type name as defined + * in the application manifest. * @member {number} [maxPercentUnhealthyApplications] Maximum allowed * percentage of unhealthy applications for the application type, specified as * an entry in ApplicationTypeHealthPolicyMap. * @member {number} [totalCount] Total number of applications of the * application type found in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ApplicationHealthEvaluation of this application type that impacted the + * aggregated health. */ export interface ApplicationTypeApplicationsHealthEvaluation extends HealthEvaluation { applicationTypeName?: string; @@ -1312,7 +1421,6 @@ export interface ApplicationTypeApplicationsHealthEvaluation extends HealthEvalu * @constructor * Defines an item in ApplicationTypeHealthPolicyMap. * - * * @member {string} key The key of the application type health policy map item. * This is the name of the application type. * @member {number} value The value of the application type health policy map @@ -1331,13 +1439,19 @@ export interface ApplicationTypeHealthPolicyMapItem { * @constructor * Information about an application type. * - * @member {string} [name] - * @member {string} [version] - * @member {array} [defaultParameterList] - * @member {string} [status] Possible values include: 'Invalid', - * 'Provisioning', 'Available', 'Unprovisioning', 'Failed' - * @member {string} [statusDetails] - * @member {string} [applicationTypeDefinitionKind] Possible values include: + * @member {string} [name] The application type name as defined in the + * application manifest. + * @member {string} [version] The version of the application type as defined in + * the application manifest. + * @member {array} [defaultParameterList] List of application type parameters + * that can be overridden when creating or updating the application. + * @member {string} [status] The status of the application type. Possible + * values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', + * 'Failed' + * @member {string} [statusDetails] Additional detailed information about the + * status of the application type. + * @member {string} [applicationTypeDefinitionKind] The mechanism used to + * define a Service Fabric application type. Possible values include: * 'Invalid', 'ServiceFabricApplicationPackage', 'Compose' */ export interface ApplicationTypeInfo { @@ -1358,8 +1472,13 @@ export interface ApplicationTypeInfo { * single message. The next set of results can be obtained by executing the * same query with the continuation token provided in this list. * - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of application type information. */ export interface PagedApplicationTypeInfoList { continuationToken?: string; @@ -1385,13 +1504,37 @@ export interface ApplicationTypeManifest { * @constructor * Describes the parameters for monitoring an upgrade in Monitored mode. * - * @member {string} [failureAction] Possible values include: 'Invalid', - * 'Rollback', 'Manual' - * @member {string} [healthCheckWaitDurationInMilliseconds] - * @member {string} [healthCheckStableDurationInMilliseconds] - * @member {string} [healthCheckRetryTimeoutInMilliseconds] - * @member {string} [upgradeTimeoutInMilliseconds] - * @member {string} [upgradeDomainTimeoutInMilliseconds] + * @member {string} [failureAction] The compensating action to perform when a + * Monitored upgrade encounters monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * @member {string} [healthCheckWaitDurationInMilliseconds] 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} [healthCheckStableDurationInMilliseconds] 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} [healthCheckRetryTimeoutInMilliseconds] 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} [upgradeTimeoutInMilliseconds] 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} [upgradeDomainTimeoutInMilliseconds] 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 MonitoringPolicyDescription { failureAction?: string; @@ -1406,35 +1549,76 @@ export interface MonitoringPolicyDescription { * @class * Initializes a new instance of the ApplicationUpgradeDescription class. * @constructor - * Describes the parameters for an application upgrade. Please note that - * upgrade description replaces the existing application description. This - * means that if the parameters are not specified, the existing parameters on - * the applications will be overwritten with the empty parameters list. This - * would results in application using the default value of the parameters from - * the application manifest. If you do not want to change any existing - * parameter values, please get the application parameters first using the + * Describes the parameters for an application upgrade. Note that upgrade + * description replaces the existing application description. This means that + * if the parameters are not specified, the existing parameters on the + * applications will be overwritten with the empty parameters list. This would + * result in the application using the default value of the parameters from the + * application manifest. If you do not want to change any existing parameter + * values, please get the application parameters first using the * GetApplicationInfo query and then supply those values as Parameters in this * ApplicationUpgradeDescription. * - * @member {string} name - * @member {string} targetApplicationTypeVersion - * @member {array} parameters - * @member {string} upgradeKind Possible values include: 'Invalid', 'Rolling'. - * Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {string} name The name of the target application, including the + * 'fabric:' URI scheme. + * @member {string} targetApplicationTypeVersion The target application type + * version (found in the application manifest) for the application upgrade. + * @member {array} parameters List of application parameters with overridden + * values from their default values specified in the application manifest. + * @member {string} upgradeKind The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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} [monitoringPolicy] Describes the parameters for monitoring + * an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action to + * perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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 {boolean} [applicationHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} @@ -1450,6 +1634,7 @@ export interface MonitoringPolicyDescription { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed @@ -1490,7 +1675,9 @@ export interface MonitoringPolicyDescription { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. */ export interface ApplicationUpgradeDescription { name: string; @@ -1510,9 +1697,9 @@ export interface ApplicationUpgradeDescription { * @constructor * Information about an upgrade domain. * - * @member {string} [name] - * @member {string} [state] Possible values include: 'Invalid', 'Pending', - * 'InProgress', 'Completed' + * @member {string} [name] The name of the upgrade domain + * @member {string} [state] The state of the upgrade domain. Possible values + * include: 'Invalid', 'Pending', 'InProgress', 'Completed' */ export interface UpgradeDomainInfo { name?: string; @@ -1541,7 +1728,9 @@ export interface SafetyCheck { * service fabric before continuing with the operations. These checks ensure * the availability of the service and the reliability of the state. * - * @member {object} [safetyCheck] + * @member {object} [safetyCheck] Represents a safety check performed by + * service fabric before continuing with the operations. These checks ensure + * the availability of the service and the reliability of the state. * @member {string} [safetyCheck.kind] Polymorphic Discriminator */ export interface SafetyCheckWrapper { @@ -1554,10 +1743,11 @@ export interface SafetyCheckWrapper { * @constructor * Information about the upgrading node and its status * - * @member {string} [nodeName] - * @member {string} [upgradePhase] Possible values include: 'Invalid', - * 'PreUpgradeSafetyCheck', 'Upgrading', 'PostUpgradeSafetyCheck' - * @member {array} [pendingSafetyChecks] + * @member {string} [nodeName] The name of a Service Fabric node. + * @member {string} [upgradePhase] The state of the upgrading node. Possible + * values include: 'Invalid', 'PreUpgradeSafetyCheck', 'Upgrading', + * 'PostUpgradeSafetyCheck' + * @member {array} [pendingSafetyChecks] List of pending safety checks */ export interface NodeUpgradeProgressInfo { nodeName?: string; @@ -1571,8 +1761,9 @@ export interface NodeUpgradeProgressInfo { * @constructor * Information about the current in-progress upgrade domain. * - * @member {string} [domainName] - * @member {array} [nodeUpgradeProgressList] + * @member {string} [domainName] The name of the upgrade domain + * @member {array} [nodeUpgradeProgressList] List of upgrading nodes and their + * statuses */ export interface CurrentUpgradeDomainProgressInfo { domainName?: string; @@ -1586,8 +1777,9 @@ export interface CurrentUpgradeDomainProgressInfo { * Information about the upgrade domain progress at the time of upgrade * failure. * - * @member {string} [domainName] - * @member {array} [nodeUpgradeProgressList] + * @member {string} [domainName] The name of the upgrade domain + * @member {array} [nodeUpgradeProgressList] List of upgrading nodes and their + * statuses */ export interface FailureUpgradeDomainProgressInfo { domainName?: string; @@ -1600,41 +1792,100 @@ export interface FailureUpgradeDomainProgressInfo { * @constructor * Describes the parameters for an application upgrade. * - * @member {string} [name] - * @member {string} [typeName] - * @member {string} [targetApplicationTypeVersion] - * @member {array} [upgradeDomains] - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', - * 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed' - * @member {string} [nextUpgradeDomain] - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {object} [upgradeDescription] - * @member {string} [upgradeDescription.name] - * @member {string} [upgradeDescription.targetApplicationTypeVersion] - * @member {array} [upgradeDescription.parameters] - * @member {string} [upgradeDescription.upgradeKind] Possible values include: - * 'Invalid', 'Rolling' - * @member {string} [upgradeDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {string} [name] The name of the target application, including the + * 'fabric:' URI scheme. + * @member {string} [typeName] The application type name as defined in the + * application manifest. + * @member {string} [targetApplicationTypeVersion] The target application type + * version (found in the application manifest) for the application upgrade. + * @member {array} [upgradeDomains] List of upgrade domains and their statuses. + * @member {string} [upgradeState] The state of the upgrade domain. Possible + * values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', + * 'RollingForwardPending', 'RollingForwardInProgress', + * 'RollingForwardCompleted', 'Failed' + * @member {string} [nextUpgradeDomain] The name of the next upgrade domain to + * be processed. + * @member {string} [rollingUpgradeMode] The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @member {object} [upgradeDescription] Describes the parameters for an + * application upgrade. Note that upgrade description replaces the existing + * application description. This means that if the parameters are not + * specified, the existing parameters on the applications will be overwritten + * with the empty parameters list. This would result in the application using + * the default value of the parameters from the application manifest. If you do + * not want to change any existing parameter values, please get the application + * parameters first using the GetApplicationInfo query and then supply those + * values as Parameters in this ApplicationUpgradeDescription. + * @member {string} [upgradeDescription.name] The name of the target + * application, including the 'fabric:' URI scheme. + * @member {string} [upgradeDescription.targetApplicationTypeVersion] The + * target application type version (found in the application manifest) for the + * application upgrade. + * @member {array} [upgradeDescription.parameters] List of application + * parameters with overridden values from their default values specified in the + * application manifest. + * @member {string} [upgradeDescription.upgradeKind] The kind of upgrade out of + * the following possible values. Possible values include: 'Invalid', 'Rolling' + * @member {string} [upgradeDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * @member {number} [upgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [upgradeDescription.forceRestart] - * @member {object} [upgradeDescription.monitoringPolicy] - * @member {string} [upgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * 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} [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 {object} [upgradeDescription.monitoringPolicy] Describes the + * parameters for monitoring an upgrade in Monitored mode. + * @member {string} [upgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} * [upgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} - * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] 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} - * [upgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [upgradeDescription.applicationHealthPolicy] + * [upgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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} [upgradeDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * @member {boolean} * [upgradeDescription.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. @@ -1652,6 +1903,7 @@ export interface FailureUpgradeDomainProgressInfo { * Default percentage is zero. * @member {object} * [upgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * @member {number} * [upgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed @@ -1693,24 +1945,35 @@ export interface FailureUpgradeDomainProgressInfo { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * @member {array} - * [upgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * [upgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] The + * map with service type health policy per service type name. The map is empty + * by default. * @member {string} [upgradeDurationInMilliseconds] The estimated total amount * of time spent processing the overall upgrade. * @member {string} [upgradeDomainDurationInMilliseconds] The estimated total * amount of time spent processing the current upgrade domain. - * @member {array} [unhealthyEvaluations] - * @member {object} [currentUpgradeDomainProgress] - * @member {string} [currentUpgradeDomainProgress.domainName] - * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] + * @member {array} [unhealthyEvaluations] List of health evaluations that + * resulted in the current aggregated health state. + * @member {object} [currentUpgradeDomainProgress] Information about the + * current in-progress upgrade domain. + * @member {string} [currentUpgradeDomainProgress.domainName] The name of the + * upgrade domain + * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] List + * of upgrading nodes and their statuses * @member {string} [startTimestampUtc] The estimated UTC datetime when the * upgrade started. * @member {string} [failureTimestampUtc] The estimated UTC datetime when the * upgrade failed and FailureAction was executed. - * @member {string} [failureReason] Possible values include: 'None', - * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'UpgradeTimeout' - * @member {object} [upgradeDomainProgressAtFailure] - * @member {string} [upgradeDomainProgressAtFailure.domainName] + * @member {string} [failureReason] The cause of an upgrade failure that + * resulted in FailureAction being executed. Possible values include: 'None', + * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', + * 'OverallUpgradeTimeout' + * @member {object} [upgradeDomainProgressAtFailure] Information about the + * upgrade domain progress at the time of upgrade failure. + * @member {string} [upgradeDomainProgressAtFailure.domainName] The name of the + * upgrade domain * @member {array} [upgradeDomainProgressAtFailure.nodeUpgradeProgressList] + * List of upgrading nodes and their statuses * @member {string} [upgradeStatusDetails] Additional detailed information * about the status of the pending upgrade. */ @@ -1747,6 +2010,16 @@ export interface ClusterConfiguration { clusterConfiguration?: string; } +/** + * @class + * Initializes a new instance of the ClusterEvent class. + * @constructor + * Represents the base for all Cluster Events. + * + */ +export interface ClusterEvent extends FabricEvent { +} + /** * @class * Initializes a new instance of the NodeId class. @@ -1767,8 +2040,9 @@ export interface NodeId { * Represents the health state of a node, which contains the node identifier * and its aggregated health state. * - * @member {string} [name] - * @member {object} [id] + * @member {string} [name] The name of a Service Fabric node. + * @member {object} [id] An internal ID used by Service Fabric to uniquely + * identify a node. Node Id is deterministically generated from node name. * @member {string} [id.id] Value of the node Id. This is a 128 bit integer. */ export interface NodeHealthState extends EntityHealthState { @@ -1785,7 +2059,6 @@ export interface NodeHealthState extends EntityHealthState { * node health states as well as the health events and the unhealthy * evaluations. * - * * @member {array} [nodeHealthStates] Cluster node health states as found in * the health store. * @member {array} [applicationHealthStates] Cluster application health states @@ -1803,8 +2076,7 @@ export interface ClusterHealth extends EntityHealth { * Represents the health state chunk of a node, which contains the node name * and its aggregated health state. * - * - * @member {string} [nodeName] + * @member {string} [nodeName] The name of a Service Fabric node. */ export interface NodeHealthStateChunk extends EntityHealthStateChunk { nodeName?: string; @@ -1818,7 +2090,6 @@ export interface NodeHealthStateChunk extends EntityHealthStateChunk { * filters in the chunk query. Returned by get cluster health state chunks * query. * - * * @member {array} [items] The list of node health state chunks that respect * the input filters in the chunk query. */ @@ -1834,13 +2105,21 @@ export interface NodeHealthStateChunkList extends EntityHealthStateChunkList { * Contains the cluster aggregated health state, and the cluster entities that * respect the input filter. * - * - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', + * @member {string} [healthState] The HealthState representing the aggregated + * health state of the cluster computed by Health Manager. + * The health evaluation of the entity reflects all events reported on the + * entity and its children (if any). + * The aggregation is done by applying the desired cluster health policy and + * the application health policies. Possible values include: 'Invalid', 'Ok', * 'Warning', 'Error', 'Unknown' - * @member {object} [nodeHealthStateChunks] + * @member {object} [nodeHealthStateChunks] The list of node health state + * chunks in the cluster that respect the filters in the cluster health chunk + * query description. * @member {array} [nodeHealthStateChunks.items] The list of node health state * chunks that respect the input filters in the chunk query. - * @member {object} [applicationHealthStateChunks] + * @member {object} [applicationHealthStateChunks] The list of application + * health state chunks in the cluster that respect the filters in the cluster + * health chunk query description. * @member {array} [applicationHealthStateChunks.items] The list of application * health state chunks that respect the input filters in the chunk query. */ @@ -1860,7 +2139,6 @@ export interface ClusterHealthChunk { * properties. * Can be specified in the cluster health chunk query description. * - * * @member {string} [nodeNameFilter] Name of the node that matches the filter. * The filter is applied only to the specified node, if it exists. * If the node doesn't exist, no node is returned in the cluster health chunk @@ -1878,7 +2156,7 @@ export interface ClusterHealthChunk { * If not specified, default value is None, unless the node name is specified. * If the filter has default value and node name is specified, the matching * node is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches nodes with HealthState * value of OK (2) and Warning (4). @@ -1892,8 +2170,7 @@ export interface ClusterHealthChunk { * - Error - Filter that matches input with HealthState value Error. The value * is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . */ export interface NodeHealthStateFilter { nodeNameFilter?: string; @@ -1907,7 +2184,6 @@ export interface NodeHealthStateFilter { * Defines a health policy used to evaluate the health of the cluster or of a * cluster node. * - * * @member {boolean} [considerWarningAsError] Indicates whether warnings are * treated with the same severity as errors. Default value: false . * @member {number} [maxPercentUnhealthyNodes] The maximum allowed percentage @@ -1924,8 +2200,7 @@ export interface NodeHealthStateFilter { * 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 . + * 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. @@ -1939,9 +2214,29 @@ export interface NodeHealthStateFilter { * 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 {array} [applicationTypeHealthPolicyMap] + * applications. Default percentage is zero. Default value: 0 . + * @member {array} [applicationTypeHealthPolicyMap] Defines a map with max + * percentage unhealthy applications for specific application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. */ export interface ClusterHealthPolicy { considerWarningAsError?: boolean; @@ -1976,7 +2271,8 @@ export interface ClusterHealthPolicy { * For example, it can specify a filter to return all applications with health * state Error and another filter to always include applications of a specified * application type. - * @member {object} [clusterHealthPolicy] + * @member {object} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The maximum @@ -2009,9 +2305,35 @@ export interface ClusterHealthPolicy { * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. - * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [applicationHealthPolicies] - * @member {array} [applicationHealthPolicies.applicationHealthPolicyMap] + * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [applicationHealthPolicies] Defines the application health + * policy map used to evaluate the health of an application or one of its + * children entities. + * @member {array} [applicationHealthPolicies.applicationHealthPolicyMap] The + * wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ export interface ClusterHealthChunkQueryDescription { nodeFilters?: NodeHealthStateFilter[]; @@ -2026,8 +2348,17 @@ export interface ClusterHealthChunkQueryDescription { * @constructor * Health policies to evaluate cluster health. * - * @member {array} [applicationHealthPolicyMap] - * @member {object} [clusterHealthPolicy] + * @member {array} [applicationHealthPolicyMap] Defines a map that contains + * specific application health policies for different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * @member {object} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The maximum @@ -2060,7 +2391,29 @@ export interface ClusterHealthChunkQueryDescription { * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. - * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] + * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. */ export interface ClusterHealthPolicies { applicationHealthPolicyMap?: ApplicationHealthPolicyMapItem[]; @@ -2079,6 +2432,72 @@ export interface ClusterManifest { manifest?: string; } +/** + * @class + * Initializes a new instance of the ContainerApiRequestBody class. + * @constructor + * parameters for making container API call. + * + * @member {string} [httpVerb] HTTP verb of container REST API, defaults to + * "GET" + * @member {string} uriPath URI path of container REST API + * @member {string} [contentType] Content type of container REST API request, + * defaults to "application/json" + * @member {string} [body] HTTP request body of container REST API + */ +export interface ContainerApiRequestBody { + httpVerb?: string; + uriPath: string; + contentType?: string; + body?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerApiResult class. + * @constructor + * Container API result. + * + * @member {number} status HTTP status code returned by the target container + * API + * @member {string} [contentType] HTTP content type + * @member {string} [contentEncoding] HTTP content encoding + * @member {string} [body] container API result body + */ +export interface ContainerApiResult { + status: number; + contentType?: string; + contentEncoding?: string; + body?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerApiResponse class. + * @constructor + * Response body that wraps container API result. + * + * @member {object} containerApiResult Container API result. + * @member {number} [containerApiResult.status] HTTP status code returned by + * the target container API + * @member {string} [containerApiResult.contentType] HTTP content type + * @member {string} [containerApiResult.contentEncoding] HTTP content encoding + * @member {string} [containerApiResult.body] container API result body + */ +export interface ContainerApiResponse { + containerApiResult: ContainerApiResult; +} + +/** + * @class + * Initializes a new instance of the ContainerInstanceEvent class. + * @constructor + * Represents the base for all Container Events. + * + */ +export interface ContainerInstanceEvent extends FabricEvent { +} + /** * @class * Initializes a new instance of the DeactivationIntentDescription class. @@ -2086,13 +2505,8 @@ export interface ClusterManifest { * Describes the intent or reason for deactivating the node. * * @member {string} [deactivationIntent] Describes the intent or reason for - * deactivating the node. The possible values are following. - * - Pause - Indicates that the node should be paused. The value is 1. - * - Restart - Indicates that the intent is for the node to be restarted after - * a short period of time. The value is 2. - * - RemoveData - Indicates the intent is for the node to remove data. The - * value is 3. - * . Possible values include: 'Pause', 'Restart', 'RemoveData' + * deactivating the node. The possible values are following. Possible values + * include: 'Pause', 'Restart', 'RemoveData' */ export interface DeactivationIntentDescription { deactivationIntent?: string; @@ -2107,7 +2521,6 @@ export interface DeactivationIntentDescription { * Can be returned during cluster upgrade when the aggregated health state of * the cluster is Warning or Error. * - * * @member {number} [baselineErrorCount] Number of nodes with aggregated heath * state Error in the health store at the beginning of the cluster upgrade. * @member {number} [baselineTotalCount] Total number of nodes in the health @@ -2115,7 +2528,10 @@ export interface DeactivationIntentDescription { * @member {number} [maxPercentDeltaUnhealthyNodes] Maximum allowed percentage * of delta unhealthy nodes from the ClusterUpgradeHealthPolicy. * @member {number} [totalCount] Total number of nodes in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. + * Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated + * health. */ export interface DeltaNodesCheckHealthEvaluation extends HealthEvaluation { baselineErrorCount?: number; @@ -2132,10 +2548,18 @@ export interface DeltaNodesCheckHealthEvaluation extends HealthEvaluation { * Represents the health state of a deployed service package, containing the * entity identifier and the aggregated health state. * - * @member {string} [nodeName] - * @member {string} [applicationName] - * @member {string} [serviceManifestName] - * @member {string} [servicePackageActivationId] + * @member {string} [nodeName] Name of the node on which the service package is + * deployed. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [serviceManifestName] Name of the manifest describing the + * service package. + * @member {string} [servicePackageActivationId] The ActivationId of a deployed + * service package. If ServicePackageActivationMode specified at the time of + * creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ export interface DeployedServicePackageHealthState extends EntityHealthState { nodeName?: string; @@ -2151,9 +2575,13 @@ export interface DeployedServicePackageHealthState extends EntityHealthState { * Information about the health of an application deployed on a Service Fabric * node. * - * @member {string} [name] - * @member {string} [nodeName] - * @member {array} [deployedServicePackageHealthStates] + * @member {string} [name] Name of the application deployed on the node whose + * health information is described by this object. + * @member {string} [nodeName] Name of the node where this application is + * deployed. + * @member {array} [deployedServicePackageHealthStates] Deployed service + * package health states for the current deployed application as found in the + * health store. */ export interface DeployedApplicationHealth extends EntityHealth { name?: string; @@ -2169,10 +2597,14 @@ export interface DeployedApplicationHealth extends EntityHealth { * information about the data and the algorithm used by the health store to * evaluate health. * - * - * @member {string} [nodeName] - * @member {string} [applicationName] - * @member {array} [unhealthyEvaluations] + * @member {string} [nodeName] Name of the node where the application is + * deployed to. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the deployed application. + * The types of the unhealthy evaluations can be + * DeployedServicePackagesHealthEvaluation or EventHealthEvaluation. */ export interface DeployedApplicationHealthEvaluation extends HealthEvaluation { nodeName?: string; @@ -2186,11 +2618,20 @@ export interface DeployedApplicationHealthEvaluation extends HealthEvaluation { * @constructor * Information about application deployed on the node. * - * @member {string} [id] - * @member {string} [name] - * @member {string} [typeName] - * @member {string} [status] Possible values include: 'Invalid', 'Downloading', - * 'Activating', 'Active', 'Upgrading', 'Deactivating' + * @member {string} [id] The identity of the application. This is an encoded + * representation of the application name. This is used in the REST APIs to + * identify the application resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the application name is "fabric:/myapp/app1", + * the application identity would be "myapp\~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * @member {string} [name] The name of the application, including the 'fabric:' + * URI scheme. + * @member {string} [typeName] The application type name as defined in the + * application manifest. + * @member {string} [status] The status of the application deployed on the + * node. Following are the possible values. Possible values include: 'Invalid', + * 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating' * @member {string} [workDirectory] The work directory of the application on * the node. The work directory can be used to store application data. * @member {string} [logDirectory] The log directory of the application on the @@ -2198,6 +2639,9 @@ export interface DeployedApplicationHealthEvaluation extends HealthEvaluation { * @member {string} [tempDirectory] The temp directory of the application on * the node. The code packages belonging to the application are forked with * this directory set as their temporary directory. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' */ export interface DeployedApplicationInfo { id?: string; @@ -2207,6 +2651,7 @@ export interface DeployedApplicationInfo { workDirectory?: string; logDirectory?: string; tempDirectory?: string; + healthState?: string; } /** @@ -2219,13 +2664,14 @@ export interface DeployedApplicationInfo { * Can be returned when evaluating application health and the aggregated health * state is either Error or Warning. * - * * @member {number} [maxPercentUnhealthyDeployedApplications] Maximum allowed * percentage of unhealthy deployed applications from the * ApplicationHealthPolicy. * @member {number} [totalCount] Total number of deployed applications of the * application in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * DeployedApplicationHealthEvaluation that impacted the aggregated health. */ export interface DeployedApplicationsHealthEvaluation extends HealthEvaluation { maxPercentUnhealthyDeployedApplications?: number; @@ -2240,9 +2686,11 @@ export interface DeployedApplicationsHealthEvaluation extends HealthEvaluation { * Information about the health of a service package for a specific application * deployed on a Service Fabric node. * - * @member {string} [applicationName] - * @member {string} [serviceManifestName] - * @member {string} [nodeName] + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [serviceManifestName] Name of the service manifest. + * @member {string} [nodeName] Name of the node where this service package is + * deployed. */ export interface DeployedServicePackageHealth extends EntityHealth { applicationName?: string; @@ -2259,10 +2707,13 @@ export interface DeployedServicePackageHealth extends EntityHealth { * evaluate health. The evaluation is returned only when the aggregated health * state is either Error or Warning. * - * @member {string} [nodeName] - * @member {string} [applicationName] - * @member {string} [serviceManifestName] - * @member {array} [unhealthyEvaluations] + * @member {string} [nodeName] The name of a Service Fabric node. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [serviceManifestName] The name of the service manifest. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state. The type of the unhealthy + * evaluations can be EventHealthEvaluation. */ export interface DeployedServicePackageHealthEvaluation extends HealthEvaluation { nodeName?: string; @@ -2283,7 +2734,9 @@ export interface DeployedServicePackageHealthEvaluation extends HealthEvaluation * * @member {number} [totalCount] Total number of deployed service packages of * the deployed application in the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * DeployedServicePackageHealthEvaluation that impacted the aggregated health. */ export interface DeployedServicePackagesHealthEvaluation extends HealthEvaluation { totalCount?: number; @@ -2296,19 +2749,33 @@ export interface DeployedServicePackagesHealthEvaluation extends HealthEvaluatio * @constructor * Information about a Service Fabric service replica deployed on a node. * - * @member {string} [serviceName] - * @member {string} [serviceTypeName] - * @member {string} [serviceManifestName] - * @member {string} [codePackageName] - * @member {uuid} [partitionId] - * @member {string} [replicaStatus] Possible values include: 'Invalid', - * 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped' + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {string} [serviceTypeName] Name of the service type as specified in + * the service manifest. + * @member {string} [serviceManifestName] The name of the service manifest in + * which this service type is defined. + * @member {string} [codePackageName] The name of the code package that hosts + * this replica. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for the + * lifetime of the service. If the same service was deleted and recreated the + * IDs of its partitions would be different. + * @member {string} [replicaStatus] The status of a replica of a service. + * Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', + * 'Dropped' * @member {string} [address] The last address returned by the replica in Open * or ChangeRole. - * @member {string} [servicePackageActivationId] - * @member {string} [hostProcessId] Host process id of the process that is + * @member {string} [servicePackageActivationId] The ActivationId of a deployed + * service package. If ServicePackageActivationMode specified at the time of + * creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * @member {string} [hostProcessId] Host process ID of the process that is * hosting the replica. This will be zero if the replica is down. In hyper-v - * containers this host process id will be from different kernel. + * containers this host process ID will be from different kernel. * @member {string} serviceKind Polymorphic Discriminator */ export interface DeployedServiceReplicaInfo { @@ -2331,12 +2798,17 @@ export interface DeployedServiceReplicaInfo { * Information about current reconfiguration like phase, type, previous * configuration role of replica and reconfiguration start date time. * - * @member {string} [previousConfigurationRole] Possible values include: - * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' - * @member {string} [reconfigurationPhase] Possible values include: 'Unknown', - * 'None', 'Phase0', 'Phase1', 'Phase2', 'Phase3', 'Phase4', 'AbortPhaseZero' - * @member {string} [reconfigurationType] Possible values include: 'Unknown', - * 'SwapPrimary', 'Failover', 'Other' + * @member {string} [previousConfigurationRole] Replica role before + * reconfiguration started. Possible values include: 'Unknown', 'None', + * 'Primary', 'IdleSecondary', 'ActiveSecondary' + * @member {string} [reconfigurationPhase] Current phase of ongoing + * reconfiguration. If no reconfiguration is taking place then this value will + * be "None". Possible values include: 'Unknown', 'None', 'Phase0', 'Phase1', + * 'Phase2', 'Phase3', 'Phase4', 'AbortPhaseZero' + * @member {string} [reconfigurationType] Type of current ongoing + * reconfiguration. If no reconfiguration is taking place then this value will + * be "None". Possible values include: 'Unknown', 'SwapPrimary', 'Failover', + * 'Other' * @member {date} [reconfigurationStartTimeUtc] Start time (in UTC) of the * ongoing reconfiguration. If no reconfiguration is taking place then this * value will be zero date-time. @@ -2354,18 +2826,30 @@ export interface ReconfigurationInformation { * @constructor * Information about a stateful service replica deployed on a node. * - * @member {string} [replicaId] - * @member {string} [replicaRole] Possible values include: 'Unknown', 'None', - * 'Primary', 'IdleSecondary', 'ActiveSecondary' - * @member {object} [reconfigurationInformation] - * @member {string} [reconfigurationInformation.previousConfigurationRole] + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId is + * used by Service Fabric to uniquely identify a replica of a partition. It is + * unique within a partition and does not change for the lifetime of the + * replica. If a replica gets dropped and another replica gets created on the + * same node for the same partition, it will get a different value for the id. + * Sometimes the id of a stateless service instance is also referred as a + * replica id. + * @member {string} [replicaRole] The role of a replica of a stateful service. * Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', * 'ActiveSecondary' - * @member {string} [reconfigurationInformation.reconfigurationPhase] Possible - * values include: 'Unknown', 'None', 'Phase0', 'Phase1', 'Phase2', 'Phase3', - * 'Phase4', 'AbortPhaseZero' - * @member {string} [reconfigurationInformation.reconfigurationType] Possible - * values include: 'Unknown', 'SwapPrimary', 'Failover', 'Other' + * @member {object} [reconfigurationInformation] Information about current + * reconfiguration like phase, type, previous configuration role of replica and + * reconfiguration start date time. + * @member {string} [reconfigurationInformation.previousConfigurationRole] + * Replica role before reconfiguration started. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' + * @member {string} [reconfigurationInformation.reconfigurationPhase] Current + * phase of ongoing reconfiguration. If no reconfiguration is taking place then + * this value will be "None". Possible values include: 'Unknown', 'None', + * 'Phase0', 'Phase1', 'Phase2', 'Phase3', 'Phase4', 'AbortPhaseZero' + * @member {string} [reconfigurationInformation.reconfigurationType] Type of + * current ongoing reconfiguration. If no reconfiguration is taking place then + * this value will be "None". Possible values include: 'Unknown', + * 'SwapPrimary', 'Failover', 'Other' * @member {date} [reconfigurationInformation.reconfigurationStartTimeUtc] * Start time (in UTC) of the ongoing reconfiguration. If no reconfiguration is * taking place then this value will be zero date-time. @@ -2382,7 +2866,11 @@ export interface DeployedStatefulServiceReplicaInfo extends DeployedServiceRepli * @constructor * Information about a stateless service instance deployed on a node. * - * @member {string} [instanceId] + * @member {string} [instanceId] Id of a stateless service instance. InstanceId + * is used by Service Fabric to uniquely identify an instance of a partition of + * a stateless service. It is unique within a partition and does not change for + * the lifetime of the instance. If the instance has failed over on the same or + * different node, it will get a different value for the InstanceId. */ export interface DeployedStatelessServiceInstanceInfo extends DeployedServiceReplicaInfo { instanceId?: string; @@ -2396,9 +2884,8 @@ export interface DeployedStatelessServiceInstanceInfo extends DeployedServiceRep * reports sent to health store and in all health events returned by health * queries. * - * - * @member {string} sourceId The source name which identifies the - * client/watchdog/system component which generated the health information. + * @member {string} sourceId The source name that identifies the + * client/watchdog/system component that generated the health information. * @member {string} property The property of the health information. An entity * can have health reports for different properties. * The property is a string and not a fixed enumeration to allow the reporter @@ -2413,11 +2900,12 @@ export interface DeployedStatelessServiceInstanceInfo extends DeployedServiceRep * * Together with the SourceId, the property uniquely identifies the health * information. - * @member {string} healthState Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' + * @member {string} healthState The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' * @member {moment.duration} [timeToLiveInMilliSeconds] The duration for which - * this health report is valid. This field is using ISO8601 format for - * specifying the duration. + * this health report is valid. This field uses ISO8601 format for specifying + * the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. * If clients report on transition, they can set the time to live to infinite. @@ -2445,7 +2933,7 @@ export interface DeployedStatelessServiceInstanceInfo extends DeployedServiceRep * when a report is added. * @member {boolean} [removeWhenExpired] Value that indicates whether the * report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -2472,7 +2960,6 @@ export interface HealthInformation { * Represents health information reported on a health entity, such as cluster, * application or node, with additional metadata added by the Health Manager. * - * * @member {boolean} [isExpired] Returns true if the health event is expired, * otherwise false. * @member {date} [sourceUtcTimestamp] The date and time when the health report @@ -2531,7 +3018,6 @@ export interface HealthEvent extends HealthInformation { * Represents information about how many health entities are in Ok, Warning and * Error health state. * - * * @member {number} [okCount] The number of health entities with aggregated * health state Ok. * @member {number} [warningCount] The number of health entities with @@ -2551,10 +3037,12 @@ export interface HealthStateCount { * @constructor * Represents health state count for entities of the specified entity kind. * - * @member {string} [entityKind] Possible values include: 'Invalid', 'Node', - * 'Partition', 'Service', 'Application', 'Replica', 'DeployedApplication', + * @member {string} [entityKind] The entity kind for which health states are + * evaluated. Possible values include: 'Invalid', 'Node', 'Partition', + * 'Service', 'Application', 'Replica', 'DeployedApplication', * 'DeployedServicePackage', 'Cluster' - * @member {object} [healthStateCount] + * @member {object} [healthStateCount] The health state count for the entities + * of the specified kind. * @member {number} [healthStateCount.okCount] The number of health entities * with aggregated health state Ok. * @member {number} [healthStateCount.warningCount] The number of health @@ -2580,7 +3068,6 @@ export interface EntityKindHealthStateCount { * applications and deployed service packages. * For partition, the health statistics include health counts for replicas. * - * * @member {array} [healthStateCountList] List of health state counts per * entity kind, which keeps track of how many children of the queried entity * are in Ok, Warning and Error state. @@ -2599,7 +3086,6 @@ export interface HealthStatistics { * replica are said to be a new Epoch from the ones which were sent by the old * Primary replica. * - * * @member {string} [configurationVersion] The current configuration number of * this Epoch. The configuration number is an increasing value that is updated * whenever the configuration of this replica set changes. @@ -2613,6 +3099,29 @@ export interface Epoch { dataLossVersion?: string; } +/** + * @class + * Initializes a new instance of the BackupEpoch class. + * @constructor + * An Epoch is a configuration number for the partition as a whole. When the + * configuration of the replica set changes, for example when the Primary + * replica changes, the operations that are replicated from the new Primary + * replica are said to be a new Epoch from the ones which were sent by the old + * Primary replica. + * + * @member {string} [configurationNumber] The current configuration number of + * this Epoch. The configuration number is an increasing value that is updated + * whenever the configuration of this replica set changes. + * @member {string} [dataLossNumber] The current dataloss number of this Epoch. + * The data loss number property is an increasing value which is updated + * whenever data loss is suspected, as when loss of a quorum of replicas in the + * replica set that includes the Primary replica. + */ +export interface BackupEpoch { + configurationNumber?: string; + dataLossNumber?: string; +} + /** * @class * Initializes a new instance of the EventHealthEvaluation class. @@ -2622,11 +3131,12 @@ export interface Epoch { * The health evaluation is returned when evaluating health of an entity * results in Error or Warning. * - * * @member {boolean} [considerWarningAsError] Indicates whether warnings are * treated with the same severity as errors. The field is specified in the * health policy used to evaluate the entity. - * @member {object} [unhealthyEvent] + * @member {object} [unhealthyEvent] Represents health information reported on + * a health entity, such as cluster, application or node, with additional + * metadata added by the Health Manager. * @member {boolean} [unhealthyEvent.isExpired] Returns true if the health * event is expired, otherwise false. * @member {date} [unhealthyEvent.sourceUtcTimestamp] The date and time when @@ -2705,7 +3215,112 @@ export interface FabricConfigVersionInfo { * @constructor * Error object containing error code and error message. * - * @member {string} code Possible values include: + * @member {string} code Defines the fabric error codes that be returned as + * part of the error object in response to Service Fabric API operations that + * are not successful. Following are the error code values that can be returned + * for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request Entity + * Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: * 'FABRIC_E_INVALID_PARTITION_KEY', 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', * 'FABRIC_E_INVALID_ADDRESS', 'FABRIC_E_APPLICATION_NOT_UPGRADING', * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', @@ -2744,7 +3359,19 @@ export interface FabricConfigVersionInfo { * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', - * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP' + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' * @member {string} [message] Error message. */ export interface FabricErrorError { @@ -2760,9 +3387,113 @@ export interface FabricErrorError { * codes. This type defines the additional information returned from the * Service Fabric API operations that are not successful. * - * - * @member {object} error - * @member {string} [error.code] Possible values include: + * @member {object} error Error object containing error code and error message. + * @member {string} [error.code] Defines the fabric error codes that be + * returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values that + * can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request Entity + * Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: * 'FABRIC_E_INVALID_PARTITION_KEY', 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', * 'FABRIC_E_INVALID_ADDRESS', 'FABRIC_E_APPLICATION_NOT_UPGRADING', * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', @@ -2801,7 +3532,19 @@ export interface FabricErrorError { * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', - * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP' + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' * @member {string} [error.message] Error message. */ export interface FabricError { @@ -2814,9 +3557,10 @@ export interface FabricError { * @constructor * Information about a standalone cluster configuration upgrade status. * - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', - * 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed' + * @member {string} [upgradeState] The state of the upgrade domain. Possible + * values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', + * 'RollingForwardPending', 'RollingForwardInProgress', + * 'RollingForwardCompleted', 'Failed' * @member {number} [progressStatus] The cluster manifest version. * @member {string} [configVersion] The cluster configuration version. * @member {string} [details] The cluster upgrade status details. @@ -2835,7 +3579,11 @@ export interface ClusterConfigurationUpgradeStatusInfo { * Information about the partition identity, partitioning scheme and keys * supported by it. * - * @member {uuid} [id] + * @member {uuid} [id] An internal ID used by Service Fabric to uniquely + * identify a partition. This is a randomly generated GUID when the service was + * created. The partition ID is unique and does not change for the lifetime of + * the service. If the same service was deleted and recreated the IDs of its + * partitions would be different. * @member {string} servicePartitionKind Polymorphic Discriminator */ export interface PartitionInformation { @@ -2880,8 +3628,9 @@ export interface NamedPartitionInformation extends PartitionInformation { * Identity of the task related to deactivation operation on the node. * * @member {string} [id] Value of the task id. - * @member {string} [nodeDeactivationTaskType] Possible values include: - * 'Invalid', 'Infrastructure', 'Repair', 'Client' + * @member {string} [nodeDeactivationTaskType] The type of the task that + * performed the node deactivation. Following are the possible values. Possible + * values include: 'Invalid', 'Infrastructure', 'Repair', 'Client' */ export interface NodeDeactivationTaskId { id?: string; @@ -2894,12 +3643,16 @@ export interface NodeDeactivationTaskId { * @constructor * The task representing the deactivation operation on the node. * - * @member {object} [nodeDeactivationTaskId] + * @member {object} [nodeDeactivationTaskId] Identity of the task related to + * deactivation operation on the node. * @member {string} [nodeDeactivationTaskId.id] Value of the task id. - * @member {string} [nodeDeactivationTaskId.nodeDeactivationTaskType] Possible - * values include: 'Invalid', 'Infrastructure', 'Repair', 'Client' - * @member {string} [nodeDeactivationIntent] Possible values include: - * 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' + * @member {string} [nodeDeactivationTaskId.nodeDeactivationTaskType] The type + * of the task that performed the node deactivation. Following are the possible + * values. Possible values include: 'Invalid', 'Infrastructure', 'Repair', + * 'Client' + * @member {string} [nodeDeactivationIntent] The intent or the reason for + * deactivating the node. Following are the possible values for it. Possible + * values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' */ export interface NodeDeactivationTask { nodeDeactivationTaskId?: NodeDeactivationTaskId; @@ -2913,12 +3666,15 @@ export interface NodeDeactivationTask { * Information about the node deactivation. This information is valid for a * node that is undergoing deactivation or has already been deactivated. * - * @member {string} [nodeDeactivationIntent] Possible values include: - * 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' - * @member {string} [nodeDeactivationStatus] Possible values include: 'None', - * 'SafetyCheckInProgress', 'SafetyCheckComplete', 'Completed' - * @member {array} [nodeDeactivationTask] - * @member {array} [pendingSafetyChecks] + * @member {string} [nodeDeactivationIntent] The intent or the reason for + * deactivating the node. Following are the possible values for it. Possible + * values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' + * @member {string} [nodeDeactivationStatus] The status of node deactivation + * operation. Following are the possible values. Possible values include: + * 'None', 'SafetyCheckInProgress', 'SafetyCheckComplete', 'Completed' + * @member {array} [nodeDeactivationTask] List of tasks representing the + * deactivation operation on the node. + * @member {array} [pendingSafetyChecks] List of pending safety checks */ export interface NodeDeactivationInfo { nodeDeactivationIntent?: string; @@ -2927,13 +3683,26 @@ export interface NodeDeactivationInfo { pendingSafetyChecks?: SafetyCheckWrapper[]; } +/** + * @class + * Initializes a new instance of the NodeEvent class. + * @constructor + * Represents the base for all Node Events. + * + * @member {string} nodeName The name of a Service Fabric node. + */ +export interface NodeEvent extends FabricEvent { + nodeName: string; +} + /** * @class * Initializes a new instance of the NodeHealth class. * @constructor * Information about the health of a Service Fabric node. * - * @member {string} [name] + * @member {string} [name] Name of the node whose health information is + * described by this object. */ export interface NodeHealth extends EntityHealth { name?: string; @@ -2948,8 +3717,10 @@ export interface NodeHealth extends EntityHealth { * evaluation is returned only when the aggregated health state is either Error * or Warning. * - * @member {string} [nodeName] - * @member {array} [unhealthyEvaluations] + * @member {string} [nodeName] The name of a Service Fabric node. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the node. The types of the + * unhealthy evaluations can be EventHealthEvaluation. */ export interface NodeHealthEvaluation extends HealthEvaluation { nodeName?: string; @@ -2962,7 +3733,7 @@ export interface NodeHealthEvaluation extends HealthEvaluation { * @constructor * Information about a node in Service Fabric cluster. * - * @member {string} [name] + * @member {string} [name] The name of a Service Fabric node. * @member {string} [ipAddressOrFQDN] The IP address or fully qualified domain * name of the node. * @member {string} [type] The type of the node. @@ -2970,31 +3741,41 @@ export interface NodeHealthEvaluation extends HealthEvaluation { * the node is running. * @member {string} [configVersion] The version of Service Fabric cluster * manifest that the node is using. - * @member {string} [nodeStatus] Possible values include: 'Invalid', 'Up', - * 'Down', 'Enabling', 'Disabling', 'Disabled', 'Unknown', 'Removed' + * @member {string} [nodeStatus] The status of the node. Possible values + * include: 'Invalid', 'Up', 'Down', 'Enabling', 'Disabling', 'Disabled', + * 'Unknown', 'Removed' * @member {string} [nodeUpTimeInSeconds] Time in seconds since the node has - * been in NodeStatus Up. Value ero indicates that the node is not Up. - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' + * been in NodeStatus Up. Value zero indicates that the node is not Up. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' * @member {boolean} [isSeedNode] Indicates if the node is a seed node or not. * Returns true if the node is a seed node, otherwise false. A quorum of seed * nodes are required for proper operation of Service Fabric cluster. * @member {string} [upgradeDomain] The upgrade domain of the node. * @member {string} [faultDomain] The fault domain of the node. - * @member {object} [id] + * @member {object} [id] An internal ID used by Service Fabric to uniquely + * identify a node. Node Id is deterministically generated from node name. * @member {string} [id.id] Value of the node Id. This is a 128 bit integer. - * @member {string} [instanceId] The id representing the node instance. While - * the Id of the node is deterministically generated from the node name and + * @member {string} [instanceId] The ID representing the node instance. While + * the ID of the node is deterministically generated from the node name and * remains same across restarts, the InstanceId changes every time node * restarts. - * @member {object} [nodeDeactivationInfo] - * @member {string} [nodeDeactivationInfo.nodeDeactivationIntent] Possible - * values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' - * @member {string} [nodeDeactivationInfo.nodeDeactivationStatus] Possible + * @member {object} [nodeDeactivationInfo] Information about the node + * deactivation. This information is valid for a node that is undergoing + * deactivation or has already been deactivated. + * @member {string} [nodeDeactivationInfo.nodeDeactivationIntent] The intent or + * the reason for deactivating the node. Following are the possible values for + * it. Possible values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', + * 'RemoveNode' + * @member {string} [nodeDeactivationInfo.nodeDeactivationStatus] The status of + * node deactivation operation. Following are the possible values. Possible * values include: 'None', 'SafetyCheckInProgress', 'SafetyCheckComplete', * 'Completed' - * @member {array} [nodeDeactivationInfo.nodeDeactivationTask] - * @member {array} [nodeDeactivationInfo.pendingSafetyChecks] + * @member {array} [nodeDeactivationInfo.nodeDeactivationTask] List of tasks + * representing the deactivation operation on the node. + * @member {array} [nodeDeactivationInfo.pendingSafetyChecks] List of pending + * safety checks * @member {boolean} [isStopped] Indicates if the node is stopped by calling * stop node API or not. Returns true if the node is stopped, otherwise false. * @member {string} [nodeDownTimeInSeconds] Time in seconds since the node has @@ -3062,7 +3843,8 @@ export interface NodeLoadMetricInformation { * Information about load on a Service Fabric node. It holds a summary of all * metrics and their load on a node. * - * @member {string} [nodeName] + * @member {string} [nodeName] Name of the node for which the load information + * is provided by this object. * @member {array} [nodeLoadMetricInformation] List that contains metrics and * their load information on this node. */ @@ -3084,7 +3866,9 @@ export interface NodeLoadInfo { * unhealthy nodes from the ClusterHealthPolicy. * @member {number} [totalCount] Total number of nodes found in the health * store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * NodeHealthEvaluation that impacted the aggregated health. */ export interface NodesHealthEvaluation extends HealthEvaluation { maxPercentUnhealthyNodes?: number; @@ -3101,14 +3885,42 @@ export interface NodesHealthEvaluation extends HealthEvaluation { * obtained by executing the same query with the continuation token provided in * this list. * - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of application information. */ export interface PagedApplicationInfoList { continuationToken?: string; items?: ApplicationInfo[]; } +/** + * @class + * Initializes a new instance of the PagedDeployedApplicationInfoList class. + * @constructor + * The list of deployed applications in activating, downloading, or active + * states on a node. + * The list is paged when all of the results cannot fit in a single message. + * The next set of results can be obtained by executing the same query with the + * continuation token provided in this list. + * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of deployed application information. + */ +export interface PagedDeployedApplicationInfoList { + continuationToken?: string; + items?: DeployedApplicationInfo[]; +} + /** * @class * Initializes a new instance of the PagedNodeInfoList class. @@ -3117,8 +3929,13 @@ export interface PagedApplicationInfoList { * cannot fit in a single message. The next set of results can be obtained by * executing the same query with the continuation token provided in this list. * - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of node information. */ export interface PagedNodeInfoList { continuationToken?: string; @@ -3131,12 +3948,19 @@ export interface PagedNodeInfoList { * @constructor * Information about a partition of a Service Fabric service. * - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [partitionStatus] Possible values include: 'Invalid', - * 'Ready', 'NotReady', 'InQuorumLoss', 'Reconfiguring', 'Deleting' - * @member {object} [partitionInformation] - * @member {uuid} [partitionInformation.id] + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [partitionStatus] The status of the service fabric service + * partition. Possible values include: 'Invalid', 'Ready', 'NotReady', + * 'InQuorumLoss', 'Reconfiguring', 'Deleting' + * @member {object} [partitionInformation] Information about the partition + * identity, partitioning scheme and keys supported by it. + * @member {uuid} [partitionInformation.id] An internal ID used by Service + * Fabric to uniquely identify a partition. This is a randomly generated GUID + * when the service was created. The partition ID is unique and does not change + * for the lifetime of the service. If the same service was deleted and + * recreated the IDs of its partitions would be different. * @member {string} [partitionInformation.servicePartitionKind] Polymorphic * Discriminator * @member {string} serviceKind Polymorphic Discriminator @@ -3157,8 +3981,13 @@ export interface ServicePartitionInfo { * can be obtained by executing the same query with the continuation token * provided in this list. * - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service partition information. */ export interface PagedServicePartitionInfoList { continuationToken?: string; @@ -3172,11 +4001,13 @@ export interface PagedServicePartitionInfoList { * Information about the identity, status, health, node name, uptime, and other * details about the replica. * - * @member {string} [replicaStatus] Possible values include: 'Invalid', - * 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped' - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [nodeName] + * @member {string} [replicaStatus] The status of a replica of a service. + * Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', + * 'Dropped' + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [nodeName] The name of a Service Fabric node. * @member {string} [address] The address the replica is listening on. * @member {string} [lastInBuildDurationInSeconds] The last in build duration * of the replica in seconds. @@ -3200,8 +4031,13 @@ export interface ReplicaInfo { * results can be obtained by executing the same query with the continuation * token provided in this list. * - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of replica information. */ export interface PagedReplicaInfoList { continuationToken?: string; @@ -3214,14 +4050,24 @@ export interface PagedReplicaInfoList { * @constructor * Information about a Service Fabric service. * - * @member {string} [id] - * @member {string} [name] - * @member {string} [typeName] + * @member {string} [id] The identity of the service. This ID is an encoded + * representation of the service name. This is used in the REST APIs to + * identify the service resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + * @member {string} [name] The full name of the service with 'fabric:' URI + * scheme. + * @member {string} [typeName] Name of the service type as specified in the + * service manifest. * @member {string} [manifestVersion] The version of the service manifest. - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [serviceStatus] Possible values include: 'Unknown', - * 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed' + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [serviceStatus] The status of the application. Possible + * values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', + * 'Failed' * @member {boolean} [isServiceGroup] Whether the service is in a service * group. * @member {string} serviceKind Polymorphic Discriminator @@ -3246,14 +4092,49 @@ export interface ServiceInfo { * results can be obtained by executing the same query with the continuation * token provided in this list. * - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service information. */ export interface PagedServiceInfoList { continuationToken?: string; items?: ServiceInfo[]; } +/** + * @class + * Initializes a new instance of the PartitionEvent class. + * @constructor + * Represents the base for all Partition Events. + * + * @member {uuid} partitionId An internal ID used by Service Fabric to uniquely + * identify a partition. This is a randomly generated GUID when the service was + * created. The partition ID is unique and does not change for the lifetime of + * the service. If the same service was deleted and recreated the IDs of its + * partitions would be different. + */ +export interface PartitionEvent extends FabricEvent { + partitionId: string; +} + +/** + * @class + * Initializes a new instance of the PartitionAnalysisEvent class. + * @constructor + * Represents the base for all Partition Analysis Events. + * + * @member {object} metadata Metadata about an Analysis Event. + * @member {moment.duration} [metadata.delay] The analysis delay. + * @member {moment.duration} [metadata.duration] The duration of analysis. + */ +export interface PartitionAnalysisEvent extends PartitionEvent { + metadata: AnalysisEventMetadata; +} + /** * @class * Initializes a new instance of the ReplicaHealthState class. @@ -3261,7 +4142,8 @@ export interface PagedServiceInfoList { * Represents a base class for stateful service replica or stateless service * instance health state. * - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] The ID of the partition to which this replica + * belongs. * @member {string} serviceKind Polymorphic Discriminator */ export interface ReplicaHealthState extends EntityHealthState { @@ -3275,7 +4157,8 @@ export interface ReplicaHealthState extends EntityHealthState { * @constructor * Information about the health of a Service Fabric partition. * - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] ID of the partition whose health information is + * described by this object. * @member {array} [replicaHealthStates] The list of replica health states * associated with the partition. */ @@ -3293,8 +4176,12 @@ export interface PartitionHealth extends EntityHealth { * evaluation is returned only when the aggregated health state is either Error * or Warning. * - * @member {uuid} [partitionId] - * @member {array} [unhealthyEvaluations] + * @member {uuid} [partitionId] Id of the partition whose health evaluation is + * described by this object. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the partition. The types of + * the unhealthy evaluations can be ReplicasHealthEvaluation or + * EventHealthEvaluation. */ export interface PartitionHealthEvaluation extends HealthEvaluation { partitionId?: string; @@ -3308,7 +4195,8 @@ export interface PartitionHealthEvaluation extends HealthEvaluation { * Represents the health state of a partition, which contains the partition * identifier and its aggregated health state. * - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition whose health state is + * described by this object. */ export interface PartitionHealthState extends EntityHealthState { partitionId?: string; @@ -3328,6 +4216,71 @@ export interface ProvisionFabricDescription { clusterManifestFilePath?: string; } +/** + * @class + * Initializes a new instance of the ProvisionApplicationTypeDescriptionBase class. + * @constructor + * Represents the type of registration or provision requested, and if the + * operation needs to be asynchronous or not. Supported types of provision + * operations are from either image store or external store. + * + * @member {boolean} async Indicates whether or not provisioning should occur + * asynchronously. When set to true, the provision operation returns when the + * request is accepted by the system, and the provision operation continues + * without any timeout limit. The default value is false. For large application + * packages, we recommend setting the value to true. + * @member {string} kind Polymorphic Discriminator + */ +export interface ProvisionApplicationTypeDescriptionBase { + async: boolean; + kind: string; +} + +/** + * @class + * Initializes a new instance of the ProvisionApplicationTypeDescription class. + * @constructor + * Describes the operation to register or provision an application type using + * an application package uploaded to the Service Fabric image store. + * + * @member {string} applicationTypeBuildPath The relative path for the + * application package in the image store specified during the prior upload + * operation. + * @member {string} [applicationPackageCleanupPolicy] The kind of action that + * needs to be taken for cleaning up the application package after successful + * provision. Possible values include: 'Invalid', 'Default', 'Automatic', + * 'Manual' + */ +export interface ProvisionApplicationTypeDescription extends ProvisionApplicationTypeDescriptionBase { + applicationTypeBuildPath: string; + applicationPackageCleanupPolicy?: string; +} + +/** + * @class + * Initializes a new instance of the ExternalStoreProvisionApplicationTypeDescription class. + * @constructor + * Describes the operation to register or provision an application type using + * an application package from an external store instead of a package uploaded + * to the Service Fabric image store. + * + * @member {string} applicationPackageDownloadUri The path to the '.sfpkg' + * application package from where the application package can be downloaded + * using HTTP or HTTPS protocols. The application package can be stored in an + * external store that provides GET operation to download the file. Supported + * protocols are HTTP and HTTPS, and the path must allow READ access. + * @member {string} applicationTypeName The application type name represents + * the name of the application type found in the application manifest. + * @member {string} applicationTypeVersion The application type version + * represents the version of the application type found in the application + * manifest. + */ +export interface ExternalStoreProvisionApplicationTypeDescription extends ProvisionApplicationTypeDescriptionBase { + applicationPackageDownloadUri: string; + applicationTypeName: string; + applicationTypeVersion: string; +} + /** * @class * Initializes a new instance of the UnprovisionFabricDescription class. @@ -3391,22 +4344,60 @@ export interface ClusterUpgradeHealthPolicyObject { * * @member {string} [codeVersion] The cluster code version. * @member {string} [configVersion] The cluster configuration version. - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {string} [upgradeKind] The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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} [monitoringPolicy] Describes the parameters for monitoring + * an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action to + * perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [clusterHealthPolicy] + * 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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The maximum @@ -3439,11 +4430,34 @@ export interface ClusterUpgradeHealthPolicyObject { * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. - * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] + * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * @member {boolean} [enableDeltaHealthEvaluation] When true, enables delta * health evaluation rather than absolute health evaluation after completion of * each upgrade domain. - * @member {object} [clusterUpgradeHealthPolicy] + * @member {object} [clusterUpgradeHealthPolicy] Defines a health policy used + * to evaluate the health of the cluster during a cluster upgrade. * @member {number} [clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] * The maximum allowed percentage of nodes health degradation allowed during * cluster upgrades. The delta is measured between the state of the nodes at @@ -3460,8 +4474,12 @@ export interface ClusterUpgradeHealthPolicyObject { * 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. The default value is 15%. - * @member {object} [applicationHealthPolicyMap] - * @member {array} [applicationHealthPolicyMap.applicationHealthPolicyMap] + * @member {object} [applicationHealthPolicyMap] Defines the application health + * policy map used to evaluate the health of an application or one of its + * children entities. + * @member {array} [applicationHealthPolicyMap.applicationHealthPolicyMap] The + * wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ export interface StartClusterUpgradeDescription { codeVersion?: string; @@ -3484,18 +4502,50 @@ export interface StartClusterUpgradeDescription { * Describes the parameters for updating a rolling upgrade of application or * cluster. * - * @member {string} rollingUpgradeMode Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {boolean} [forceRestart] - * @member {number} [replicaSetCheckTimeoutInMilliseconds] - * @member {string} [failureAction] Possible values include: 'Invalid', - * 'Rollback', 'Manual' - * @member {string} [healthCheckWaitDurationInMilliseconds] - * @member {string} [healthCheckStableDurationInMilliseconds] - * @member {string} [healthCheckRetryTimeoutInMilliseconds] - * @member {string} [upgradeTimeoutInMilliseconds] - * @member {string} [upgradeDomainTimeoutInMilliseconds] + * @member {string} rollingUpgradeMode The mode used to monitor health during a + * rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @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 {number} [replicaSetCheckTimeoutInMilliseconds] 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 {string} [failureAction] The compensating action to perform when a + * Monitored upgrade encounters monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * @member {string} [healthCheckWaitDurationInMilliseconds] 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} [healthCheckStableDurationInMilliseconds] 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} [healthCheckRetryTimeoutInMilliseconds] 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} [upgradeTimeoutInMilliseconds] 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} [upgradeDomainTimeoutInMilliseconds] 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 RollingUpgradeUpdateDescription { rollingUpgradeMode: string; @@ -3515,21 +4565,61 @@ export interface RollingUpgradeUpdateDescription { * @constructor * Parameters for updating a cluster upgrade. * - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling', 'Rolling_ForceRestart'. Default value: 'Rolling' . - * @member {object} [updateDescription] - * @member {string} [updateDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' - * @member {boolean} [updateDescription.forceRestart] + * @member {string} [upgradeKind] The type of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling', + * 'Rolling_ForceRestart'. Default value: 'Rolling' . + * @member {object} [updateDescription] Describes the parameters for updating a + * rolling upgrade of application or cluster. + * @member {string} [updateDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {boolean} [updateDescription.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 {number} [updateDescription.replicaSetCheckTimeoutInMilliseconds] - * @member {string} [updateDescription.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * 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 {string} [updateDescription.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} [updateDescription.healthCheckStableDurationInMilliseconds] + * 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} [updateDescription.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [updateDescription.upgradeTimeoutInMilliseconds] - * @member {string} [updateDescription.upgradeDomainTimeoutInMilliseconds] - * @member {object} [clusterHealthPolicy] + * 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} [updateDescription.upgradeTimeoutInMilliseconds] 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} [updateDescription.upgradeDomainTimeoutInMilliseconds] 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} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The maximum @@ -3562,9 +4652,34 @@ export interface RollingUpgradeUpdateDescription { * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. - * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {boolean} [enableDeltaHealthEvaluation] - * @member {object} [clusterUpgradeHealthPolicy] + * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {boolean} [enableDeltaHealthEvaluation] When true, enables delta + * health evaluation rather than absolute health evaluation after completion of + * each upgrade domain. + * @member {object} [clusterUpgradeHealthPolicy] Defines a health policy used + * to evaluate the health of the cluster during a cluster upgrade. * @member {number} [clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] * The maximum allowed percentage of nodes health degradation allowed during * cluster upgrades. The delta is measured between the state of the nodes at @@ -3581,8 +4696,12 @@ export interface RollingUpgradeUpdateDescription { * 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. The default value is 15%. - * @member {object} [applicationHealthPolicyMap] - * @member {array} [applicationHealthPolicyMap.applicationHealthPolicyMap] + * @member {object} [applicationHealthPolicyMap] Defines the application health + * policy map used to evaluate the health of an application or one of its + * children entities. + * @member {array} [applicationHealthPolicyMap.applicationHealthPolicyMap] The + * wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ export interface UpdateClusterUpgradeDescription { upgradeKind?: string; @@ -3600,7 +4719,8 @@ export interface UpdateClusterUpgradeDescription { * Represents a safety check for the service partition being performed by * service fabric before continuing with operations. * - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition which is undergoing the + * safety check. */ export interface PartitionSafetyCheck extends SafetyCheck { partitionId?: string; @@ -3654,7 +4774,9 @@ export interface SeedNodeSafetyCheck extends SafetyCheck { * ServiceTypeHealthPolicy. * @member {number} [totalCount] Total number of partitions of the service from * the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * PartitionHealthEvaluation that impacted the aggregated health. */ export interface PartitionsHealthEvaluation extends HealthEvaluation { maxPercentUnhealthyPartitionsPerService?: number; @@ -3662,6 +4784,30 @@ export interface PartitionsHealthEvaluation extends HealthEvaluation { unhealthyEvaluations?: HealthEvaluationWrapper[]; } +/** + * @class + * Initializes a new instance of the ReplicaEvent class. + * @constructor + * Represents the base for all Replica Events. + * + * @member {uuid} partitionId An internal ID used by Service Fabric to uniquely + * identify a partition. This is a randomly generated GUID when the service was + * created. The partition ID is unique and does not change for the lifetime of + * the service. If the same service was deleted and recreated the IDs of its + * partitions would be different. + * @member {number} replicaId Id of a stateful service replica. ReplicaId is + * used by Service Fabric to uniquely identify a replica of a partition. It is + * unique within a partition and does not change for the lifetime of the + * replica. If a replica gets dropped and another replica gets created on the + * same node for the same partition, it will get a different value for the id. + * Sometimes the id of a stateless service instance is also referred as a + * replica id. + */ +export interface ReplicaEvent extends FabricEvent { + partitionId: string; + replicaId: number; +} + /** * @class * Initializes a new instance of the ReplicaHealth class. @@ -3671,8 +4817,8 @@ export interface PartitionsHealthEvaluation extends HealthEvaluation { * Contains the replica aggregated health state, the health events and the * unhealthy evaluations. * - * - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition to which this replica + * belongs. * @member {string} serviceKind Polymorphic Discriminator */ export interface ReplicaHealth extends EntityHealth { @@ -3689,9 +4835,21 @@ export interface ReplicaHealth extends EntityHealth { * evaluation is returned only when the aggregated health state is either Error * or Warning. * - * @member {uuid} [partitionId] - * @member {string} [replicaOrInstanceId] - * @member {array} [unhealthyEvaluations] + * @member {uuid} [partitionId] Id of the partition to which the replica + * belongs. + * @member {string} [replicaOrInstanceId] Id of a stateful service replica or a + * stateless service instance. This ID is used in the queries that apply to + * both stateful and stateless services. It is used by Service Fabric to + * uniquely identify a replica of a partition of a stateful service or an + * instance of a stateless service partition. It is unique within a partition + * and does not change for the lifetime of the replica or the instance. If a + * stateful replica gets dropped and another replica gets created on the same + * node for the same partition, it will get a different value for the ID. If a + * stateless instance is failed over on the same or different node it will get + * a different value for the ID. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the replica. The types of the + * unhealthy evaluations can be EventHealthEvaluation. */ export interface ReplicaHealthEvaluation extends HealthEvaluation { partitionId?: string; @@ -3713,7 +4871,9 @@ export interface ReplicaHealthEvaluation extends HealthEvaluation { * ApplicationHealthPolicy. * @member {number} [totalCount] Total number of replicas in the partition from * the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ReplicaHealthEvaluation that impacted the aggregated health. */ export interface ReplicasHealthEvaluation extends HealthEvaluation { maxPercentUnhealthyReplicasPerPartition?: number; @@ -3727,13 +4887,13 @@ export interface ReplicasHealthEvaluation extends HealthEvaluation { * @constructor * Describes the parameters to restart a Service Fabric node. * - * @member {string} nodeInstanceId The instance id of the target node. If - * instance id is specified the node is restarted only if it matches with the + * @member {string} nodeInstanceId The instance ID of the target node. If + * instance ID is specified the node is restarted only if it matches with the * current instance of the node. A default value of "0" would match any - * instance id. The instance id can be obtained using get node query. Default + * instance ID. The instance ID can be obtained using get node query. Default * value: '0' . * @member {string} [createFabricDump] Specify True to create a dump of the - * fabric node process. This is case sensitive. Possible values include: + * fabric node process. This is case-sensitive. Possible values include: * 'False', 'True'. Default value: 'False' . */ export interface RestartNodeDescription { @@ -3741,6 +4901,24 @@ export interface RestartNodeDescription { createFabricDump?: string; } +/** + * @class + * Initializes a new instance of the ServiceEvent class. + * @constructor + * Represents the base for all Service Events. + * + * @member {string} serviceId The identity of the service. This ID is an + * encoded representation of the service name. This is used in the REST APIs to + * identify the service resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + */ +export interface ServiceEvent extends FabricEvent { + serviceId: string; +} + /** * @class * Initializes a new instance of the ServiceFromTemplateDescription class. @@ -3748,12 +4926,16 @@ export interface RestartNodeDescription { * Defines description for creating a Service Fabric service from a template * defined in the application manifest. * - * - * @member {string} applicationName - * @member {string} serviceName - * @member {string} serviceTypeName - * @member {array} [initializationData] - * @member {string} [servicePackageActivationMode] Possible values include: + * @member {string} applicationName The name of the application, including the + * 'fabric:' URI scheme. + * @member {string} serviceName The full name of the service with 'fabric:' URI + * scheme. + * @member {string} serviceTypeName Name of the service type as specified in + * the service manifest. + * @member {array} [initializationData] The initialization data for the newly + * created service instance. + * @member {string} [servicePackageActivationMode] The activation mode of + * service package to be used for a service. Possible values include: * 'SharedProcess', 'ExclusiveProcess' * @member {string} [serviceDnsName] The DNS name of the service. It requires * the DNS system service to be enabled in Service Fabric cluster. @@ -3776,8 +4958,12 @@ export interface ServiceFromTemplateDescription { * evaluation is returned only when the aggregated health state is either Error * or Warning. * - * @member {string} [serviceName] - * @member {array} [unhealthyEvaluations] + * @member {string} [serviceName] Name of the service whose health evaluation + * is described by this object. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the service. The types of the + * unhealthy evaluations can be PartitionsHealthEvaluation or + * EventHealthEvaluation. */ export interface ServiceHealthEvaluation extends HealthEvaluation { serviceName?: string; @@ -3790,7 +4976,8 @@ export interface ServiceHealthEvaluation extends HealthEvaluation { * @constructor * Information about the health of a Service Fabric service. * - * @member {string} [name] + * @member {string} [name] The name of the service whose health information is + * described by this object. * @member {array} [partitionHealthStates] The list of partition health states * associated with the service. */ @@ -3805,8 +4992,15 @@ export interface ServiceHealth extends EntityHealth { * @constructor * Information about the service name. * - * @member {string} [id] - * @member {string} [name] + * @member {string} [id] The identity of the service. This ID is an encoded + * representation of the service name. This is used in the REST APIs to + * identify the service resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + * @member {string} [name] The full name of the service with 'fabric:' URI + * scheme. */ export interface ServiceNameInfo { id?: string; @@ -3848,7 +5042,6 @@ export interface ServicePlacementInvalidDomainPolicyDescription extends ServiceP * where all replicas must be able to be placed in order for any replicas to be * created. * - * */ export interface ServicePlacementNonPartiallyPlaceServicePolicyDescription extends ServicePlacementPolicyDescription { } @@ -3869,7 +5062,6 @@ export interface ServicePlacementNonPartiallyPlaceServicePolicyDescription exten * it is possible that the Primary replica may not end up located in this * domain due to failures, capacity limits, or other constraints. * - * * @member {string} [domainName] The name of the domain that should used for * placement as per this policy. */ @@ -3909,7 +5101,6 @@ export interface ServicePlacementRequiredDomainPolicyDescription extends Service * the remaining datacenters. If this is not desirable then this policy should * be set. * - * * @member {string} [domainName] The name of the domain that should used for * placement as per this policy. */ @@ -3932,7 +5123,9 @@ export interface ServicePlacementRequireDomainDistributionPolicyDescription exte * unhealthy services from the ServiceTypeHealthPolicy. * @member {number} [totalCount] Total number of services of the current * service type in the application from the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ServiceHealthEvaluation that impacted the aggregated health. */ export interface ServicesHealthEvaluation extends HealthEvaluation { serviceTypeName?: string; @@ -3943,15 +5136,44 @@ export interface ServicesHealthEvaluation extends HealthEvaluation { /** * @class - * Initializes a new instance of the ServiceTypeExtensionDescription class. + * Initializes a new instance of the ServiceLoadMetricDescription class. * @constructor - * Describes extension of a service type defined in the service manifest. + * Specifies a metric to load balance a service during runtime. * - * @member {string} [key] The name of the extension. - * @member {string} [value] The extension value. + * @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 ServiceTypeExtensionDescription { - key?: string; +export interface ServiceLoadMetricDescription { + name: string; + weight?: string; + primaryDefaultLoad?: number; + secondaryDefaultLoad?: number; + defaultLoad?: number; +} + +/** + * @class + * Initializes a new instance of the ServiceTypeExtensionDescription class. + * @constructor + * Describes extension of a service type defined in the service manifest. + * + * @member {string} [key] The name of the extension. + * @member {string} [value] The extension value. + */ +export interface ServiceTypeExtensionDescription { + key?: string; value?: string; } @@ -3960,23 +5182,27 @@ export interface ServiceTypeExtensionDescription { * Initializes a new instance of the ServiceTypeDescription class. * @constructor * Describes a service type defined in the service manifest of a provisioned - * application type. The properties the the ones defined in the service - * manifest. + * application type. The properties the ones defined in the service manifest. * * @member {boolean} [isStateful] Indicates whether the service type is a * stateful service type or a stateless service type. This property is true if * the service type is a stateful service type, false otherwise. - * @member {string} [serviceTypeName] + * @member {string} [serviceTypeName] Name of the service type as specified in + * the service manifest. * @member {string} [placementConstraints] The placement constraint to be used * when instantiating this service in a Service Fabric cluster. - * @member {array} [servicePlacementPolicies] - * @member {array} [extensions] + * @member {array} [loadMetrics] The service load metrics is given as an array + * of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] List of service placement policy + * descriptions. + * @member {array} [extensions] List of service type extensions. * @member {string} kind Polymorphic Discriminator */ export interface ServiceTypeDescription { isStateful?: boolean; serviceTypeName?: string; placementConstraints?: string; + loadMetrics?: ServiceLoadMetricDescription[]; servicePlacementPolicies?: ServicePlacementPolicyDescription[]; extensions?: ServiceTypeExtensionDescription[]; kind: string; @@ -3989,19 +5215,27 @@ export interface ServiceTypeDescription { * Information about a service type that is defined in a service manifest of a * provisioned application type. * - * @member {object} [serviceTypeDescription] + * @member {object} [serviceTypeDescription] Describes a service type defined + * in the service manifest of a provisioned application type. The properties + * the ones defined in the service manifest. * @member {boolean} [serviceTypeDescription.isStateful] Indicates whether the * service type is a stateful service type or a stateless service type. This * property is true if the service type is a stateful service type, false * otherwise. - * @member {string} [serviceTypeDescription.serviceTypeName] + * @member {string} [serviceTypeDescription.serviceTypeName] Name of the + * service type as specified in the service manifest. * @member {string} [serviceTypeDescription.placementConstraints] The placement * constraint to be used when instantiating this service in a Service Fabric * cluster. - * @member {array} [serviceTypeDescription.servicePlacementPolicies] - * @member {array} [serviceTypeDescription.extensions] + * @member {array} [serviceTypeDescription.loadMetrics] The service load + * metrics is given as an array of ServiceLoadMetricDescription objects. + * @member {array} [serviceTypeDescription.servicePlacementPolicies] List of + * service placement policy descriptions. + * @member {array} [serviceTypeDescription.extensions] List of service type + * extensions. * @member {string} [serviceTypeDescription.kind] Polymorphic Discriminator - * @member {string} [serviceManifestName] + * @member {string} [serviceManifestName] The name of the service manifest in + * which this service type is defined. * @member {string} [serviceManifestVersion] The version of the service * manifest in which this service type is defined. * @member {boolean} [isServiceGroup] Indicates whether the service is a @@ -4031,9 +5265,9 @@ export interface ServiceTypeManifest { * @class * Initializes a new instance of the SingletonPartitionInformation class. * @constructor - * Information about a partition that is singleton. The services with - * singletone partitioning scheme are effectively non-partitioned. They only - * have one partition. + * Information about a partition that is singleton. The services with singleton + * partitioning scheme are effectively non-partitioned. They only have one + * partition. * */ export interface SingletonPartitionInformation extends PartitionInformation { @@ -4066,7 +5300,11 @@ export interface StatefulServiceInfo extends ServiceInfo { * this partition was in quorum loss. If the partition is currently in quorum * loss, it returns the duration since it has been in that state. This field is * using ISO8601 format for specifying the duration. - * @member {object} [currentConfigurationEpoch] + * @member {object} [currentConfigurationEpoch] An Epoch is a configuration + * number for the partition as a whole. When the configuration of the replica + * set changes, for example when the Primary replica changes, the operations + * that are replicated from the new Primary replica are said to be a new Epoch + * from the ones which were sent by the old Primary replica. * @member {string} [currentConfigurationEpoch.configurationVersion] The * current configuration number of this Epoch. The configuration number is an * increasing value that is updated whenever the configuration of this replica @@ -4092,8 +5330,13 @@ export interface StatefulServicePartitionInfo extends ServicePartitionInfo { * Contains the replica aggregated health state, the health events and the * unhealthy evaluations. * - * - * @member {string} [replicaId] + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId is + * used by Service Fabric to uniquely identify a replica of a partition. It is + * unique within a partition and does not change for the lifetime of the + * replica. If a replica gets dropped and another replica gets created on the + * same node for the same partition, it will get a different value for the id. + * Sometimes the id of a stateless service instance is also referred as a + * replica id. */ export interface StatefulServiceReplicaHealth extends ReplicaHealth { replicaId?: string; @@ -4104,9 +5347,15 @@ export interface StatefulServiceReplicaHealth extends ReplicaHealth { * Initializes a new instance of the StatefulServiceReplicaHealthState class. * @constructor * Represents the health state of the stateful service replica, which contains - * the replica id and the aggregated health state. - * - * @member {string} [replicaId] + * the replica ID and the aggregated health state. + * + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId is + * used by Service Fabric to uniquely identify a replica of a partition. It is + * unique within a partition and does not change for the lifetime of the + * replica. If a replica gets dropped and another replica gets created on the + * same node for the same partition, it will get a different value for the id. + * Sometimes the id of a stateless service instance is also referred as a + * replica id. */ export interface StatefulServiceReplicaHealthState extends ReplicaHealthState { replicaId?: string; @@ -4141,12 +5390,15 @@ export interface StatelessServiceInfo extends ServiceInfo { * @class * Initializes a new instance of the StatelessServiceInstanceHealth class. * @constructor - * Represents the health of the statelss service instance. + * Represents the health of the stateless service instance. * Contains the instance aggregated health state, the health events and the * unhealthy evaluations. * - * - * @member {string} [instanceId] + * @member {string} [instanceId] Id of a stateless service instance. InstanceId + * is used by Service Fabric to uniquely identify an instance of a partition of + * a stateless service. It is unique within a partition and does not change for + * the lifetime of the instance. If the instance has failed over on the same or + * different node, it will get a different value for the InstanceId. */ export interface StatelessServiceInstanceHealth extends ReplicaHealth { instanceId?: string; @@ -4157,9 +5409,10 @@ export interface StatelessServiceInstanceHealth extends ReplicaHealth { * Initializes a new instance of the StatelessServiceInstanceHealthState class. * @constructor * Represents the health state of the stateless service instance, which - * contains the instance id and the aggregated health state. + * contains the instance ID and the aggregated health state. * - * @member {string} [replicaId] + * @member {string} [replicaId] Id of the stateless service instance on the + * wire this field is called ReplicaId. */ export interface StatelessServiceInstanceHealthState extends ReplicaHealthState { replicaId?: string; @@ -4202,7 +5455,11 @@ export interface StatelessServiceTypeDescription extends ServiceTypeDescription * evaluate health. The evaluation is returned only when the aggregated health * state of the cluster is either Error or Warning. * - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the system application. The + * types of the unhealthy evaluations can be + * DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or + * EventHealthEvaluation. */ export interface SystemApplicationHealthEvaluation extends HealthEvaluation { unhealthyEvaluations?: HealthEvaluationWrapper[]; @@ -4218,7 +5475,6 @@ export interface SystemApplicationHealthEvaluation extends HealthEvaluation { * Can be returned during cluster upgrade when cluster aggregated health state * is Warning or Error. * - * * @member {string} [upgradeDomainName] Name of the upgrade domain where nodes * health is currently evaluated. * @member {number} [baselineErrorCount] Number of upgrade domain nodes with @@ -4230,7 +5486,9 @@ export interface SystemApplicationHealthEvaluation extends HealthEvaluation { * of upgrade domain delta unhealthy nodes from the ClusterUpgradeHealthPolicy. * @member {number} [totalCount] Total number of upgrade domain nodes in the * health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * NodeHealthEvaluation that impacted the aggregated health. */ export interface UpgradeDomainDeltaNodesCheckHealthEvaluation extends HealthEvaluation { upgradeDomainName?: string; @@ -4257,7 +5515,9 @@ export interface UpgradeDomainDeltaNodesCheckHealthEvaluation extends HealthEval * unhealthy nodes from the ClusterHealthPolicy. * @member {number} [totalCount] Total number of nodes in the current upgrade * domain. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * NodeHealthEvaluation that impacted the aggregated health. */ export interface UpgradeDomainNodesHealthEvaluation extends HealthEvaluation { upgradeDomainName?: string; @@ -4271,9 +5531,9 @@ export interface UpgradeDomainNodesHealthEvaluation extends HealthEvaluation { * Initializes a new instance of the WaitForInbuildReplicaSafetyCheck class. * @constructor * Safety check that waits for the replica build operation to finish. This - * indiciates that there is a replica that is going through the copy or is + * indicates that there is a replica that is going through the copy or is * providing data for building another replica. Bring the node down will abort - * this copy operation which are typoically expensive involving data movements. + * this copy operation which are typically expensive involving data movements. * */ export interface WaitForInbuildReplicaSafetyCheck extends PartitionSafetyCheck { @@ -4341,8 +5601,7 @@ export interface LoadMetricReport { * default load for the service of the partition. * For default loads, LoadMetricReport's LastReportedUtc is set to 0. * - * - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition. * @member {array} [primaryLoadMetricReports] Array of load reports from the * primary replica for this partition. * @member {array} [secondaryLoadMetricReports] Array of aggregated load @@ -4363,9 +5622,16 @@ export interface PartitionLoadInformation { * identity, role, status, health, node name, uptime, and other details about * the replica. * - * @member {string} [replicaRole] Possible values include: 'Unknown', 'None', - * 'Primary', 'IdleSecondary', 'ActiveSecondary' - * @member {string} [replicaId] + * @member {string} [replicaRole] The role of a replica of a stateful service. + * Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', + * 'ActiveSecondary' + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId is + * used by Service Fabric to uniquely identify a replica of a partition. It is + * unique within a partition and does not change for the lifetime of the + * replica. If a replica gets dropped and another replica gets created on the + * same node for the same partition, it will get a different value for the id. + * Sometimes the id of a stateless service instance is also referred as a + * replica id. */ export interface StatefulServiceReplicaInfo extends ReplicaInfo { replicaRole?: string; @@ -4380,7 +5646,11 @@ export interface StatefulServiceReplicaInfo extends ReplicaInfo { * identity, status, health, node name, uptime, and other details about the * instance. * - * @member {string} [instanceId] + * @member {string} [instanceId] Id of a stateless service instance. InstanceId + * is used by Service Fabric to uniquely identify an instance of a partition of + * a stateless service. It is unique within a partition and does not change for + * the lifetime of the instance. If the instance has failed over on the same or + * different node, it will get a different value for the InstanceId. */ export interface StatelessServiceInstanceInfo extends ReplicaInfo { instanceId?: string; @@ -4392,25 +5662,67 @@ export interface StatelessServiceInstanceInfo extends ReplicaInfo { * @constructor * Represents a ServiceFabric cluster upgrade * - * @member {string} [configVersion] - * @member {string} [codeVersion] - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {boolean} [enableDeltaHealthEvaluation] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {string} [configVersion] The cluster configuration version + * (specified in the cluster manifest). + * @member {string} [codeVersion] The ServiceFabric code version of the + * cluster. + * @member {string} [upgradeKind] The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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 {boolean} [enableDeltaHealthEvaluation] When true, enables delta + * health evaluation rather than absolute health evaluation after completion of + * each upgrade domain. + * @member {object} [monitoringPolicy] Describes the parameters for monitoring + * an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action to + * perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [clusterHealthPolicy] + * 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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The maximum @@ -4443,8 +5755,31 @@ export interface StatelessServiceInstanceInfo extends ReplicaInfo { * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. - * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [clusterUpgradeHealthPolicy] + * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [clusterUpgradeHealthPolicy] Defines a health policy used + * to evaluate the health of the cluster during a cluster upgrade. * @member {number} [clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] * The maximum allowed percentage of nodes health degradation allowed during * cluster upgrades. The delta is measured between the state of the nodes at @@ -4461,7 +5796,15 @@ export interface StatelessServiceInstanceInfo extends ReplicaInfo { * 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. The default value is 15%. - * @member {array} [applicationHealthPolicyMap] + * @member {array} [applicationHealthPolicyMap] Defines a map that contains + * specific application health policies for different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. */ export interface ClusterUpgradeDescriptionObject { configVersion?: string; @@ -4484,8 +5827,9 @@ export interface ClusterUpgradeDescriptionObject { * The detailed upgrade progress for nodes in the current upgrade domain at the * point of failure. * - * @member {string} [domainName] - * @member {array} [nodeUpgradeProgressList] + * @member {string} [domainName] The name of the upgrade domain + * @member {array} [nodeUpgradeProgressList] List of upgrading nodes and their + * statuses */ export interface FailedUpgradeDomainProgressObject { domainName?: string; @@ -4498,40 +5842,89 @@ export interface FailedUpgradeDomainProgressObject { * @constructor * Information about a cluster upgrade. * - * @member {string} [codeVersion] - * @member {string} [configVersion] - * @member {array} [upgradeDomains] - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', - * 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed' - * @member {string} [nextUpgradeDomain] - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {object} [upgradeDescription] - * @member {string} [upgradeDescription.configVersion] - * @member {string} [upgradeDescription.codeVersion] - * @member {string} [upgradeDescription.upgradeKind] Possible values include: - * 'Invalid', 'Rolling' - * @member {string} [upgradeDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {string} [codeVersion] The ServiceFabric code version of the + * cluster. + * @member {string} [configVersion] The cluster configuration version + * (specified in the cluster manifest). + * @member {array} [upgradeDomains] List of upgrade domains and their statuses. + * @member {string} [upgradeState] The state of the upgrade domain. Possible + * values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', + * 'RollingForwardPending', 'RollingForwardInProgress', + * 'RollingForwardCompleted', 'Failed' + * @member {string} [nextUpgradeDomain] The name of the next upgrade domain to + * be processed. + * @member {string} [rollingUpgradeMode] The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @member {object} [upgradeDescription] Represents a ServiceFabric cluster + * upgrade + * @member {string} [upgradeDescription.configVersion] The cluster + * configuration version (specified in the cluster manifest). + * @member {string} [upgradeDescription.codeVersion] The ServiceFabric code + * version of the cluster. + * @member {string} [upgradeDescription.upgradeKind] The kind of upgrade out of + * the following possible values. Possible values include: 'Invalid', 'Rolling' + * @member {string} [upgradeDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * @member {number} [upgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [upgradeDescription.forceRestart] - * @member {boolean} [upgradeDescription.enableDeltaHealthEvaluation] - * @member {object} [upgradeDescription.monitoringPolicy] - * @member {string} [upgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * 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} [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 {boolean} [upgradeDescription.enableDeltaHealthEvaluation] When + * true, enables delta health evaluation rather than absolute health evaluation + * after completion of each upgrade domain. + * @member {object} [upgradeDescription.monitoringPolicy] Describes the + * parameters for monitoring an upgrade in Monitored mode. + * @member {string} [upgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} * [upgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [upgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} - * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * [upgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] 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} - * [upgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [upgradeDescription.clusterHealthPolicy] + * [upgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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} [upgradeDescription.clusterHealthPolicy] Defines a health + * policy used to evaluate the health of the cluster or of a cluster node. * @member {boolean} * [upgradeDescription.clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. @@ -4569,7 +5962,31 @@ export interface FailedUpgradeDomainProgressObject { * applications. Default percentage is zero. * @member {array} * [upgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [upgradeDescription.clusterUpgradeHealthPolicy] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [upgradeDescription.clusterUpgradeHealthPolicy] Defines a + * health policy used to evaluate the health of the cluster during a cluster + * upgrade. * @member {number} * [upgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] * The maximum allowed percentage of nodes health degradation allowed during @@ -4587,20 +6004,41 @@ export interface FailedUpgradeDomainProgressObject { * 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. The default value is 15%. - * @member {array} [upgradeDescription.applicationHealthPolicyMap] - * @member {string} [upgradeDurationInMilliseconds] - * @member {string} [upgradeDomainDurationInMilliseconds] - * @member {array} [unhealthyEvaluations] - * @member {object} [currentUpgradeDomainProgress] - * @member {string} [currentUpgradeDomainProgress.domainName] - * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] - * @member {string} [startTimestampUtc] - * @member {string} [failureTimestampUtc] - * @member {string} [failureReason] Possible values include: 'None', - * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'UpgradeTimeout' - * @member {object} [upgradeDomainProgressAtFailure] - * @member {string} [upgradeDomainProgressAtFailure.domainName] + * @member {array} [upgradeDescription.applicationHealthPolicyMap] Defines a + * map that contains specific application health policies for different + * applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * @member {string} [upgradeDurationInMilliseconds] The estimated elapsed time + * spent processing the current overall upgrade. + * @member {string} [upgradeDomainDurationInMilliseconds] The estimated elapsed + * time spent processing the current upgrade domain. + * @member {array} [unhealthyEvaluations] List of health evaluations that + * resulted in the current aggregated health state. + * @member {object} [currentUpgradeDomainProgress] Information about the + * current in-progress upgrade domain. + * @member {string} [currentUpgradeDomainProgress.domainName] The name of the + * upgrade domain + * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] List + * of upgrading nodes and their statuses + * @member {string} [startTimestampUtc] The start time of the upgrade in UTC. + * @member {string} [failureTimestampUtc] The failure time of the upgrade in + * UTC. + * @member {string} [failureReason] The cause of an upgrade failure that + * resulted in FailureAction being executed. Possible values include: 'None', + * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', + * 'OverallUpgradeTimeout' + * @member {object} [upgradeDomainProgressAtFailure] The detailed upgrade + * progress for nodes in the current upgrade domain at the point of failure. + * @member {string} [upgradeDomainProgressAtFailure.domainName] The name of the + * upgrade domain * @member {array} [upgradeDomainProgressAtFailure.nodeUpgradeProgressList] + * List of upgrading nodes and their statuses */ export interface ClusterUpgradeProgressObject { codeVersion?: string; @@ -4653,6 +6091,12 @@ export interface ClusterUpgradeProgressObject { * allowed percentage of upgrade domain delta health degradation during the * upgrade. Allowed values are integer values from zero to 100. 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. + * @member {array} [applicationHealthPolicies.applicationHealthPolicyMap] The + * wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ export interface ClusterConfigurationUpgradeDescription { clusterConfig: string; @@ -4665,6 +6109,45 @@ export interface ClusterConfigurationUpgradeDescription { maxPercentUnhealthyNodes?: number; maxPercentDeltaUnhealthyNodes?: number; maxPercentUpgradeDomainDeltaUnhealthyNodes?: number; + applicationHealthPolicies?: ApplicationHealthPolicies; +} + +/** + * @class + * Initializes a new instance of the UpgradeOrchestrationServiceState class. + * @constructor + * Service state of Service Fabric Upgrade Orchestration Service. + * + * @member {string} [serviceState] The state of Service Fabric Upgrade + * Orchestration Service. + */ +export interface UpgradeOrchestrationServiceState { + serviceState?: string; +} + +/** + * @class + * Initializes a new instance of the UpgradeOrchestrationServiceStateSummary class. + * @constructor + * Service state summary of Service Fabric Upgrade Orchestration Service. + * + * @member {string} [currentCodeVersion] The current code version of the + * cluster. + * @member {string} [currentManifestVersion] The current manifest version of + * the cluster. + * @member {string} [targetCodeVersion] The target code version of the + * cluster. + * @member {string} [targetManifestVersion] The target manifest version of the + * cluster. + * @member {string} [pendingUpgradeType] The type of the pending upgrade of the + * cluster. + */ +export interface UpgradeOrchestrationServiceStateSummary { + currentCodeVersion?: string; + currentManifestVersion?: string; + targetCodeVersion?: string; + targetManifestVersion?: string; + pendingUpgradeType?: string; } /** @@ -4683,14 +6166,23 @@ export interface ApplicationTypeImageStorePath { /** * @class - * Initializes a new instance of the ApplicationTypeImageStoreVersion class. + * Initializes a new instance of the UnprovisionApplicationTypeDescriptionInfo class. * @constructor - * A version description for the application type + * Describes the operation to unregister or unprovision an application type and + * its version that was registered with the Service Fabric. * - * @member {string} applicationTypeVersion + * @member {string} applicationTypeVersion The version of the application type + * as defined in the application manifest. + * @member {boolean} [async] The flag indicating whether or not unprovision + * should occur asynchronously. When set to true, the unprovision operation + * returns when the request is accepted by the system, and the unprovision + * operation continues without any timeout limit. The default value is false. + * However, we recommend setting it to true for large application packages that + * were provisioned. */ -export interface ApplicationTypeImageStoreVersion { +export interface UnprovisionApplicationTypeDescriptionInfo { applicationTypeVersion: string; + async?: boolean; } /** @@ -4744,10 +6236,11 @@ export interface CodePackageEntryPointStatistics { * * @member {string} [entryPointLocation] The location of entry point executable * on the node. - * @member {string} [processId] The process id of the entry point. + * @member {string} [processId] The process ID of the entry point. * @member {string} [runAsUserName] The user name under which entry point * executable is run on the node. - * @member {object} [codePackageEntryPointStatistics] + * @member {object} [codePackageEntryPointStatistics] Statistics about setup or + * main entry point of a code package deployed on a Service Fabric node. * @member {string} [codePackageEntryPointStatistics.lastExitCode] The last * exit code of the entry point. * @member {date} [codePackageEntryPointStatistics.lastActivationTime] The last @@ -4773,11 +6266,15 @@ export interface CodePackageEntryPointStatistics { * @member {string} * [codePackageEntryPointStatistics.continuousExitFailureCount] Number of times * the entry point continuously failed to exit gracefully. - * @member {string} [status] Possible values include: 'Invalid', 'Pending', - * 'Starting', 'Started', 'Stopping', 'Stopped' + * @member {string} [status] Specifies the status of the code package entry + * point deployed on a Service Fabric node. Possible values include: 'Invalid', + * 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' * @member {date} [nextActivationTime] The time (in UTC) when the entry point * executable will be run next. - * @member {string} [instanceId] + * @member {string} [instanceId] The instance ID for current running entry + * point. For a code package setup entry point (if specified) runs first and + * after it finishes main entry point is started. Each time entry point + * executable is run, its instance id will change. */ export interface CodePackageEntryPoint { entryPointLocation?: string; @@ -4795,27 +6292,42 @@ export interface CodePackageEntryPoint { * @constructor * Information about code package deployed on a Service Fabric node. * - * @member {string} [name] + * @member {string} [name] The name of the code package. * @member {string} [version] The version of the code package specified in * service manifest. - * @member {string} [serviceManifestName] - * @member {string} [servicePackageActivationId] - * @member {string} [hostType] Possible values include: 'Invalid', 'ExeHost', - * 'ContainerHost' - * @member {string} [hostIsolationMode] Possible values include: 'None', - * 'Process', 'HyperV' - * @member {string} [status] Possible values include: 'Invalid', 'Downloading', - * 'Activating', 'Active', 'Upgrading', 'Deactivating' + * @member {string} [serviceManifestName] The name of service manifest that + * specified this code package. + * @member {string} [servicePackageActivationId] The ActivationId of a deployed + * service package. If ServicePackageActivationMode specified at the time of + * creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * @member {string} [hostType] Specifies the type of host for main entry point + * of a code package as specified in service manifest. Possible values include: + * 'Invalid', 'ExeHost', 'ContainerHost' + * @member {string} [hostIsolationMode] Specifies the isolation mode of main + * entry point of a code package when it's host type is ContainerHost. This is + * specified as part of container host policies in application manifest while + * importing service manifest. Possible values include: 'None', 'Process', + * 'HyperV' + * @member {string} [status] Specifies the status of a deployed application or + * service package on a Service Fabric node. Possible values include: + * 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', + * 'Deactivating' * @member {string} [runFrequencyInterval] The interval at which code package * is run. This is used for periodic code package. - * @member {object} [setupEntryPoint] + * @member {object} [setupEntryPoint] Information about setup or main entry + * point of a code package deployed on a Service Fabric node. * @member {string} [setupEntryPoint.entryPointLocation] The location of entry * point executable on the node. - * @member {string} [setupEntryPoint.processId] The process id of the entry + * @member {string} [setupEntryPoint.processId] The process ID of the entry * point. * @member {string} [setupEntryPoint.runAsUserName] The user name under which * entry point executable is run on the node. * @member {object} [setupEntryPoint.codePackageEntryPointStatistics] + * Statistics about setup or main entry point of a code package deployed on a + * Service Fabric node. * @member {string} * [setupEntryPoint.codePackageEntryPointStatistics.lastExitCode] The last exit * code of the entry point. @@ -4848,19 +6360,26 @@ export interface CodePackageEntryPoint { * @member {string} * [setupEntryPoint.codePackageEntryPointStatistics.continuousExitFailureCount] * Number of times the entry point continuously failed to exit gracefully. - * @member {string} [setupEntryPoint.status] Possible values include: - * 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' + * @member {string} [setupEntryPoint.status] Specifies the status of the code + * package entry point deployed on a Service Fabric node. Possible values + * include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' * @member {date} [setupEntryPoint.nextActivationTime] The time (in UTC) when * the entry point executable will be run next. - * @member {string} [setupEntryPoint.instanceId] - * @member {object} [mainEntryPoint] + * @member {string} [setupEntryPoint.instanceId] The instance ID for current + * running entry point. For a code package setup entry point (if specified) + * runs first and after it finishes main entry point is started. Each time + * entry point executable is run, its instance id will change. + * @member {object} [mainEntryPoint] Information about setup or main entry + * point of a code package deployed on a Service Fabric node. * @member {string} [mainEntryPoint.entryPointLocation] The location of entry * point executable on the node. - * @member {string} [mainEntryPoint.processId] The process id of the entry + * @member {string} [mainEntryPoint.processId] The process ID of the entry * point. * @member {string} [mainEntryPoint.runAsUserName] The user name under which * entry point executable is run on the node. - * @member {object} [mainEntryPoint.codePackageEntryPointStatistics] + * @member {object} [mainEntryPoint.codePackageEntryPointStatistics] Statistics + * about setup or main entry point of a code package deployed on a Service + * Fabric node. * @member {string} * [mainEntryPoint.codePackageEntryPointStatistics.lastExitCode] The last exit * code of the entry point. @@ -4892,11 +6411,15 @@ export interface CodePackageEntryPoint { * @member {string} * [mainEntryPoint.codePackageEntryPointStatistics.continuousExitFailureCount] * Number of times the entry point continuously failed to exit gracefully. - * @member {string} [mainEntryPoint.status] Possible values include: 'Invalid', - * 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' + * @member {string} [mainEntryPoint.status] Specifies the status of the code + * package entry point deployed on a Service Fabric node. Possible values + * include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped' * @member {date} [mainEntryPoint.nextActivationTime] The time (in UTC) when * the entry point executable will be run next. - * @member {string} [mainEntryPoint.instanceId] + * @member {string} [mainEntryPoint.instanceId] The instance ID for current + * running entry point. For a code package setup entry point (if specified) + * runs first and after it finishes main entry point is started. Each time + * entry point executable is run, its instance id will change. */ export interface DeployedCodePackageInfo { name?: string; @@ -4911,21 +6434,6 @@ export interface DeployedCodePackageInfo { mainEntryPoint?: CodePackageEntryPoint; } -/** - * @class - * Initializes a new instance of the ChaosContextMapItem class. - * @constructor - * Describes an item in the ChaosContextMap in ChaosParameters. - * - * - * @member {string} key The key for a ChaosContextMapItem. - * @member {string} value The value for a ChaosContextMapItem. - */ -export interface ChaosContextMapItem { - key: string; - value: string; -} - /** * @class * Initializes a new instance of the ChaosContext class. @@ -4937,11 +6445,70 @@ export interface ChaosContextMapItem { * This map is set by the starter of the Chaos run to optionally store the * context about the specific run. * - * - * @member {object} [map] + * @member {object} [map] Describes a map that contains a collection of + * ChaosContextMapItem's. */ export interface ChaosContext { - map?: any; + map?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the ChaosTargetFilter class. + * @constructor + * Defines all filters for targeted Chaos faults, for example, faulting only + * certain node types or faulting only certain applications. + * If ChaosTargetFilter is not used, Chaos faults all cluster entities. If + * ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter + * specification. NodeTypeInclusionList and ApplicationInclusionList allow a + * union semantics only. It is not possible to specify an intersection + * of NodeTypeInclusionList and ApplicationInclusionList. For example, it is + * not possible to specify "fault this application only when it is on that node + * type." + * Once an entity is included in either NodeTypeInclusionList or + * ApplicationInclusionList, that entity cannot be excluded using + * ChaosTargetFilter. Even if + * applicationX does not appear in ApplicationInclusionList, in some Chaos + * iteration applicationX can be faulted because it happens to be on a node of + * nodeTypeY that is included + * in NodeTypeInclusionList. If both NodeTypeInclusionList and + * ApplicationInclusionList are null or empty, an ArgumentException is thrown. + * + * @member {array} [nodeTypeInclusionList] A list of node types to include in + * Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [applicationInclusionList] A list of application URI's to + * include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. + */ +export interface ChaosTargetFilter { + nodeTypeInclusionList?: string[]; + applicationInclusionList?: string[]; } /** @@ -4950,43 +6517,41 @@ export interface ChaosContext { * @constructor * Defines all the parameters to configure a Chaos run. * - * * @member {string} [timeToRunInSeconds] Total time (in seconds) for which * Chaos will run before automatically stopping. The maximum allowed value is - * 4,294,967,295 (System.UInt32.MaxValue). - * . Default value: '4294967295' . + * 4,294,967,295 (System.UInt32.MaxValue). Default value: '4294967295' . * @member {number} [maxClusterStabilizationTimeoutInSeconds] The maximum * amount of time to wait for all cluster entities to become stable and * healthy. Chaos executes in iterations and at the start of each iteration it * validates the health of cluster entities. * During validation if a cluster entity is not stable and healthy within * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed - * event. - * . Default value: 60 . + * event. Default value: 60 . * @member {number} [maxConcurrentFaults] MaxConcurrentFaults is the maximum * number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated by * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise - * caution while moving up. - * . Default value: 1 . + * caution while moving up. Default value: 1 . * @member {boolean} [enableMoveReplicaFaults] Enables or disables the move - * primary and move secondary faults. - * . Default value: true . + * primary and move secondary faults. Default value: true . * @member {number} [waitTimeBetweenFaultsInSeconds] Wait time (in seconds) * between consecutive faults within a single iteration. * The larger the value, the lower the overlapping between faults and the * simpler the sequence of state transitions that the cluster goes through. * The recommendation is to start with a value between 1 and 5 and exercise - * caution while moving up. - * . Default value: 20 . + * caution while moving up. Default value: 20 . * @member {number} [waitTimeBetweenIterationsInSeconds] Time-separation (in * seconds) between two consecutive iterations of Chaos. - * The larger the value, the lower the fault injection rate. - * . Default value: 30 . - * @member {object} [clusterHealthPolicy] + * The larger the value, the lower the fault injection rate. Default value: 30 + * . + * @member {object} [clusterHealthPolicy] Passed-in cluster health policy is + * used to validate health of the cluster in between Chaos iterations. If the + * cluster health is in error or if an unexpected exception happens during + * fault execution--to provide the cluster with some time to recuperate--Chaos + * will wait for 30 minutes before the next health-check. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The maximum @@ -5019,9 +6584,75 @@ export interface ChaosContext { * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. - * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [context] - * @member {object} [context.map] + * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [context] Describes a map, which is a collection of + * (string, string) type key-value pairs. The map can be used to record + * information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [context.map] Describes a map that contains a collection of + * ChaosContextMapItem's. + * @member {object} [chaosTargetFilter] List of cluster entities to target for + * Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [chaosTargetFilter.nodeTypeInclusionList] A list of node + * types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [chaosTargetFilter.applicationInclusionList] A list of + * application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. */ export interface ChaosParameters { timeToRunInSeconds?: string; @@ -5032,44 +6663,17 @@ export interface ChaosParameters { waitTimeBetweenIterationsInSeconds?: number; clusterHealthPolicy?: ClusterHealthPolicy; context?: ChaosContext; + chaosTargetFilter?: ChaosTargetFilter; } /** * @class - * Initializes a new instance of the ChaosEvent class. - * @constructor - * Represents an event generated during a Chaos run. - * - * @member {date} timeStampUtc - * @member {string} kind Polymorphic Discriminator - */ -export interface ChaosEvent { - timeStampUtc: Date; - kind: string; -} - -/** - * @class - * Initializes a new instance of the ChaosEventWrapper class. - * @constructor - * Wrapper object for Chaos event. - * - * @member {object} [chaosEvent] - * @member {date} [chaosEvent.timeStampUtc] - * @member {string} [chaosEvent.kind] Polymorphic Discriminator - */ -export interface ChaosEventWrapper { - chaosEvent?: ChaosEvent; -} - -/** - * @class - * Initializes a new instance of the ChaosReport class. + * Initializes a new instance of the Chaos class. * @constructor - * Contains detailed Chaos report. + * Contains a description of Chaos. * - * - * @member {object} [chaosParameters] + * @member {object} [chaosParameters] If Chaos is running, these are the + * parameters Chaos is running with. * @member {string} [chaosParameters.timeToRunInSeconds] Total time (in * seconds) for which Chaos will run before automatically stopping. The maximum * allowed value is 4,294,967,295 (System.UInt32.MaxValue). @@ -5084,8 +6688,8 @@ export interface ChaosEventWrapper { * is the maximum number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated by * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise * caution while moving up. * @member {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or @@ -5099,7 +6703,11 @@ export interface ChaosEventWrapper { * @member {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] * Time-separation (in seconds) between two consecutive iterations of Chaos. * The larger the value, the lower the fault injection rate. - * @member {object} [chaosParameters.clusterHealthPolicy] + * @member {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected exception + * happens during fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. * @member {boolean} * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. @@ -5136,27 +6744,438 @@ export interface ChaosEventWrapper { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} - * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [chaosParameters.context] - * @member {object} [chaosParameters.context.map] - * @member {string} [status] Current status of the Chaos run. - * - * - Invalid - Indicates an invalid Chaos status. All Service Fabric - * enumerations have the invalid type. - * The valus is zero. - * - Running - Indicates that Chaos is not stopped. - * - Stopped - Indicates that Chaos is not scheduling futher faults. Possible - * values include: 'Invalid', 'Running', 'Stopped' - * @member {string} [continuationToken] - * @member {array} [history] - */ -export interface ChaosReport { + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used to + * record information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. + * @member {object} [chaosParameters.chaosTargetFilter] List of cluster + * entities to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] A + * list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [chaosParameters.chaosTargetFilter.applicationInclusionList] + * A list of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. + * @member {string} [status] Current status of the Chaos run. Possible values + * include: 'Invalid', 'Running', 'Stopped' + * @member {string} [scheduleStatus] Current status of the schedule. Possible + * values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending' + */ +export interface Chaos { chaosParameters?: ChaosParameters; status?: string; + scheduleStatus?: string; +} + +/** + * @class + * Initializes a new instance of the ChaosParametersDictionaryItem class. + * @constructor + * Defines an item in ChaosParametersDictionary of the Chaos Schedule. + * + * @member {string} key The key identifying the Chaos Parameter in the + * dictionary. This key is referenced by Chaos Schedule Jobs. + * @member {object} value Defines all the parameters to configure a Chaos run. + * @member {string} [value.timeToRunInSeconds] Total time (in seconds) for + * which Chaos will run before automatically stopping. The maximum allowed + * value is 4,294,967,295 (System.UInt32.MaxValue). + * @member {number} [value.maxClusterStabilizationTimeoutInSeconds] The maximum + * amount of time to wait for all cluster entities to become stable and + * healthy. Chaos executes in iterations and at the start of each iteration it + * validates the health of cluster entities. + * During validation if a cluster entity is not stable and healthy within + * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed + * event. + * @member {number} [value.maxConcurrentFaults] MaxConcurrentFaults is the + * maximum number of concurrent faults induced per iteration. + * Chaos executes in iterations and two consecutive iterations are separated by + * a validation phase. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. + * The recommendation is to start with a value of 2 or 3 and to exercise + * caution while moving up. + * @member {boolean} [value.enableMoveReplicaFaults] Enables or disables the + * move primary and move secondary faults. + * @member {number} [value.waitTimeBetweenFaultsInSeconds] Wait time (in + * seconds) between consecutive faults within a single iteration. + * The larger the value, the lower the overlapping between faults and the + * simpler the sequence of state transitions that the cluster goes through. + * The recommendation is to start with a value between 1 and 5 and exercise + * caution while moving up. + * @member {number} [value.waitTimeBetweenIterationsInSeconds] Time-separation + * (in seconds) between two consecutive iterations of Chaos. + * The larger the value, the lower the fault injection rate. + * @member {object} [value.clusterHealthPolicy] Passed-in cluster health policy + * is used to validate health of the cluster in between Chaos iterations. If + * the cluster health is in error or if an unexpected exception happens during + * fault execution--to provide the cluster with some time to recuperate--Chaos + * will wait for 30 minutes before the next health-check. + * @member {boolean} [value.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * @member {number} [value.clusterHealthPolicy.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} [value.clusterHealthPolicy.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 {array} [value.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [value.context] Describes a map, which is a collection of + * (string, string) type key-value pairs. The map can be used to record + * information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [value.context.map] Describes a map that contains a + * collection of ChaosContextMapItem's. + * @member {object} [value.chaosTargetFilter] List of cluster entities to + * target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [value.chaosTargetFilter.nodeTypeInclusionList] A list of + * node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [value.chaosTargetFilter.applicationInclusionList] A list of + * application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. + */ +export interface ChaosParametersDictionaryItem { + key: string; + value: ChaosParameters; +} + +/** + * @class + * Initializes a new instance of the ChaosEvent class. + * @constructor + * Represents an event generated during a Chaos run. + * + * @member {date} timeStampUtc The UTC timestamp when this Chaos event was + * generated. + * @member {string} kind Polymorphic Discriminator + */ +export interface ChaosEvent { + timeStampUtc: Date; + kind: string; +} + +/** + * @class + * Initializes a new instance of the ChaosEventWrapper class. + * @constructor + * Wrapper object for Chaos event. + * + * @member {object} [chaosEvent] Represents an event generated during a Chaos + * run. + * @member {date} [chaosEvent.timeStampUtc] The UTC timestamp when this Chaos + * event was generated. + * @member {string} [chaosEvent.kind] Polymorphic Discriminator + */ +export interface ChaosEventWrapper { + chaosEvent?: ChaosEvent; +} + +/** + * @class + * Initializes a new instance of the ChaosEventsSegment class. + * @constructor + * Contains the list of Chaos events and the continuation token to get the next + * segment. + * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [history] List of Chaos events that meet the user-supplied + * criteria. + */ +export interface ChaosEventsSegment { continuationToken?: string; history?: ChaosEventWrapper[]; } +/** + * @class + * Initializes a new instance of the ChaosScheduleJobActiveDaysOfWeek class. + * @constructor + * Defines the days of the week that a Chaos Schedule Job will run for. + * + * @member {boolean} [sunday] Indicates if the Chaos Schedule Job will run on + * Sunday. Default value: false . + * @member {boolean} [monday] Indicates if the Chaos Schedule Job will run on + * Monday. Default value: false . + * @member {boolean} [tuesday] Indicates if the Chaos Schedule Job will run on + * Tuesday. Default value: false . + * @member {boolean} [wednesday] Indicates if the Chaos Schedule Job will run + * on Wednesday. Default value: false . + * @member {boolean} [thursday] Indicates if the Chaos Schedule Job will run on + * Thursday. Default value: false . + * @member {boolean} [friday] Indicates if the Chaos Schedule Job will run on + * Friday. Default value: false . + * @member {boolean} [saturday] Indicates if the Chaos Schedule Job will run on + * Saturday. Default value: false . + */ +export interface ChaosScheduleJobActiveDaysOfWeek { + sunday?: boolean; + monday?: boolean; + tuesday?: boolean; + wednesday?: boolean; + thursday?: boolean; + friday?: boolean; + saturday?: boolean; +} + +/** + * @class + * Initializes a new instance of the TimeOfDay class. + * @constructor + * Defines an hour and minute of the day specified in 24 hour time. + * + * @member {number} [hour] Represents the hour of the day. Value must be + * between 0 and 23 inclusive. + * @member {number} [minute] Represents the minute of the hour. Value must be + * between 0 to 59 inclusive. + */ +export interface TimeOfDay { + hour?: number; + minute?: number; +} + +/** + * @class + * Initializes a new instance of the TimeRange class. + * @constructor + * Defines a time range in a 24 hour day specified by a start and end time. + * + * @member {object} [startTime] Defines an hour and minute of the day specified + * in 24 hour time. + * @member {number} [startTime.hour] Represents the hour of the day. Value must + * be between 0 and 23 inclusive. + * @member {number} [startTime.minute] Represents the minute of the hour. Value + * must be between 0 to 59 inclusive. + * @member {object} [endTime] Defines an hour and minute of the day specified + * in 24 hour time. + * @member {number} [endTime.hour] Represents the hour of the day. Value must + * be between 0 and 23 inclusive. + * @member {number} [endTime.minute] Represents the minute of the hour. Value + * must be between 0 to 59 inclusive. + */ +export interface TimeRange { + startTime?: TimeOfDay; + endTime?: TimeOfDay; +} + +/** + * @class + * Initializes a new instance of the ChaosScheduleJob class. + * @constructor + * Defines a repetition rule and parameters of Chaos to be used with the Chaos + * Schedule. + * + * @member {string} [chaosParameters] A reference to which Chaos Parameters of + * the Chaos Schedule to use. + * @member {object} [days] Defines the days of the week that a Chaos Schedule + * Job will run for. + * @member {boolean} [days.sunday] Indicates if the Chaos Schedule Job will run + * on Sunday + * @member {boolean} [days.monday] Indicates if the Chaos Schedule Job will run + * on Monday + * @member {boolean} [days.tuesday] Indicates if the Chaos Schedule Job will + * run on Tuesday + * @member {boolean} [days.wednesday] Indicates if the Chaos Schedule Job will + * run on Wednesday + * @member {boolean} [days.thursday] Indicates if the Chaos Schedule Job will + * run on Thursday + * @member {boolean} [days.friday] Indicates if the Chaos Schedule Job will run + * on Friday + * @member {boolean} [days.saturday] Indicates if the Chaos Schedule Job will + * run on Saturday + * @member {array} [times] A list of Time Ranges that specify when during + * active days that this job will run. The times are interpreted as UTC. + */ +export interface ChaosScheduleJob { + chaosParameters?: string; + days?: ChaosScheduleJobActiveDaysOfWeek; + times?: TimeRange[]; +} + +/** + * @class + * Initializes a new instance of the ChaosSchedule class. + * @constructor + * Defines the schedule used by Chaos. + * + * @member {date} [startDate] The date and time Chaos will start using this + * schedule. Default value: new Date('1601-01-01T00:00:00Z') . + * @member {date} [expiryDate] The date and time Chaos will continue to use + * this schedule until. Default value: new Date('9999-12-31T23:59:59.999Z') . + * @member {array} [chaosParametersDictionary] A mapping of string names to + * Chaos Parameters to be referenced by Chaos Schedule Jobs. + * @member {array} [jobs] A list of all Chaos Schedule Jobs that will be + * automated by the schedule. + */ +export interface ChaosSchedule { + startDate?: Date; + expiryDate?: Date; + chaosParametersDictionary?: ChaosParametersDictionaryItem[]; + jobs?: ChaosScheduleJob[]; +} + +/** + * @class + * Initializes a new instance of the ChaosScheduleDescription class. + * @constructor + * Defines the Chaos Schedule used by Chaos and the version of the Chaos + * Schedule. The version value wraps back to 0 after surpassing 2,147,483,647. + * + * @member {number} [version] The version number of the Schedule. + * @member {object} [schedule] Defines the schedule used by Chaos. + * @member {date} [schedule.startDate] The date and time Chaos will start using + * this schedule. + * @member {date} [schedule.expiryDate] The date and time Chaos will continue + * to use this schedule until. + * @member {array} [schedule.chaosParametersDictionary] A mapping of string + * names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * @member {array} [schedule.jobs] A list of all Chaos Schedule Jobs that will + * be automated by the schedule. + */ +export interface ChaosScheduleDescription { + version?: number; + schedule?: ChaosSchedule; +} + /** * @class * Initializes a new instance of the ExecutingFaultsChaosEvent class. @@ -5165,7 +7184,8 @@ export interface ChaosReport { * faults for an iteration. This Chaos event contains the details of the faults * as a list of strings. * - * @member {array} [faults] + * @member {array} [faults] List of string description of the faults that Chaos + * decided to execute in an iteration. */ export interface ExecutingFaultsChaosEvent extends ChaosEvent { faults?: string[]; @@ -5177,7 +7197,8 @@ export interface ExecutingFaultsChaosEvent extends ChaosEvent { * @constructor * Describes a Chaos event that gets generated when Chaos is started. * - * @member {object} [chaosParameters] + * @member {object} [chaosParameters] Defines all the parameters to configure a + * Chaos run. * @member {string} [chaosParameters.timeToRunInSeconds] Total time (in * seconds) for which Chaos will run before automatically stopping. The maximum * allowed value is 4,294,967,295 (System.UInt32.MaxValue). @@ -5192,8 +7213,8 @@ export interface ExecutingFaultsChaosEvent extends ChaosEvent { * is the maximum number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated by * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise * caution while moving up. * @member {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or @@ -5207,7 +7228,11 @@ export interface ExecutingFaultsChaosEvent extends ChaosEvent { * @member {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] * Time-separation (in seconds) between two consecutive iterations of Chaos. * The larger the value, the lower the fault injection rate. - * @member {object} [chaosParameters.clusterHealthPolicy] + * @member {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected exception + * happens during fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. * @member {boolean} * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. @@ -5244,9 +7269,75 @@ export interface ExecutingFaultsChaosEvent extends ChaosEvent { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} - * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [chaosParameters.context] - * @member {object} [chaosParameters.context.map] + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used to + * record information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. + * @member {object} [chaosParameters.chaosTargetFilter] List of cluster + * entities to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] A + * list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} [chaosParameters.chaosTargetFilter.applicationInclusionList] + * A list of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. */ export interface StartedChaosEvent extends ChaosEvent { chaosParameters?: ChaosParameters; @@ -5259,7 +7350,9 @@ export interface StartedChaosEvent extends ChaosEvent { * Describes a Chaos event that gets generated when Chaos stops because either * the user issued a stop or the time to run was up. * - * @member {string} [reason] + * @member {string} [reason] Describes why Chaos stopped. Chaos can stop + * because of StopChaos API call or the timeToRun provided in ChaosParameters + * is over. */ export interface StoppedChaosEvent extends ChaosEvent { reason?: string; @@ -5272,11 +7365,13 @@ export interface StoppedChaosEvent extends ChaosEvent { * Describes a Chaos event that gets generated when an unexpected event occurs * in the Chaos engine. * For example, due to the cluster snapshot being inconsistent, while faulting - * a faultable entity, Chaos found that the entity was alreay faulted -- which - * would be an unexpected event. + * an entity, Chaos found that the entity was already faulted -- which would be + * an unexpected event. * - * - * @member {string} [reason] + * @member {string} [reason] Describes why TestErrorChaosEvent was generated. + * For example, Chaos tries to fault a partition but finds that the partition + * is no longer fault tolerant, then a TestErrorEvent gets generated with the + * reason stating that the partition is not fault tolerant. */ export interface TestErrorChaosEvent extends ChaosEvent { reason?: string; @@ -5288,7 +7383,10 @@ export interface TestErrorChaosEvent extends ChaosEvent { * @constructor * Chaos event corresponding to a failure during validation. * - * @member {string} [reason] + * @member {string} [reason] Describes why the ValidationFailedChaosEvent was + * generated. This may happen because more than MaxPercentUnhealthyNodes are + * unhealthy for more than MaxClusterStabilizationTimeout. This reason will be + * in the Reason property of the ValidationFailedChaosEvent as a string. */ export interface ValidationFailedChaosEvent extends ChaosEvent { reason?: string; @@ -5302,7 +7400,8 @@ export interface ValidationFailedChaosEvent extends ChaosEvent { * cluster to become ready for faulting, for example, Chaos may be waiting for * the on-going upgrade to finish. * - * @member {string} [reason] + * @member {string} [reason] Describes why the WaitingChaosEvent was generated, + * for example, due to a cluster upgrade. */ export interface WaitingChaosEvent extends ChaosEvent { reason?: string; @@ -5320,7 +7419,6 @@ export interface WaitingChaosEvent extends ChaosEvent { * - Limiting the custom capacity metrics to limit the total consumption of * this metric by the services of this application * - * * @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 @@ -5332,7 +7430,8 @@ export interface WaitingChaosEvent extends ChaosEvent { * 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 {array} [applicationMetrics] + * @member {array} [applicationMetrics] List of application capacity metric + * description. */ export interface ApplicationCapacityDescription { minimumNodes?: number; @@ -5346,11 +7445,23 @@ export interface ApplicationCapacityDescription { * @constructor * Describes a Service Fabric application. * - * @member {string} name - * @member {string} typeName - * @member {string} typeVersion - * @member {array} [parameterList] - * @member {object} [applicationCapacity] + * @member {string} name The name of the application, including the 'fabric:' + * URI scheme. + * @member {string} typeName The application type name as defined in the + * application manifest. + * @member {string} typeVersion The version of the application type as defined + * in the application manifest. + * @member {array} [parameterList] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * @member {object} [applicationCapacity] Describes capacity information for + * services of this application. This description can be used for describing + * the following. + * - Reserving the capacity for the services on the nodes + * - Limiting the total number of nodes that services of this application can + * run on + * - Limiting the custom capacity metrics to limit the total consumption of + * this metric by the services of this application * @member {number} [applicationCapacity.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 @@ -5362,7 +7473,8 @@ export interface ApplicationCapacityDescription { * 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. - * @member {array} [applicationCapacity.applicationMetrics] + * @member {array} [applicationCapacity.applicationMetrics] List of application + * capacity metric description. */ export interface ApplicationDescription { name: string; @@ -5378,11 +7490,12 @@ export interface ApplicationDescription { * @constructor * Information about a Service Fabric compose deployment. * - * @member {string} [name] - * @member {string} [applicationName] - * @member {string} [status] Possible values include: 'Invalid', - * 'Provisioning', 'Creating', 'Ready', 'Unprovisioning', 'Deleting', 'Failed', - * 'Upgrading' + * @member {string} [name] The name of the deployment. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} [status] The status of the compose deployment. Possible + * values include: 'Invalid', 'Provisioning', 'Creating', 'Ready', + * 'Unprovisioning', 'Deleting', 'Failed', 'Upgrading' * @member {string} [statusDetails] The status details of compose deployment * including failure message. */ @@ -5418,32 +7531,71 @@ export interface RegistryCredential { * @constructor * Describes the parameters for a compose deployment upgrade. * - * @member {string} deploymentName + * @member {string} deploymentName The name of the deployment. * @member {string} composeFileContent The content of the compose file that * describes the deployment to create. - * @member {object} [registryCredential] + * @member {object} [registryCredential] Credential information to connect to + * container registry. * @member {string} [registryCredential.registryUserName] The user name to * connect to container registry. * @member {string} [registryCredential.registryPassword] The password for * supplied username to connect to container registry. * @member {boolean} [registryCredential.passwordEncrypted] Indicates that * supplied container registry password is encrypted. - * @member {string} upgradeKind Possible values include: 'Invalid', 'Rolling'. - * Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {string} upgradeKind The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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} [monitoringPolicy] Describes the parameters for monitoring + * an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action to + * perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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 {boolean} [applicationHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} @@ -5459,6 +7611,7 @@ export interface RegistryCredential { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed @@ -5499,7 +7652,9 @@ export interface RegistryCredential { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. */ export interface ComposeDeploymentUpgradeDescription { deploymentName: string; @@ -5519,29 +7674,70 @@ export interface ComposeDeploymentUpgradeDescription { * @constructor * Describes the parameters for a compose deployment upgrade. * - * @member {string} [deploymentName] - * @member {string} [applicationName] - * @member {string} [upgradeState] Possible values include: 'Invalid', - * 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', + * @member {string} [deploymentName] The name of the target deployment. + * @member {string} [applicationName] The name of the target application, + * including the 'fabric:' URI scheme. + * @member {string} [upgradeState] The state of the compose deployment upgrade. + * Possible values include: 'Invalid', 'ProvisioningTarget', + * 'RollingForwardInProgress', 'RollingForwardPending', * 'UnprovisioningCurrent', 'RollingForwardCompleted', 'RollingBackInProgress', * 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed' - * @member {string} [upgradeStatusDetails] - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {boolean} [forceRestart] - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' - * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * @member {string} [upgradeStatusDetails] Additional detailed information + * about the status of the pending upgrade. + * @member {string} [upgradeKind] The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @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 {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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 {object} [monitoringPolicy] Describes the parameters for monitoring + * an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action to + * perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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 {boolean} [applicationHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} @@ -5557,6 +7753,7 @@ export interface ComposeDeploymentUpgradeDescription { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed @@ -5597,22 +7794,43 @@ export interface ComposeDeploymentUpgradeDescription { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] - * @member {string} [targetApplicationTypeVersion] - * @member {string} [upgradeDuration] - * @member {string} [currentUpgradeDomainDuration] - * @member {array} [applicationUnhealthyEvaluations] - * @member {object} [currentUpgradeDomainProgress] - * @member {string} [currentUpgradeDomainProgress.domainName] - * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] - * @member {string} [startTimestampUtc] - * @member {string} [failureTimestampUtc] - * @member {string} [failureReason] Possible values include: 'None', - * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'UpgradeTimeout' - * @member {object} [upgradeDomainProgressAtFailure] - * @member {string} [upgradeDomainProgressAtFailure.domainName] + * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. + * @member {string} [targetApplicationTypeVersion] The target application type + * version (found in the application manifest) for the application upgrade. + * @member {string} [upgradeDuration] The estimated amount of time that the + * overall upgrade elapsed. 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} [currentUpgradeDomainDuration] The estimated amount of time + * spent processing current 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 {array} [applicationUnhealthyEvaluations] List of health evaluations + * that resulted in the current aggregated health state. + * @member {object} [currentUpgradeDomainProgress] Information about the + * current in-progress upgrade domain. + * @member {string} [currentUpgradeDomainProgress.domainName] The name of the + * upgrade domain + * @member {array} [currentUpgradeDomainProgress.nodeUpgradeProgressList] List + * of upgrading nodes and their statuses + * @member {string} [startTimestampUtc] The estimated UTC datetime when the + * upgrade started. + * @member {string} [failureTimestampUtc] The estimated UTC datetime when the + * upgrade failed and FailureAction was executed. + * @member {string} [failureReason] The cause of an upgrade failure that + * resulted in FailureAction being executed. Possible values include: 'None', + * 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', + * 'OverallUpgradeTimeout' + * @member {object} [upgradeDomainProgressAtFailure] Information about the + * upgrade domain progress at the time of upgrade failure. + * @member {string} [upgradeDomainProgressAtFailure.domainName] The name of the + * upgrade domain * @member {array} [upgradeDomainProgressAtFailure.nodeUpgradeProgressList] - * @member {string} [applicationUpgradeStatusDetails] + * List of upgrading nodes and their statuses + * @member {string} [applicationUpgradeStatusDetails] Additional details of + * application upgrade including failure message. */ export interface ComposeDeploymentUpgradeProgressInfo { deploymentName?: string; @@ -5646,8 +7864,13 @@ export interface ComposeDeploymentUpgradeProgressInfo { * be obtained by executing the same query with the continuation token provided * in this list. * - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of compose deployment status information. */ export interface PagedComposeDeploymentStatusInfoList { continuationToken?: string; @@ -5660,11 +7883,11 @@ export interface PagedComposeDeploymentStatusInfoList { * @constructor * Defines description for creating a Service Fabric compose deployment. * - * - * @member {string} deploymentName + * @member {string} deploymentName The name of the deployment. * @member {string} composeFileContent The content of the compose file that * describes the deployment to create. - * @member {object} [registryCredential] + * @member {object} [registryCredential] Credential information to connect to + * container registry. * @member {string} [registryCredential.registryUserName] The user name to * connect to container registry. * @member {string} [registryCredential.registryPassword] The password for @@ -5684,12 +7907,20 @@ export interface CreateComposeDeploymentDescription { * @constructor * Information about service package deployed on a Service Fabric node. * - * @member {string} [name] + * @member {string} [name] The name of the service package as specified in the + * service manifest. * @member {string} [version] The version of the service package specified in * service manifest. - * @member {string} [status] Possible values include: 'Invalid', 'Downloading', - * 'Activating', 'Active', 'Upgrading', 'Deactivating' - * @member {string} [servicePackageActivationId] + * @member {string} [status] Specifies the status of a deployed application or + * service package on a Service Fabric node. Possible values include: + * 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', + * 'Deactivating' + * @member {string} [servicePackageActivationId] The ActivationId of a deployed + * service package. If ServicePackageActivationMode specified at the time of + * creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ export interface DeployedServicePackageInfo { name?: string; @@ -5704,43 +7935,18 @@ export interface DeployedServicePackageInfo { * @constructor * Creates a particular correlation between services. * - * @member {string} scheme Possible values include: 'Invalid', 'Affinity', - * 'AlignedAffinity', 'NonAlignedAffinity' - * @member {string} serviceName + * @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 ServiceCorrelationDescription { scheme: string; serviceName: string; } -/** - * @class - * Initializes a new instance of the ServiceLoadMetricDescription class. - * @constructor - * Specifies a metric to load balance a service during runtime. - * - * @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. - */ -export interface ServiceLoadMetricDescription { - name: string; - weight?: string; - primaryDefaultLoad?: number; - secondaryDefaultLoad?: number; - defaultLoad?: number; -} - /** * @class * Initializes a new instance of the PartitionSchemeDescription class. @@ -5789,10 +7995,10 @@ export interface SingletonPartitionSchemeDescription extends PartitionSchemeDesc * @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’ + * should be split between the partitions. * @member {string} highKey String indicating the upper bound of the partition * key range that - * should be split between the partition ‘Count’ + * should be split between the partitions. */ export interface UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { count: number; @@ -5800,6 +8006,48 @@ export interface UniformInt64RangePartitionSchemeDescription extends PartitionSc highKey: string; } +/** + * @class + * Initializes a new instance of the ScalingTriggerDescription class. + * @constructor + * Describes the trigger for performing a scaling operation. + * + * @member {string} kind Polymorphic Discriminator + */ +export interface ScalingTriggerDescription { + kind: string; +} + +/** + * @class + * Initializes a new instance of the ScalingMechanismDescription class. + * @constructor + * Describes the mechanism for performing a scaling operation. + * + * @member {string} kind Polymorphic Discriminator + */ +export interface ScalingMechanismDescription { + kind: string; +} + +/** + * @class + * Initializes a new instance of the ScalingPolicyDescription class. + * @constructor + * Describes how the scaling should be performed + * + * @member {object} scalingTrigger Specifies the trigger associated with this + * scaling policy + * @member {string} [scalingTrigger.kind] Polymorphic Discriminator + * @member {object} scalingMechanism Specifies the mechanism associated with + * this scaling policy + * @member {string} [scalingMechanism.kind] Polymorphic Discriminator + */ +export interface ScalingPolicyDescription { + scalingTrigger: ScalingTriggerDescription; + scalingMechanism: ScalingMechanismDescription; +} + /** * @class * Initializes a new instance of the ServiceDescription class. @@ -5807,11 +8055,17 @@ export interface UniformInt64RangePartitionSchemeDescription extends PartitionSc * A ServiceDescription contains all of the information necessary to create a * service. * - * @member {string} [applicationName] - * @member {string} serviceName - * @member {string} serviceTypeName - * @member {array} [initializationData] - * @member {object} partitionDescription + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} serviceName The full name of the service with 'fabric:' URI + * scheme. + * @member {string} serviceTypeName Name of the service type as specified in + * the service manifest. + * @member {array} [initializationData] The initialization data as an array of + * bytes. Initialization data is passed to service instances or replicas when + * they are created. + * @member {object} partitionDescription The partition description as an + * object. * @member {string} [partitionDescription.partitionScheme] Polymorphic * Discriminator * @member {string} [placementConstraints] The placement constraints as a @@ -5819,17 +8073,19 @@ export interface UniformInt64RangePartitionSchemeDescription extends PartitionSc * 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] The correlation scheme. + * @member {array} [serviceLoadMetrics] The service load metrics. + * @member {array} [servicePlacementPolicies] The service placement policies. + * @member {string} [defaultMoveCost] The move cost for the service. Possible + * values include: 'Zero', 'Low', 'Medium', 'High' * @member {boolean} [isDefaultMoveCostSpecified] Indicates if the * DefaultMoveCost property is specified. - * @member {string} [servicePackageActivationMode] Possible values include: + * @member {string} [servicePackageActivationMode] The activation mode of + * service package to be used for a service. Possible values include: * 'SharedProcess', 'ExclusiveProcess' * @member {string} [serviceDnsName] The DNS name of the service. It requires * the DNS system service to be enabled in Service Fabric cluster. + * @member {array} [scalingPolicies] Scaling policies for this service. * @member {string} serviceKind Polymorphic Discriminator */ export interface ServiceDescription { @@ -5846,6 +8102,7 @@ export interface ServiceDescription { isDefaultMoveCostSpecified?: boolean; servicePackageActivationMode?: string; serviceDnsName?: string; + scalingPolicies?: ScalingPolicyDescription[]; serviceKind: string; } @@ -5917,7 +8174,6 @@ export interface StatelessServiceDescription extends ServiceDescription { * Depending on the role of the replicator, the properties in this type imply * different meanings. * - * * @member {number} [queueUtilizationPercentage] Represents the utilization of * the queue. A value of 0 indicates that the queue is empty and a value of 100 * indicates the queue is full. @@ -5959,7 +8215,6 @@ export interface ReplicatorQueueStatus { * replication/copy queue utilization, last acknowledgement received timestamp, * etc. * - * * @member {string} kind Polymorphic Discriminator */ export interface ReplicatorStatus { @@ -5997,7 +8252,9 @@ export interface RemoteReplicatorAcknowledgementDetail { * Provides details about the remote replicators from the primary replicator's * point of view. * - * @member {object} [replicationStreamAcknowledgementDetail] + * @member {object} [replicationStreamAcknowledgementDetail] Details about the + * acknowledgements for operations that are part of the replication stream + * data. * @member {string} * [replicationStreamAcknowledgementDetail.averageReceiveDuration] Represents * the average duration it takes for the remote replicator to receive an @@ -6012,7 +8269,8 @@ export interface RemoteReplicatorAcknowledgementDetail { * [replicationStreamAcknowledgementDetail.receivedAndNotAppliedCount] * Represents the number of operations received and not yet applied by a remote * replicator. - * @member {object} [copyStreamAcknowledgementDetail] + * @member {object} [copyStreamAcknowledgementDetail] Details about the + * acknowledgements for operations that are part of the copy stream data. * @member {string} [copyStreamAcknowledgementDetail.averageReceiveDuration] * Represents the average duration it takes for the remote replicator to * receive an operation. @@ -6037,8 +8295,8 @@ export interface RemoteReplicatorAcknowledgementStatus { * Represents the state of the secondary replicator from the primary * replicator’s point of view. * - * - * @member {string} [replicaId] + * @member {string} [replicaId] Represents the replica ID of the remote + * secondary replicator. * @member {date} [lastAcknowledgementProcessedTimeUtc] The last timestamp (in * UTC) when an acknowledgement from the secondary replicator was processed on * the primary. @@ -6059,9 +8317,12 @@ export interface RemoteReplicatorAcknowledgementStatus { * sequence number that the secondary has applied to its state. * A value of -1 implies that the secondary has applied all copy operations and * the copy process is complete. - * @member {object} [remoteReplicatorAcknowledgementStatus] + * @member {object} [remoteReplicatorAcknowledgementStatus] Represents the + * acknowledgment status for the remote secondary replicator. * @member {object} * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail] + * Details about the acknowledgements for operations that are part of the + * replication stream data. * @member {string} * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.averageReceiveDuration] * Represents the average duration it takes for the remote replicator to @@ -6079,6 +8340,8 @@ export interface RemoteReplicatorAcknowledgementStatus { * replicator. * @member {object} * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail] + * Details about the acknowledgements for operations that are part of the copy + * stream data. * @member {string} * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.averageReceiveDuration] * Represents the average duration it takes for the remote replicator to @@ -6110,7 +8373,11 @@ export interface RemoteReplicatorStatus { * @class * Initializes a new instance of the PrimaryReplicatorStatus class. * @constructor - * @member {object} [replicationQueueStatus] + * Provides statistics about the Service Fabric Replicator, when it is + * functioning in a Primary role. + * + * @member {object} [replicationQueueStatus] Details about the replication + * queue on the primary replicator. * @member {number} [replicationQueueStatus.queueUtilizationPercentage] * Represents the utilization of the queue. A value of 0 indicates that the * queue is empty and a value of 100 indicates the queue is full. @@ -6134,7 +8401,8 @@ export interface RemoteReplicatorStatus { * of the in-order operation received from the primary. * @member {string} [replicationQueueStatus.lastSequenceNumber] Represents the * latest sequence number of the operation that is available in the queue. - * @member {array} [remoteReplicators] + * @member {array} [remoteReplicators] The status of all the active and idle + * secondary replicators that the primary is aware of. */ export interface PrimaryReplicatorStatus extends ReplicatorStatus { replicationQueueStatus?: ReplicatorQueueStatus; @@ -6145,7 +8413,11 @@ export interface PrimaryReplicatorStatus extends ReplicatorStatus { * @class * Initializes a new instance of the SecondaryReplicatorStatus class. * @constructor - * @member {object} [replicationQueueStatus] + * Provides statistics about the Service Fabric Replicator, when it is + * functioning in a ActiveSecondary role. + * + * @member {object} [replicationQueueStatus] Details about the replication + * queue on the secondary replicator. * @member {number} [replicationQueueStatus.queueUtilizationPercentage] * Represents the utilization of the queue. A value of 0 indicates that the * queue is empty and a value of 100 indicates the queue is full. @@ -6175,7 +8447,8 @@ export interface PrimaryReplicatorStatus extends ReplicatorStatus { * message was never received. * @member {boolean} [isInBuild] Value that indicates whether the replica is * currently being built. - * @member {object} [copyQueueStatus] + * @member {object} [copyQueueStatus] Details about the copy queue on the + * secondary replicator. * @member {number} [copyQueueStatus.queueUtilizationPercentage] Represents the * utilization of the queue. A value of 0 indicates that the queue is empty and * a value of 100 indicates the queue is full. @@ -6261,13 +8534,20 @@ export interface LoadMetricReportInfo { * @constructor * Information about a Service Fabric service replica deployed on a node. * - * @member {string} [serviceName] - * @member {uuid} [partitionId] - * @member {string} [currentServiceOperation] Possible values include: - * 'Unknown', 'None', 'Open', 'ChangeRole', 'Close', 'Abort' + * @member {string} [serviceName] Full hierarchical name of the service in URI + * format starting with `fabric:`. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for the + * lifetime of the service. If the same service was deleted and recreated the + * IDs of its partitions would be different. + * @member {string} [currentServiceOperation] Specifies the current active + * life-cycle operation on a stateful service replica or stateless service + * instance. Possible values include: 'Unknown', 'None', 'Open', 'ChangeRole', + * 'Close', 'Abort' * @member {date} [currentServiceOperationStartTimeUtc] The start time of the * current service operation in UTC format. - * @member {array} [reportedLoad] + * @member {array} [reportedLoad] List of load reported by replica. * @member {string} serviceKind Polymorphic Discriminator */ export interface DeployedServiceReplicaDetailInfo { @@ -6322,21 +8602,35 @@ export interface KeyValueStoreReplicaStatus extends ReplicaStatusBase { * @class * Initializes a new instance of the DeployedStatefulServiceReplicaDetailInfo class. * @constructor - * Information about a stateful replica running in a code package. Please note + * Information about a stateful replica running in a code package. Note * DeployedServiceReplicaQueryResult will contain duplicate data like * ServiceKind, ServiceName, PartitionId and replicaId. * - * @member {string} [replicaId] - * @member {string} [currentReplicatorOperation] Possible values include: + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId is + * used by Service Fabric to uniquely identify a replica of a partition. It is + * unique within a partition and does not change for the lifetime of the + * replica. If a replica gets dropped and another replica gets created on the + * same node for the same partition, it will get a different value for the id. + * Sometimes the id of a stateless service instance is also referred as a + * replica id. + * @member {string} [currentReplicatorOperation] Specifies the operation + * currently being executed by the Replicator. Possible values include: * 'Invalid', 'None', 'Open', 'ChangeRole', 'UpdateEpoch', 'Close', 'Abort', * 'OnDataLoss', 'WaitForCatchup', 'Build' - * @member {string} [readStatus] Possible values include: 'Invalid', 'Granted', - * 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum' - * @member {string} [writeStatus] Possible values include: 'Invalid', - * 'Granted', 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum' - * @member {object} [replicatorStatus] + * @member {string} [readStatus] Specifies the access status of the partition. + * Possible values include: 'Invalid', 'Granted', 'ReconfigurationPending', + * 'NotPrimary', 'NoWriteQuorum' + * @member {string} [writeStatus] Specifies the access status of the partition. + * Possible values include: 'Invalid', 'Granted', 'ReconfigurationPending', + * 'NotPrimary', 'NoWriteQuorum' + * @member {object} [replicatorStatus] Represents a base class for primary or + * secondary replicator status. + * Contains information about the service fabric replicator like the + * replication/copy queue utilization, last acknowledgement received timestamp, + * etc. * @member {string} [replicatorStatus.kind] Polymorphic Discriminator - * @member {object} [replicaStatus] + * @member {object} [replicaStatus] Key value store related information for the + * replica. * @member {string} [replicaStatus.databaseRowCountEstimate] Value indicating * the estimated number of rows in the underlying database. * @member {string} [replicaStatus.databaseLogicalSizeEstimate] Value @@ -6349,24 +8643,36 @@ export interface KeyValueStoreReplicaStatus extends ReplicaStatusBase { * there is no pending callback. * @member {string} [replicaStatus.statusDetails] Value indicating the current * status details of the replica. - * @member {object} [deployedServiceReplicaQueryResult] - * @member {string} [deployedServiceReplicaQueryResult.replicaId] - * @member {string} [deployedServiceReplicaQueryResult.replicaRole] Possible - * values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', - * 'ActiveSecondary' + * @member {object} [deployedServiceReplicaQueryResult] Information about a + * stateful service replica deployed on a node. + * @member {string} [deployedServiceReplicaQueryResult.replicaId] Id of a + * stateful service replica. ReplicaId is used by Service Fabric to uniquely + * identify a replica of a partition. It is unique within a partition and does + * not change for the lifetime of the replica. If a replica gets dropped and + * another replica gets created on the same node for the same partition, it + * will get a different value for the id. Sometimes the id of a stateless + * service instance is also referred as a replica id. + * @member {string} [deployedServiceReplicaQueryResult.replicaRole] The role of + * a replica of a stateful service. Possible values include: 'Unknown', 'None', + * 'Primary', 'IdleSecondary', 'ActiveSecondary' * @member {object} - * [deployedServiceReplicaQueryResult.reconfigurationInformation] + * [deployedServiceReplicaQueryResult.reconfigurationInformation] Information + * about current reconfiguration like phase, type, previous configuration role + * of replica and reconfiguration start date time. * @member {string} * [deployedServiceReplicaQueryResult.reconfigurationInformation.previousConfigurationRole] - * Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', - * 'ActiveSecondary' + * Replica role before reconfiguration started. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' * @member {string} * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationPhase] - * Possible values include: 'Unknown', 'None', 'Phase0', 'Phase1', 'Phase2', - * 'Phase3', 'Phase4', 'AbortPhaseZero' + * Current phase of ongoing reconfiguration. If no reconfiguration is taking + * place then this value will be "None". Possible values include: 'Unknown', + * 'None', 'Phase0', 'Phase1', 'Phase2', 'Phase3', 'Phase4', 'AbortPhaseZero' * @member {string} * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationType] - * Possible values include: 'Unknown', 'SwapPrimary', 'Failover', 'Other' + * Type of current ongoing reconfiguration. If no reconfiguration is taking + * place then this value will be "None". Possible values include: 'Unknown', + * 'SwapPrimary', 'Failover', 'Other' * @member {date} * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationStartTimeUtc] * Start time (in UTC) of the ongoing reconfiguration. If no reconfiguration is @@ -6386,13 +8692,23 @@ export interface DeployedStatefulServiceReplicaDetailInfo extends DeployedServic * @class * Initializes a new instance of the DeployedStatelessServiceInstanceDetailInfo class. * @constructor - * Information about a stateless instance running in a code package. Please - * note that DeployedServiceReplicaQueryResult will contain duplicate data like + * Information about a stateless instance running in a code package. Note that + * DeployedServiceReplicaQueryResult will contain duplicate data like * ServiceKind, ServiceName, PartitionId and InstanceId. * - * @member {string} [instanceId] - * @member {object} [deployedServiceReplicaQueryResult] - * @member {string} [deployedServiceReplicaQueryResult.instanceId] + * @member {string} [instanceId] Id of a stateless service instance. InstanceId + * is used by Service Fabric to uniquely identify an instance of a partition of + * a stateless service. It is unique within a partition and does not change for + * the lifetime of the instance. If the instance has failed over on the same or + * different node, it will get a different value for the InstanceId. + * @member {object} [deployedServiceReplicaQueryResult] Information about a + * stateless service instance deployed on a node. + * @member {string} [deployedServiceReplicaQueryResult.instanceId] Id of a + * stateless service instance. InstanceId is used by Service Fabric to uniquely + * identify an instance of a partition of a stateless service. It is unique + * within a partition and does not change for the lifetime of the instance. If + * the instance has failed over on the same or different node, it will get a + * different value for the InstanceId. */ export interface DeployedStatelessServiceInstanceDetailInfo extends DeployedServiceReplicaDetailInfo { instanceId?: string; @@ -6436,16 +8752,19 @@ export interface DeployedStatelessServiceInstanceDetailInfo extends DeployedServ * 256. * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value * is 512. + * - ScalingPolicy - Indicates the ScalingPolicies property is set. The value + * is 1024. * @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} [loadMetrics] - * @member {array} [servicePlacementPolicies] - * @member {string} [defaultMoveCost] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' + * @member {array} [correlationScheme] The correlation scheme. + * @member {array} [loadMetrics] The service load metrics. + * @member {array} [servicePlacementPolicies] The service placement policies. + * @member {string} [defaultMoveCost] The move cost for the service. Possible + * values include: 'Zero', 'Low', 'Medium', 'High' + * @member {array} [scalingPolicies] Scaling policies for this service. * @member {string} serviceKind Polymorphic Discriminator */ export interface ServiceUpdateDescription { @@ -6455,6 +8774,7 @@ export interface ServiceUpdateDescription { loadMetrics?: ServiceLoadMetricDescription[]; servicePlacementPolicies?: ServicePlacementPolicyDescription[]; defaultMoveCost?: string; + scalingPolicies?: ScalingPolicyDescription[]; serviceKind: string; } @@ -6501,14 +8821,18 @@ export interface StatelessServiceUpdateDescription extends ServiceUpdateDescript * @constructor * Information about the version of image store file. * - * @member {string} [versionNumber] The current iamge store version number for + * @member {string} [versionNumber] The current image store version number for * the file is used in image store for checking whether it need to be updated. * @member {string} [epochDataLossNumber] The epoch data loss number of image - * store file is used to indicate the status of data loss. + * store replica when this file entry was updated or created. + * @member {string} [epochConfigurationNumber] The epoch configuration version + * number of the image store replica when this file entry was created or + * updated. */ export interface FileVersion { versionNumber?: string; epochDataLossNumber?: string; + epochConfigurationNumber?: string; } /** @@ -6518,12 +8842,16 @@ export interface FileVersion { * Information about a image store file. * * @member {string} [fileSize] The size of file in bytes. - * @member {object} [fileVersion] - * @member {string} [fileVersion.versionNumber] The current iamge store version + * @member {object} [fileVersion] Information about the version of image store + * file. + * @member {string} [fileVersion.versionNumber] The current image store version * number for the file is used in image store for checking whether it need to * be updated. * @member {string} [fileVersion.epochDataLossNumber] The epoch data loss - * number of image store file is used to indicate the status of data loss. + * number of image store replica when this file entry was updated or created. + * @member {string} [fileVersion.epochConfigurationNumber] The epoch + * configuration version number of the image store replica when this file entry + * was created or updated. * @member {date} [modifiedDate] The date and time when the image store file * was last modified. * @member {string} [storeRelativePath] The file path relative to the image @@ -6540,11 +8868,12 @@ export interface FileInfo { * @class * Initializes a new instance of the FolderInfo class. * @constructor - * Information about a image store folder. It inclues how many files this + * Information about a image store folder. It includes how many files this * folder contains and its image store relative path. * - * @member {string} [storeRelativePath] - * @member {uuid} [fileCount] The number of files from within the image store + * @member {string} [storeRelativePath] The remote location within image store. + * This path is relative to the image store root. + * @member {string} [fileCount] The number of files from within the image store * folder. */ export interface FolderInfo { @@ -6560,7 +8889,7 @@ export interface FolderInfo { * * @member {array} [storeFiles] The list of image store file info objects * represents files found under the given image store relative path. - * @member {array} [storeFolders] The list of image store folder info objectes + * @member {array} [storeFolders] The list of image store folder info objects * represents subfolders found under the given image store relative path. */ export interface ImageStoreContent { @@ -6598,14 +8927,29 @@ export interface ImageStoreCopyDescription { * @class * Initializes a new instance of the RestartDeployedCodePackageDescription class. * @constructor - * Defines description for restarting a deloyed code package on Service Fabric + * Defines description for restarting a deployed code package on Service Fabric * node. * - * - * @member {string} serviceManifestName - * @member {string} [servicePackageActivationId] - * @member {string} codePackageName - * @member {string} codePackageInstanceId + * @member {string} serviceManifestName The name of service manifest that + * specified this code package. + * @member {string} [servicePackageActivationId] The ActivationId of a deployed + * service package. If ServicePackageActivationMode specified at the time of + * creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * @member {string} codePackageName The name of the code package defined in the + * service manifest. + * @member {string} codePackageInstanceId The instance ID for currently running + * entry point. For a code package setup entry point (if specified) runs first + * and after it finishes main entry point is started. + * Each time entry point executable is run, its instance ID will change. If 0 + * is passed in as the code package instance ID, the API will restart the code + * package with whatever instance ID it is currently running. + * If an instance ID other than 0 is passed in, the API will restart the code + * package only if the current Instance ID matches the passed in instance ID. + * Note, passing in the exact instance ID (not 0) in the API is safer, because + * if ensures at most one restart of the code package. */ export interface RestartDeployedCodePackageDescription { serviceManifestName: string; @@ -6621,12 +8965,21 @@ export interface RestartDeployedCodePackageDescription { * Information about service type deployed on a node, information such as the * status of the service type registration on a node. * - * @member {string} [serviceTypeName] - * @member {string} [serviceManifestName] - * @member {string} [codePackageName] - * @member {string} [status] Possible values include: 'Invalid', 'Disabled', - * 'Enabled', 'Registered' - * @member {string} [servicePackageActivationId] + * @member {string} [serviceTypeName] Name of the service type as specified in + * the service manifest. + * @member {string} [serviceManifestName] The name of the service manifest in + * which this service type is defined. + * @member {string} [codePackageName] The name of the code package that + * registered the service type. + * @member {string} [status] The status of the service type registration on the + * node. Possible values include: 'Invalid', 'Disabled', 'Enabled', + * 'Registered' + * @member {string} [servicePackageActivationId] The ActivationId of a deployed + * service package. If ServicePackageActivationMode specified at the time of + * creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. */ export interface DeployedServiceTypeInfo { serviceTypeName?: string; @@ -6642,7 +8995,8 @@ export interface DeployedServiceTypeInfo { * @constructor * Endpoint of a resolved service partition. * - * @member {string} [kind] Possible values include: 'Invalid', 'Stateless', + * @member {string} [kind] The role of the replica where the endpoint is + * reported. Possible values include: 'Invalid', 'Stateless', * 'StatefulPrimary', 'StatefulSecondary' * @member {string} [address] The address of the endpoint. If the endpoint has * multiple listeners the address is a JSON object with one property per @@ -6659,12 +9013,19 @@ export interface ResolvedServiceEndpoint { * @constructor * Information about a service partition and its associated endpoints. * - * @member {string} name - * @member {object} partitionInformation - * @member {uuid} [partitionInformation.id] + * @member {string} name The full name of the service with 'fabric:' URI + * scheme. + * @member {object} partitionInformation A representation of the resolved + * partition. + * @member {uuid} [partitionInformation.id] An internal ID used by Service + * Fabric to uniquely identify a partition. This is a randomly generated GUID + * when the service was created. The partition ID is unique and does not change + * for the lifetime of the service. If the same service was deleted and + * recreated the IDs of its partitions would be different. * @member {string} [partitionInformation.servicePartitionKind] Polymorphic * Discriminator - * @member {array} endpoints + * @member {array} endpoints List of resolved service endpoints of a service + * partition. * @member {string} version The version of this resolved service partition * result. This version should be passed in the next time the ResolveService * call is made via the PreviousRspVersion query parameter. @@ -6683,8 +9044,13 @@ export interface ResolvedServicePartition { * This class returns information about the partition that the user-induced * operation acted upon. * - * @member {string} [serviceName] - * @member {uuid} [partitionId] + * @member {string} [serviceName] The name of the service the partition belongs + * to. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for the + * lifetime of the service. If the same service was deleted and recreated the + * IDs of its partitions would be different. */ export interface SelectedPartition { serviceName?: string; @@ -6700,9 +9066,15 @@ export interface SelectedPartition { * * @member {number} [errorCode] If OperationState is Completed, this is 0. If * OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [selectedPartition] - * @member {string} [selectedPartition.serviceName] - * @member {uuid} [selectedPartition.partitionId] + * @member {object} [selectedPartition] This class returns information about + * the partition that the user-induced operation acted upon. + * @member {string} [selectedPartition.serviceName] The name of the service the + * partition belongs to. + * @member {uuid} [selectedPartition.partitionId] An internal ID used by + * Service Fabric to uniquely identify a partition. This is a randomly + * generated GUID when the service was created. The partition ID is unique and + * does not change for the lifetime of the service. If the same service was + * deleted and recreated the IDs of its partitions would be different. */ export interface InvokeDataLossResult { errorCode?: number; @@ -6718,9 +9090,15 @@ export interface InvokeDataLossResult { * * @member {number} [errorCode] If OperationState is Completed, this is 0. If * OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [selectedPartition] - * @member {string} [selectedPartition.serviceName] - * @member {uuid} [selectedPartition.partitionId] + * @member {object} [selectedPartition] This class returns information about + * the partition that the user-induced operation acted upon. + * @member {string} [selectedPartition.serviceName] The name of the service the + * partition belongs to. + * @member {uuid} [selectedPartition.partitionId] An internal ID used by + * Service Fabric to uniquely identify a partition. This is a randomly + * generated GUID when the service was created. The partition ID is unique and + * does not change for the lifetime of the service. If the same service was + * deleted and recreated the IDs of its partitions would be different. */ export interface InvokeQuorumLossResult { errorCode?: number; @@ -6734,7 +9112,7 @@ export interface InvokeQuorumLossResult { * Contains information about a node that was targeted by a user-induced * operation. * - * @member {string} [nodeName] + * @member {string} [nodeName] The name of a Service Fabric node. * @member {string} [nodeInstanceId] The node instance id. */ export interface NodeResult { @@ -6751,8 +9129,9 @@ export interface NodeResult { * * @member {number} [errorCode] If OperationState is Completed, this is 0. If * OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [nodeResult] - * @member {string} [nodeResult.nodeName] + * @member {object} [nodeResult] Contains information about a node that was + * targeted by a user-induced operation. + * @member {string} [nodeResult.nodeName] The name of a Service Fabric node. * @member {string} [nodeResult.nodeInstanceId] The node instance id. */ export interface NodeTransitionResult { @@ -6769,15 +9148,18 @@ export interface NodeTransitionResult { * valid until OperationState * is Completed or Faulted. * - * - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [nodeTransitionResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [nodeTransitionResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [nodeTransitionResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [nodeTransitionResult.nodeResult] - * @member {string} [nodeTransitionResult.nodeResult.nodeName] + * @member {object} [nodeTransitionResult.nodeResult] Contains information + * about a node that was targeted by a user-induced operation. + * @member {string} [nodeTransitionResult.nodeResult.nodeName] The name of a + * Service Fabric node. * @member {string} [nodeTransitionResult.nodeResult.nodeInstanceId] The node * instance id. */ @@ -6793,11 +9175,13 @@ export interface NodeTransitionProgress { * Contains the OperationId, OperationState, and OperationType for user-induced * operations. * - * @member {uuid} [operationId] - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {string} [type] Possible values include: 'Invalid', - * 'PartitionDataLoss', 'PartitionQuorumLoss', 'PartitionRestart', + * @member {uuid} [operationId] A GUID that identifies a call to this API. + * This is also passed into the corresponding GetProgress API. + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {string} [type] The type of the operation. Possible values include: + * 'Invalid', 'PartitionDataLoss', 'PartitionQuorumLoss', 'PartitionRestart', * 'NodeTransition' */ export interface OperationStatus { @@ -6812,15 +9196,24 @@ export interface OperationStatus { * @constructor * Information about a partition data loss user-induced operation. * - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [invokeDataLossResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [invokeDataLossResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [invokeDataLossResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [invokeDataLossResult.selectedPartition] - * @member {string} [invokeDataLossResult.selectedPartition.serviceName] - * @member {uuid} [invokeDataLossResult.selectedPartition.partitionId] + * @member {object} [invokeDataLossResult.selectedPartition] This class returns + * information about the partition that the user-induced operation acted upon. + * @member {string} [invokeDataLossResult.selectedPartition.serviceName] The + * name of the service the partition belongs to. + * @member {uuid} [invokeDataLossResult.selectedPartition.partitionId] An + * internal ID used by Service Fabric to uniquely identify a partition. This is + * a randomly generated GUID when the service was created. The partition ID is + * unique and does not change for the lifetime of the service. If the same + * service was deleted and recreated the IDs of its partitions would be + * different. */ export interface PartitionDataLossProgress { state?: string; @@ -6833,15 +9226,25 @@ export interface PartitionDataLossProgress { * @constructor * Information about a partition quorum loss user-induced operation. * - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [invokeQuorumLossResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [invokeQuorumLossResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [invokeQuorumLossResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [invokeQuorumLossResult.selectedPartition] - * @member {string} [invokeQuorumLossResult.selectedPartition.serviceName] - * @member {uuid} [invokeQuorumLossResult.selectedPartition.partitionId] + * @member {object} [invokeQuorumLossResult.selectedPartition] This class + * returns information about the partition that the user-induced operation + * acted upon. + * @member {string} [invokeQuorumLossResult.selectedPartition.serviceName] The + * name of the service the partition belongs to. + * @member {uuid} [invokeQuorumLossResult.selectedPartition.partitionId] An + * internal ID used by Service Fabric to uniquely identify a partition. This is + * a randomly generated GUID when the service was created. The partition ID is + * unique and does not change for the lifetime of the service. If the same + * service was deleted and recreated the IDs of its partitions would be + * different. */ export interface PartitionQuorumLossProgress { state?: string; @@ -6857,9 +9260,15 @@ export interface PartitionQuorumLossProgress { * * @member {number} [errorCode] If OperationState is Completed, this is 0. If * OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [selectedPartition] - * @member {string} [selectedPartition.serviceName] - * @member {uuid} [selectedPartition.partitionId] + * @member {object} [selectedPartition] This class returns information about + * the partition that the user-induced operation acted upon. + * @member {string} [selectedPartition.serviceName] The name of the service the + * partition belongs to. + * @member {uuid} [selectedPartition.partitionId] An internal ID used by + * Service Fabric to uniquely identify a partition. This is a randomly + * generated GUID when the service was created. The partition ID is unique and + * does not change for the lifetime of the service. If the same service was + * deleted and recreated the IDs of its partitions would be different. */ export interface RestartPartitionResult { errorCode?: number; @@ -6872,15 +9281,25 @@ export interface RestartPartitionResult { * @constructor * Information about a partition restart user-induced operation. * - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [restartPartitionResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [restartPartitionResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [restartPartitionResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [restartPartitionResult.selectedPartition] - * @member {string} [restartPartitionResult.selectedPartition.serviceName] - * @member {uuid} [restartPartitionResult.selectedPartition.partitionId] + * @member {object} [restartPartitionResult.selectedPartition] This class + * returns information about the partition that the user-induced operation + * acted upon. + * @member {string} [restartPartitionResult.selectedPartition.serviceName] The + * name of the service the partition belongs to. + * @member {uuid} [restartPartitionResult.selectedPartition.partitionId] An + * internal ID used by Service Fabric to uniquely identify a partition. This is + * a randomly generated GUID when the service was created. The partition ID is + * unique and does not change for the lifetime of the service. If the same + * service was deleted and recreated the IDs of its partitions would be + * different. */ export interface PartitionRestartProgress { state?: string; @@ -6895,8 +9314,9 @@ export interface PartitionRestartProgress { * * @member {string} [sharedPackageName] The name of code, configuration or data * package that should be shared. - * @member {string} [packageSharingScope] Possible values include: 'None', - * 'All', 'Code', 'Config', 'Data' + * @member {string} [packageSharingScope] Represents the scope for + * PackageSharingPolicy. This is specified during DeployServicePackageToNode + * operation. Possible values include: 'None', 'All', 'Code', 'Config', 'Data' */ export interface PackageSharingPolicyInfo { sharedPackageName?: string; @@ -6910,12 +9330,15 @@ export interface PackageSharingPolicyInfo { * Defines description for downloading packages associated with a service * manifest to image cache on a Service Fabric node. * - * - * @member {string} serviceManifestName - * @member {string} applicationTypeName - * @member {string} applicationTypeVersion - * @member {string} nodeName - * @member {array} [packageSharingPolicy] + * @member {string} serviceManifestName The name of service manifest whose + * packages need to be downloaded. + * @member {string} applicationTypeName The application type name as defined in + * the application manifest. + * @member {string} applicationTypeVersion The version of the application type + * as defined in the application manifest. + * @member {string} nodeName The name of a Service Fabric node. + * @member {array} [packageSharingPolicy] List of package sharing policy + * information. */ export interface DeployServicePackageToNodeDescription { serviceManifestName: string; @@ -6945,10 +9368,13 @@ export interface ResumeApplicationUpgradeDescription { * @constructor * Describes the parameters for updating an ongoing application upgrade. * - * @member {string} name - * @member {string} upgradeKind Possible values include: 'Invalid', 'Rolling'. - * Default value: 'Rolling' . - * @member {object} [applicationHealthPolicy] + * @member {string} name The name of the application, including the 'fabric:' + * URI scheme. + * @member {string} upgradeKind The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {object} [applicationHealthPolicy] Defines a health policy used to + * evaluate the health of an application or one of its children entities. * @member {boolean} [applicationHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} @@ -6964,6 +9390,7 @@ export interface ResumeApplicationUpgradeDescription { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * @member {number} * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed @@ -7004,19 +9431,59 @@ export interface ResumeApplicationUpgradeDescription { * service type. * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] - * @member {object} [updateDescription] - * @member {string} [updateDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' - * @member {boolean} [updateDescription.forceRestart] + * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. + * @member {object} [updateDescription] Describes the parameters for updating a + * rolling upgrade of application or cluster. + * @member {string} [updateDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {boolean} [updateDescription.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 {number} [updateDescription.replicaSetCheckTimeoutInMilliseconds] - * @member {string} [updateDescription.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * 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 {string} [updateDescription.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} [updateDescription.healthCheckStableDurationInMilliseconds] + * 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} [updateDescription.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [updateDescription.upgradeTimeoutInMilliseconds] - * @member {string} [updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [updateDescription.upgradeTimeoutInMilliseconds] 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} [updateDescription.upgradeDomainTimeoutInMilliseconds] 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 ApplicationUpgradeUpdateDescription { name: string; @@ -7027,385 +9494,3982 @@ export interface ApplicationUpgradeUpdateDescription { /** * @class - * Initializes a new instance of the NodeImpact class. + * Initializes a new instance of the NameDescription class. * @constructor - * Describes the expected impact of a repair to a particular node. + * Describes a Service Fabric name. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {string} name The Service Fabric name, including the 'fabric:' URI + * scheme. + */ +export interface NameDescription { + name: string; +} + +/** + * @class + * Initializes a new instance of the PagedSubNameInfoList class. + * @constructor + * A paged list of Service Fabric names. The list is paged when all of the + * results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {boolean} [isConsistent] Indicates whether any name under the given + * name has been modified during the enumeration. If there was a modification, + * this property value is false. + * @member {array} [subNames] List of the child names. + */ +export interface PagedSubNameInfoList { + continuationToken?: string; + isConsistent?: boolean; + subNames?: string[]; +} + +/** + * @class + * Initializes a new instance of the PropertyValue class. + * @constructor + * Describes a Service Fabric property value. * - * @member {string} nodeName The name of the impacted node. - * @member {string} [impactLevel] The level of impact expected. Possible values - * include: 'Invalid', 'None', 'Restart', 'RemoveData', 'RemoveNode' + * @member {string} kind Polymorphic Discriminator */ -export interface NodeImpact { - nodeName: string; - impactLevel?: string; +export interface PropertyValue { + kind: string; } /** * @class - * Initializes a new instance of the RepairImpactDescriptionBase class. + * Initializes a new instance of the BinaryPropertyValue class. * @constructor - * Describes the expected impact of executing a repair task. + * Describes a Service Fabric property value of type Binary. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {array} data Array of bytes to be sent as an integer array. Each + * element of array is a number between 0 and 255. + */ +export interface BinaryPropertyValue extends PropertyValue { + data: number[]; +} + +/** + * @class + * Initializes a new instance of the Int64PropertyValue class. + * @constructor + * Describes a Service Fabric property value of type Int64. + * + * @member {string} data The data of the property value. + */ +export interface Int64PropertyValue extends PropertyValue { + data: string; +} + +/** + * @class + * Initializes a new instance of the DoublePropertyValue class. + * @constructor + * Describes a Service Fabric property value of type Double. * + * @member {number} data The data of the property value. + */ +export interface DoublePropertyValue extends PropertyValue { + data: number; +} + +/** + * @class + * Initializes a new instance of the StringPropertyValue class. + * @constructor + * Describes a Service Fabric property value of type String. * - * @member {string} kind Polymorphic Discriminator + * @member {string} data The data of the property value. */ -export interface RepairImpactDescriptionBase { - kind: string; +export interface StringPropertyValue extends PropertyValue { + data: string; } /** * @class - * Initializes a new instance of the NodeRepairImpactDescription class. + * Initializes a new instance of the GuidPropertyValue class. * @constructor - * Describes the expected impact of a repair on a set of nodes. + * Describes a Service Fabric property value of type Guid. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {uuid} data The data of the property value. + */ +export interface GuidPropertyValue extends PropertyValue { + data: string; +} + +/** + * @class + * Initializes a new instance of the PropertyMetadata class. + * @constructor + * The metadata associated with a property, including the property's name. * + * @member {string} [typeId] The kind of property, determined by the type of + * data. Following are the possible values. Possible values include: 'Invalid', + * 'Binary', 'Int64', 'Double', 'String', 'Guid' + * @member {string} [customTypeId] The property's custom type ID. + * @member {string} [parent] The name of the parent Service Fabric Name for the + * property. It could be thought of as the name-space/table under which the + * property exists. + * @member {number} [sizeInBytes] The length of the serialized property value. + * @member {date} [lastModifiedUtcTimestamp] Represents when the Property was + * last modified. Only write operations will cause this field to be updated. + * @member {string} [sequenceNumber] The version of the property. Every time a + * property is modified, its sequence number is increased. + */ +export interface PropertyMetadata { + typeId?: string; + customTypeId?: string; + parent?: string; + sizeInBytes?: number; + lastModifiedUtcTimestamp?: Date; + sequenceNumber?: string; +} + +/** + * @class + * Initializes a new instance of the PropertyInfo class. + * @constructor + * Information about a Service Fabric property. * - * @member {array} [nodeImpactList] The list of nodes impacted by a repair - * action and their respective expected impact. + * @member {string} name The name of the Service Fabric property. + * @member {object} [value] Describes a Service Fabric property value. + * @member {string} [value.kind] Polymorphic Discriminator + * @member {object} metadata The metadata associated with a property, including + * the property's name. + * @member {string} [metadata.typeId] The kind of property, determined by the + * type of data. Following are the possible values. Possible values include: + * 'Invalid', 'Binary', 'Int64', 'Double', 'String', 'Guid' + * @member {string} [metadata.customTypeId] The property's custom type ID. + * @member {string} [metadata.parent] The name of the parent Service Fabric + * Name for the property. It could be thought of as the name-space/table under + * which the property exists. + * @member {number} [metadata.sizeInBytes] The length of the serialized + * property value. + * @member {date} [metadata.lastModifiedUtcTimestamp] Represents when the + * Property was last modified. Only write operations will cause this field to + * be updated. + * @member {string} [metadata.sequenceNumber] The version of the property. + * Every time a property is modified, its sequence number is increased. */ -export interface NodeRepairImpactDescription extends RepairImpactDescriptionBase { - nodeImpactList?: NodeImpact[]; +export interface PropertyInfo { + name: string; + value?: PropertyValue; + metadata: PropertyMetadata; } /** * @class - * Initializes a new instance of the RepairTargetDescriptionBase class. + * Initializes a new instance of the PagedPropertyInfoList class. * @constructor - * Describes the entities targeted by a repair action. + * The paged list of Service Fabric properties under a given name. The list is + * paged when all of the results cannot fit in a single message. The next set + * of results can be obtained by executing the same query with the continuation + * token provided in this list. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {boolean} [isConsistent] Indicates whether any property under the + * given name has been modified during the enumeration. If there was a + * modification, this property value is false. + * @member {array} [properties] List of property information. + */ +export interface PagedPropertyInfoList { + continuationToken?: string; + isConsistent?: boolean; + properties?: PropertyInfo[]; +} + +/** + * @class + * Initializes a new instance of the PropertyDescription class. + * @constructor + * Description of a Service Fabric property. * + * @member {string} propertyName The name of the Service Fabric property. + * @member {string} [customTypeId] The property's custom type ID. Using this + * property, the user is able to tag the type of the value of the property. + * @member {object} value Describes a Service Fabric property value. + * @member {string} [value.kind] Polymorphic Discriminator + */ +export interface PropertyDescription { + propertyName: string; + customTypeId?: string; + value: PropertyValue; +} + +/** + * @class + * Initializes a new instance of the PropertyBatchOperation class. + * @constructor + * Represents the base type for property operations that can be put into a + * batch and submitted. * + * @member {string} propertyName The name of the Service Fabric property. * @member {string} kind Polymorphic Discriminator */ -export interface RepairTargetDescriptionBase { +export interface PropertyBatchOperation { + propertyName: string; kind: string; } /** * @class - * Initializes a new instance of the NodeRepairTargetDescription class. + * Initializes a new instance of the PropertyBatchDescriptionList class. * @constructor - * Describes the list of nodes targeted by a repair action. + * Describes a list of property batch operations to be executed. Either all or + * none of the operations will be committed. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {array} [operations] A list of the property batch operations to be + * executed. + */ +export interface PropertyBatchDescriptionList { + operations?: PropertyBatchOperation[]; +} + +/** + * @class + * Initializes a new instance of the CheckExistsPropertyBatchOperation class. + * @constructor + * Represents a PropertyBatchOperation that compares the Boolean existence of a + * property with the Exists argument. + * The PropertyBatchOperation operation fails if the property's existence is + * not equal to the Exists argument. + * The CheckExistsPropertyBatchOperation is generally used as a precondition + * for the write operations in the batch. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. * + * @member {boolean} exists Whether or not the property should exist for the + * operation to pass. + */ +export interface CheckExistsPropertyBatchOperation extends PropertyBatchOperation { + exists: boolean; +} + +/** + * @class + * Initializes a new instance of the CheckSequencePropertyBatchOperation class. + * @constructor + * Compares the Sequence Number of a property with the SequenceNumber argument. + * A property's sequence number can be thought of as that property's version. + * Every time the property is modified, its sequence number is increased. + * The sequence number can be found in a property's metadata. + * The comparison fails if the sequence numbers are not equal. + * CheckSequencePropertyBatchOperation is generally used as a precondition for + * the write operations in the batch. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. * - * @member {array} [nodeNames] The list of nodes targeted by a repair action. + * @member {string} sequenceNumber The expected sequence number. */ -export interface NodeRepairTargetDescription extends RepairTargetDescriptionBase { - nodeNames?: string[]; +export interface CheckSequencePropertyBatchOperation extends PropertyBatchOperation { + sequenceNumber: string; } /** * @class - * Initializes a new instance of the RepairTaskHistory class. + * Initializes a new instance of the CheckValuePropertyBatchOperation class. * @constructor - * A record of the times when the repair task entered each state. + * Represents a PropertyBatchOperation that compares the value of the property + * with the expected value. + * The CheckValuePropertyBatchOperation is generally used as a precondition for + * the write operations in the batch. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {object} value The expected property value. + * @member {string} [value.kind] Polymorphic Discriminator + */ +export interface CheckValuePropertyBatchOperation extends PropertyBatchOperation { + value: PropertyValue; +} + +/** + * @class + * Initializes a new instance of the DeletePropertyBatchOperation class. + * @constructor + * Represents a PropertyBatchOperation that deletes a specified property if it + * exists. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. * + */ +export interface DeletePropertyBatchOperation extends PropertyBatchOperation { +} + +/** + * @class + * Initializes a new instance of the GetPropertyBatchOperation class. + * @constructor + * Represents a PropertyBatchOperation that gets the specified property if it + * exists. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. * - * @member {date} [createdUtcTimestamp] The time when the repair task entered - * the Created state. - * @member {date} [claimedUtcTimestamp] The time when the repair task entered - * the Claimed state. - * @member {date} [preparingUtcTimestamp] The time when the repair task entered - * the Preparing state. - * @member {date} [approvedUtcTimestamp] The time when the repair task entered - * the Approved state - * @member {date} [executingUtcTimestamp] The time when the repair task entered - * the Executing state - * @member {date} [restoringUtcTimestamp] The time when the repair task entered - * the Restoring state - * @member {date} [completedUtcTimestamp] The time when the repair task entered - * the Completed state - * @member {date} [preparingHealthCheckStartUtcTimestamp] The time when the - * repair task started the health check in the Preparing state. - * @member {date} [preparingHealthCheckEndUtcTimestamp] The time when the - * repair task completed the health check in the Preparing state. - * @member {date} [restoringHealthCheckStartUtcTimestamp] The time when the - * repair task started the health check in the Restoring state. - * @member {date} [restoringHealthCheckEndUtcTimestamp] The time when the - * repair task completed the health check in the Restoring state. + * @member {boolean} [includeValue] Whether or not to return the property value + * with the metadata. + * True if values should be returned with the metadata; False to return only + * property metadata. Default value: false . */ -export interface RepairTaskHistory { - createdUtcTimestamp?: Date; - claimedUtcTimestamp?: Date; - preparingUtcTimestamp?: Date; - approvedUtcTimestamp?: Date; - executingUtcTimestamp?: Date; - restoringUtcTimestamp?: Date; - completedUtcTimestamp?: Date; - preparingHealthCheckStartUtcTimestamp?: Date; - preparingHealthCheckEndUtcTimestamp?: Date; - restoringHealthCheckStartUtcTimestamp?: Date; - restoringHealthCheckEndUtcTimestamp?: Date; +export interface GetPropertyBatchOperation extends PropertyBatchOperation { + includeValue?: boolean; } /** * @class - * Initializes a new instance of the RepairTask class. + * Initializes a new instance of the PutPropertyBatchOperation class. * @constructor - * Represents a repair task, which includes information about what kind of - * repair was requested, what its progress is, and what its final result was. + * Puts the specified property under the specified name. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. * - * This type supports the Service Fabric platform; it is not meant to be used + * @member {object} value Describes a Service Fabric property value. + * @member {string} [value.kind] Polymorphic Discriminator + * @member {string} [customTypeId] The property's custom type ID. Using this + * property, the user is able to tag the type of the value of the property. + */ +export interface PutPropertyBatchOperation extends PropertyBatchOperation { + value: PropertyValue; + customTypeId?: string; +} + +/** + * @class + * Initializes a new instance of the PropertyBatchInfo class. + * @constructor + * Information about the results of a property batch. + * + * @member {string} kind Polymorphic Discriminator + */ +export interface PropertyBatchInfo { + kind: string; +} + +/** + * @class + * Initializes a new instance of the SuccessfulPropertyBatchInfo class. + * @constructor + * Derived from PropertyBatchInfo. Represents the property batch succeeding. + * Contains the results of any "Get" operations in the batch. + * + * @member {object} [properties] A map containing the properties that were + * requested through any "Get" property batch operations. The key represents + * the index of the "Get" operation in the original request, in string form. + * The value is the property. If a property is not found, it will not be in the + * map. + */ +export interface SuccessfulPropertyBatchInfo extends PropertyBatchInfo { + properties?: { [propertyName: string]: PropertyInfo }; +} + +/** + * @class + * Initializes a new instance of the FailedPropertyBatchInfo class. + * @constructor + * Derived from PropertyBatchInfo. Represents the property batch failing. + * Contains information about the specific batch failure. + * + * @member {string} [errorMessage] The error message of the failed operation. + * Describes the exception thrown due to the first unsuccessful operation in + * the property batch. + * @member {number} [operationIndex] The index of the unsuccessful operation in + * the property batch. + */ +export interface FailedPropertyBatchInfo extends PropertyBatchInfo { + errorMessage?: string; + operationIndex?: number; +} + +/** + * @class + * Initializes a new instance of the BackupScheduleDescription class. + * @constructor + * Describes the backup schedule parameters. + * + * @member {string} scheduleKind Polymorphic Discriminator + */ +export interface BackupScheduleDescription { + scheduleKind: string; +} + +/** + * @class + * Initializes a new instance of the BackupStorageDescription class. + * @constructor + * Describes the parameters for the backup storage. + * + * @member {string} [friendlyName] Friendly name for this backup storage. + * @member {string} storageKind Polymorphic Discriminator + */ +export interface BackupStorageDescription { + friendlyName?: string; + storageKind: string; +} + +/** + * @class + * Initializes a new instance of the BackupPolicyDescription class. + * @constructor + * Describes a backup policy for configuring periodic backup. + * + * @member {string} name The unique name identifying this backup policy. + * @member {boolean} autoRestoreOnDataLoss Specifies whether to trigger restore + * automatically using the latest available backup in case the partition + * experiences a data loss event. + * @member {number} maxIncrementalBackups Defines the maximum number of + * incremental backups to be taken between two full backups. This is just the + * upper limit. A full backup may be taken before specified number of + * incremental backups are completed in one of the following conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * @member {object} schedule Describes the backup schedule parameters. + * @member {string} [schedule.scheduleKind] Polymorphic Discriminator + * @member {object} storage Describes the details of backup storage where to + * store the periodic backups. + * @member {string} [storage.friendlyName] Friendly name for this backup + * storage. + * @member {string} [storage.storageKind] Polymorphic Discriminator + */ +export interface BackupPolicyDescription { + name: string; + autoRestoreOnDataLoss: boolean; + maxIncrementalBackups: number; + schedule: BackupScheduleDescription; + storage: BackupStorageDescription; +} + +/** + * @class + * Initializes a new instance of the PagedBackupPolicyDescriptionList class. + * @constructor + * The list of backup policies configured in the cluster. The list is paged + * when all of the results cannot fit in a single message. The next set of + * results can be obtained by executing the same query with the continuation + * token provided in this list. + * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] The list of backup policies information. + */ +export interface PagedBackupPolicyDescriptionList { + continuationToken?: string; + items?: BackupPolicyDescription[]; +} + +/** + * @class + * Initializes a new instance of the BackupConfigurationInfo class. + * @constructor + * Describes the backup configuration information. + * + * @member {string} [policyName] The name of the backup policy which is + * applicable to this Service Fabric application or service or partition. + * @member {string} [policyInheritedFrom] Specifies the scope at which the + * backup policy is applied. Possible values include: 'Invalid', 'Partition', + * 'Service', 'Application' + * @member {object} [suspensionInfo] Describes the backup suspension details. + * @member {boolean} [suspensionInfo.isSuspended] Indicates whether periodic + * backup is suspended at this level or not. + * @member {string} [suspensionInfo.suspensionInheritedFrom] Specifies the + * scope at which the backup suspension was applied. Possible values include: + * 'Invalid', 'Partition', 'Service', 'Application' + * @member {string} kind Polymorphic Discriminator + */ +export interface BackupConfigurationInfo { + policyName?: string; + policyInheritedFrom?: string; + suspensionInfo?: BackupSuspensionInfo; + kind: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationBackupConfigurationInfo class. + * @constructor + * Backup configuration information for a specific Service Fabric application + * specifying what backup policy is being applied and suspend description, if + * any. + * + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + */ +export interface ApplicationBackupConfigurationInfo extends BackupConfigurationInfo { + applicationName?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceBackupConfigurationInfo class. + * @constructor + * Backup configuration information for a specific Service Fabric service + * specifying what backup policy is being applied and suspend description, if + * any. + * + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + */ +export interface ServiceBackupConfigurationInfo extends BackupConfigurationInfo { + serviceName?: string; +} + +/** + * @class + * Initializes a new instance of the BackupSuspensionInfo class. + * @constructor + * Describes the backup suspension details. + * + * @member {boolean} [isSuspended] Indicates whether periodic backup is + * suspended at this level or not. + * @member {string} [suspensionInheritedFrom] Specifies the scope at which the + * backup suspension was applied. Possible values include: 'Invalid', + * 'Partition', 'Service', 'Application' + */ +export interface BackupSuspensionInfo { + isSuspended?: boolean; + suspensionInheritedFrom?: string; +} + +/** + * @class + * Initializes a new instance of the PagedBackupConfigurationInfoList class. + * @constructor + * The list of backup configuration information. The list is paged when all of + * the results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. + * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of backup configuration information. + */ +export interface PagedBackupConfigurationInfoList { + continuationToken?: string; + items?: BackupConfigurationInfo[]; +} + +/** + * @class + * Initializes a new instance of the RestorePartitionDescription class. + * @constructor + * Specifies the parameters needed to trigger a restore of a specific + * partition. + * + * @member {uuid} backupId Unique backup ID. + * @member {string} backupLocation Location of the backup relative to the + * backup storage specified/ configured. + * @member {object} [backupStorage] Location of the backup from where the + * partition will be restored. + * @member {string} [backupStorage.friendlyName] Friendly name for this backup + * storage. + * @member {string} [backupStorage.storageKind] Polymorphic Discriminator + */ +export interface RestorePartitionDescription { + backupId: string; + backupLocation: string; + backupStorage?: BackupStorageDescription; +} + +/** + * @class + * Initializes a new instance of the RestoreProgressInfo class. + * @constructor + * Describes the progress of a restore operation on a partition. + * + * @member {string} [restoreState] Represents the current state of the + * partition restore operation. Possible values include: 'Invalid', 'Accepted', + * 'RestoreInProgress', 'Success', 'Failure', 'Timeout' + * @member {date} [timeStampUtc] Timestamp when operation succeeded or failed. + * @member {object} [restoredEpoch] Describes the epoch at which the partition + * is restored. + * @member {string} [restoredEpoch.configurationNumber] The current + * configuration number of this Epoch. The configuration number is an + * increasing value that is updated whenever the configuration of this replica + * set changes. + * @member {string} [restoredEpoch.dataLossNumber] The current dataloss number + * of this Epoch. The data loss number property is an increasing value which is + * updated whenever data loss is suspected, as when loss of a quorum of + * replicas in the replica set that includes the Primary replica. + * @member {string} [restoredLsn] Restored LSN. + * @member {object} [failureError] Denotes the failure encountered in + * performing restore operation. + * @member {string} [failureError.code] Defines the fabric error codes that be + * returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values that + * can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request Entity + * Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: + * 'FABRIC_E_INVALID_PARTITION_KEY', 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_ADDRESS', 'FABRIC_E_APPLICATION_NOT_UPGRADING', + * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_FABRIC_NOT_UPGRADING', 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', + * 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', + * 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', + * 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', + * 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', + * 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', + * 'FABRIC_E_SERVICE_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', + * 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', 'FABRIC_E_PARTITION_NOT_FOUND', + * 'FABRIC_E_REPLICA_DOES_NOT_EXIST', 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', + * 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', + * 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', + * 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', + * 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', + * 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', + * 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', + * 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', + * 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_SERVICE_ALREADY_EXISTS', 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_TYPE_IN_USE', + * 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', 'FABRIC_E_FABRIC_VERSION_IN_USE', + * 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', 'FABRIC_E_NAME_ALREADY_EXISTS', + * 'FABRIC_E_NAME_NOT_EMPTY', 'FABRIC_E_PROPERTY_CHECK_FAILED', + * 'FABRIC_E_SERVICE_METADATA_MISMATCH', 'FABRIC_E_SERVICE_TYPE_MISMATCH', + * 'FABRIC_E_HEALTH_STALE_REPORT', 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', + * 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', + * 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', + * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', + * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', + * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' + * @member {string} [failureError.message] Error message. + */ +export interface RestoreProgressInfo { + restoreState?: string; + timeStampUtc?: Date; + restoredEpoch?: BackupEpoch; + restoredLsn?: string; + failureError?: FabricErrorError; +} + +/** + * @class + * Initializes a new instance of the BackupPartitionDescription class. + * @constructor + * Describes the parameters for triggering partition's backup. + * + * @member {object} [backupStorage] Specifies the details of the backup storage + * where to save the backup. + * @member {string} [backupStorage.friendlyName] Friendly name for this backup + * storage. + * @member {string} [backupStorage.storageKind] Polymorphic Discriminator + */ +export interface BackupPartitionDescription { + backupStorage?: BackupStorageDescription; +} + +/** + * @class + * Initializes a new instance of the BackupInfo class. + * @constructor + * Represents a backup point which can be used to trigger a restore. + * + * @member {uuid} [backupId] Unique backup ID . + * @member {uuid} [backupChainId] Unique backup chain ID. All backups part of + * the same chain has the same backup chain id. A backup chain is comprised of + * 1 full backup and multiple incremental backups. + * @member {string} [applicationName] Name of the Service Fabric application + * this partition backup belongs to. + * @member {string} [serviceName] Name of the Service Fabric service this + * partition backup belongs to. + * @member {object} [partitionInformation] Information about the partition to + * which this backup belongs to + * @member {uuid} [partitionInformation.id] An internal ID used by Service + * Fabric to uniquely identify a partition. This is a randomly generated GUID + * when the service was created. The partition ID is unique and does not change + * for the lifetime of the service. If the same service was deleted and + * recreated the IDs of its partitions would be different. + * @member {string} [partitionInformation.servicePartitionKind] Polymorphic + * Discriminator + * @member {string} [backupLocation] Location of the backup, relative to the + * backup store. + * @member {string} [backupType] Describes the type of backup, whether its full + * or incremental. Possible values include: 'Invalid', 'Full', 'Incremental' + * @member {object} [epochOfLastBackupRecord] Epoch of the last record in this + * backup. + * @member {string} [epochOfLastBackupRecord.configurationNumber] The current + * configuration number of this Epoch. The configuration number is an + * increasing value that is updated whenever the configuration of this replica + * set changes. + * @member {string} [epochOfLastBackupRecord.dataLossNumber] The current + * dataloss number of this Epoch. The data loss number property is an + * increasing value which is updated whenever data loss is suspected, as when + * loss of a quorum of replicas in the replica set that includes the Primary + * replica. + * @member {string} [lsnOfLastBackupRecord] LSN of the last record in this + * backup. + * @member {date} [creationTimeUtc] The date time when this backup was taken. + * @member {object} [failureError] Denotes the failure encountered in getting + * backup point information. + * @member {string} [failureError.code] Defines the fabric error codes that be + * returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values that + * can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request Entity + * Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: + * 'FABRIC_E_INVALID_PARTITION_KEY', 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_ADDRESS', 'FABRIC_E_APPLICATION_NOT_UPGRADING', + * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_FABRIC_NOT_UPGRADING', 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', + * 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', + * 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', + * 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', + * 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', + * 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', + * 'FABRIC_E_SERVICE_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', + * 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', 'FABRIC_E_PARTITION_NOT_FOUND', + * 'FABRIC_E_REPLICA_DOES_NOT_EXIST', 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', + * 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', + * 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', + * 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', + * 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', + * 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', + * 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', + * 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', + * 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_SERVICE_ALREADY_EXISTS', 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_TYPE_IN_USE', + * 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', 'FABRIC_E_FABRIC_VERSION_IN_USE', + * 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', 'FABRIC_E_NAME_ALREADY_EXISTS', + * 'FABRIC_E_NAME_NOT_EMPTY', 'FABRIC_E_PROPERTY_CHECK_FAILED', + * 'FABRIC_E_SERVICE_METADATA_MISMATCH', 'FABRIC_E_SERVICE_TYPE_MISMATCH', + * 'FABRIC_E_HEALTH_STALE_REPORT', 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', + * 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', + * 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', + * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', + * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', + * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' + * @member {string} [failureError.message] Error message. + */ +export interface BackupInfo { + backupId?: string; + backupChainId?: string; + applicationName?: string; + serviceName?: string; + partitionInformation?: PartitionInformation; + backupLocation?: string; + backupType?: string; + epochOfLastBackupRecord?: BackupEpoch; + lsnOfLastBackupRecord?: string; + creationTimeUtc?: Date; + failureError?: FabricErrorError; +} + +/** + * @class + * Initializes a new instance of the PagedBackupInfoList class. + * @constructor + * The list of backups. The list is paged when all of the results cannot fit in + * a single message. The next set of results can be obtained by executing the + * same query with the continuation token provided in this list. + * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of backup information. + */ +export interface PagedBackupInfoList { + continuationToken?: string; + items?: BackupInfo[]; +} + +/** + * @class + * Initializes a new instance of the AzureBlobBackupStorageDescription class. + * @constructor + * Describes the parameters for Azure blob store used for storing and + * enumerating backups. + * + * @member {string} connectionString The connection string to connect to the + * Azure blob store. + * @member {string} containerName The name of the container in the blob store + * to store and enumerate backups from. + */ +export interface AzureBlobBackupStorageDescription extends BackupStorageDescription { + connectionString: string; + containerName: string; +} + +/** + * @class + * Initializes a new instance of the FileShareBackupStorageDescription class. + * @constructor + * Describes the parameters for file share storage used for storing or + * enumerating backups. + * + * @member {string} path UNC path of the file share where to store or enumerate + * backups from. + * @member {string} [primaryUserName] Primary user name to access the file + * share. + * @member {string} [primaryPassword] Primary password to access the share + * location. + * @member {string} [secondaryUserName] Secondary user name to access the file + * share. + * @member {string} [secondaryPassword] Secondary password to access the share + * location + */ +export interface FileShareBackupStorageDescription extends BackupStorageDescription { + path: string; + primaryUserName?: string; + primaryPassword?: string; + secondaryUserName?: string; + secondaryPassword?: string; +} + +/** + * @class + * Initializes a new instance of the FrequencyBasedBackupScheduleDescription class. + * @constructor + * Describes the frequency based backup schedule. + * + * @member {moment.duration} interval Defines the interval with which backups + * are periodically taken. It should be specified in ISO8601 format. Timespan + * in seconds is not supported and will be ignored while creating the policy. + */ +export interface FrequencyBasedBackupScheduleDescription extends BackupScheduleDescription { + interval: moment.Duration; +} + +/** + * @class + * Initializes a new instance of the TimeBasedBackupScheduleDescription class. + * @constructor + * Describes the time based backup schedule. + * + * @member {string} scheduleFrequencyType Describes the frequency with which to + * run the time based backup schedule. Possible values include: 'Invalid', + * 'Daily', 'Weekly' + * @member {array} [runDays] List of days of a week when to trigger the + * periodic backup. This is valid only when the backup schedule frequency type + * is weekly. + * @member {array} runTimes Represents the list of exact time during the day in + * ISO8601 format. Like '19:00:00' will represent '7PM' during the day. Date + * specified along with time will be ignored. + */ +export interface TimeBasedBackupScheduleDescription extends BackupScheduleDescription { + scheduleFrequencyType: string; + runDays?: string[]; + runTimes: Date[]; +} + +/** + * @class + * Initializes a new instance of the BackupProgressInfo class. + * @constructor + * Describes the progress of a partition's backup. + * + * @member {string} [backupState] Represents the current state of the partition + * backup operation. Possible values include: 'Invalid', 'Accepted', + * 'BackupInProgress', 'Success', 'Failure', 'Timeout' + * @member {date} [timeStampUtc] TimeStamp in UTC when operation succeeded or + * failed. + * @member {uuid} [backupId] Unique ID of the newly created backup. + * @member {string} [backupLocation] Location, relative to the backup store, of + * the newly created backup. + * @member {object} [epochOfLastBackupRecord] Specifies the epoch of the last + * record included in backup. + * @member {string} [epochOfLastBackupRecord.configurationNumber] The current + * configuration number of this Epoch. The configuration number is an + * increasing value that is updated whenever the configuration of this replica + * set changes. + * @member {string} [epochOfLastBackupRecord.dataLossNumber] The current + * dataloss number of this Epoch. The data loss number property is an + * increasing value which is updated whenever data loss is suspected, as when + * loss of a quorum of replicas in the replica set that includes the Primary + * replica. + * @member {string} [lsnOfLastBackupRecord] The LSN of last record included in + * backup. + * @member {object} [failureError] Denotes the failure encountered in + * performing backup operation. + * @member {string} [failureError.code] Defines the fabric error codes that be + * returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values that + * can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request Entity + * Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: + * 'FABRIC_E_INVALID_PARTITION_KEY', 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_ADDRESS', 'FABRIC_E_APPLICATION_NOT_UPGRADING', + * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_FABRIC_NOT_UPGRADING', 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', + * 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', + * 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', + * 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', + * 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', + * 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', + * 'FABRIC_E_SERVICE_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', + * 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', 'FABRIC_E_PARTITION_NOT_FOUND', + * 'FABRIC_E_REPLICA_DOES_NOT_EXIST', 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', + * 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', + * 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', + * 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', + * 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', + * 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', + * 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', + * 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', + * 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_SERVICE_ALREADY_EXISTS', 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_TYPE_IN_USE', + * 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', 'FABRIC_E_FABRIC_VERSION_IN_USE', + * 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', 'FABRIC_E_NAME_ALREADY_EXISTS', + * 'FABRIC_E_NAME_NOT_EMPTY', 'FABRIC_E_PROPERTY_CHECK_FAILED', + * 'FABRIC_E_SERVICE_METADATA_MISMATCH', 'FABRIC_E_SERVICE_TYPE_MISMATCH', + * 'FABRIC_E_HEALTH_STALE_REPORT', 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', + * 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', + * 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', + * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', + * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', + * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' + * @member {string} [failureError.message] Error message. + */ +export interface BackupProgressInfo { + backupState?: string; + timeStampUtc?: Date; + backupId?: string; + backupLocation?: string; + epochOfLastBackupRecord?: BackupEpoch; + lsnOfLastBackupRecord?: string; + failureError?: FabricErrorError; +} + +/** + * @class + * Initializes a new instance of the PartitionBackupConfigurationInfo class. + * @constructor + * Backup configuration information, for a specific partition, specifying what + * backup policy is being applied and suspend description, if any. + * + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for the + * lifetime of the service. If the same service was deleted and recreated the + * IDs of its partitions would be different. + */ +export interface PartitionBackupConfigurationInfo extends BackupConfigurationInfo { + serviceName?: string; + partitionId?: string; +} + +/** + * @class + * Initializes a new instance of the BackupEntity class. + * @constructor + * Describes the Service Fabric entity that is configured for backup. + * + * @member {string} entityKind Polymorphic Discriminator + */ +export interface BackupEntity { + entityKind: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationBackupEntity class. + * @constructor + * Identifies the Service Fabric application which is being backed up. + * + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + */ +export interface ApplicationBackupEntity extends BackupEntity { + applicationName?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceBackupEntity class. + * @constructor + * Identifies the Service Fabric stateful service which is being backed up. + * + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + */ +export interface ServiceBackupEntity extends BackupEntity { + serviceName?: string; +} + +/** + * @class + * Initializes a new instance of the PartitionBackupEntity class. + * @constructor + * Identifies the Service Fabric stateful partition which is being backed up. + * + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for the + * lifetime of the service. If the same service was deleted and recreated the + * IDs of its partitions would be different. + */ +export interface PartitionBackupEntity extends BackupEntity { + serviceName?: string; + partitionId?: string; +} + +/** + * @class + * Initializes a new instance of the EnableBackupDescription class. + * @constructor + * Specifies the parameters needed to enable periodic backup. + * + * @member {string} backupPolicyName Name of the backup policy to be used for + * enabling periodic backups. + */ +export interface EnableBackupDescription { + backupPolicyName: string; +} + +/** + * @class + * Initializes a new instance of the PagedBackupEntityList class. + * @constructor + * The list of backup entities that are being periodically backed. The list is + * paged when all of the results cannot fit in a single message. The next set + * of results can be obtained by executing the same query with the continuation + * token provided in this list. + * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of backup entity information. + */ +export interface PagedBackupEntityList { + continuationToken?: string; + items?: BackupEntity[]; +} + +/** + * @class + * Initializes a new instance of the GetBackupByStorageQueryDescription class. + * @constructor + * Describes additional filters to be applied, while listing backups, and + * backup storage details from where to fetch the backups. + * + * @member {date} [startDateTimeFilter] Specifies the start date time in + * ISO8601 from which to enumerate backups. If not specified, backups are + * enumerated from the beginning. + * @member {date} [endDateTimeFilter] Specifies the end date time in ISO8601 + * till which to enumerate backups. If not specified, backups are enumerated + * till the end. + * @member {boolean} [latest] If specified as true, gets the most recent backup + * (within the specified time range) for every partition under the specified + * backup entity. Default value: false . + * @member {object} storage Describes the parameters for the backup storage + * from where to enumerate backups. This is optional and by default backups are + * enumerated from the backup storage where this backup entity is currently + * being backed up (as specified in backup policy). This parameter is useful to + * be able to enumerate backups from another cluster where you may intend to + * restore. + * @member {string} [storage.friendlyName] Friendly name for this backup + * storage. + * @member {string} [storage.storageKind] Polymorphic Discriminator + * @member {object} backupEntity Indicates the entity for which to enumerate + * backups. + * @member {string} [backupEntity.entityKind] Polymorphic Discriminator + */ +export interface GetBackupByStorageQueryDescription { + startDateTimeFilter?: Date; + endDateTimeFilter?: Date; + latest?: boolean; + storage: BackupStorageDescription; + backupEntity: BackupEntity; +} + +/** + * @class + * Initializes a new instance of the NodeImpact class. + * @constructor + * Describes the expected impact of a repair to a particular node. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} nodeName The name of the impacted node. + * @member {string} [impactLevel] The level of impact expected. Possible values + * include: 'Invalid', 'None', 'Restart', 'RemoveData', 'RemoveNode' + */ +export interface NodeImpact { + nodeName: string; + impactLevel?: string; +} + +/** + * @class + * Initializes a new instance of the RepairImpactDescriptionBase class. + * @constructor + * Describes the expected impact of executing a repair task. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} kind Polymorphic Discriminator + */ +export interface RepairImpactDescriptionBase { + kind: string; +} + +/** + * @class + * Initializes a new instance of the NodeRepairImpactDescription class. + * @constructor + * Describes the expected impact of a repair on a set of nodes. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {array} [nodeImpactList] The list of nodes impacted by a repair + * action and their respective expected impact. + */ +export interface NodeRepairImpactDescription extends RepairImpactDescriptionBase { + nodeImpactList?: NodeImpact[]; +} + +/** + * @class + * Initializes a new instance of the RepairTargetDescriptionBase class. + * @constructor + * Describes the entities targeted by a repair action. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} kind Polymorphic Discriminator + */ +export interface RepairTargetDescriptionBase { + kind: string; +} + +/** + * @class + * Initializes a new instance of the NodeRepairTargetDescription class. + * @constructor + * Describes the list of nodes targeted by a repair action. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {array} [nodeNames] The list of nodes targeted by a repair action. + */ +export interface NodeRepairTargetDescription extends RepairTargetDescriptionBase { + nodeNames?: string[]; +} + +/** + * @class + * Initializes a new instance of the RepairTaskHistory class. + * @constructor + * A record of the times when the repair task entered each state. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {date} [createdUtcTimestamp] The time when the repair task entered + * the Created state. + * @member {date} [claimedUtcTimestamp] The time when the repair task entered + * the Claimed state. + * @member {date} [preparingUtcTimestamp] The time when the repair task entered + * the Preparing state. + * @member {date} [approvedUtcTimestamp] The time when the repair task entered + * the Approved state + * @member {date} [executingUtcTimestamp] The time when the repair task entered + * the Executing state + * @member {date} [restoringUtcTimestamp] The time when the repair task entered + * the Restoring state + * @member {date} [completedUtcTimestamp] The time when the repair task entered + * the Completed state + * @member {date} [preparingHealthCheckStartUtcTimestamp] The time when the + * repair task started the health check in the Preparing state. + * @member {date} [preparingHealthCheckEndUtcTimestamp] The time when the + * repair task completed the health check in the Preparing state. + * @member {date} [restoringHealthCheckStartUtcTimestamp] The time when the + * repair task started the health check in the Restoring state. + * @member {date} [restoringHealthCheckEndUtcTimestamp] The time when the + * repair task completed the health check in the Restoring state. + */ +export interface RepairTaskHistory { + createdUtcTimestamp?: Date; + claimedUtcTimestamp?: Date; + preparingUtcTimestamp?: Date; + approvedUtcTimestamp?: Date; + executingUtcTimestamp?: Date; + restoringUtcTimestamp?: Date; + completedUtcTimestamp?: Date; + preparingHealthCheckStartUtcTimestamp?: Date; + preparingHealthCheckEndUtcTimestamp?: Date; + restoringHealthCheckStartUtcTimestamp?: Date; + restoringHealthCheckEndUtcTimestamp?: Date; +} + +/** + * @class + * Initializes a new instance of the RepairTask class. + * @constructor + * Represents a repair task, which includes information about what kind of + * repair was requested, what its progress is, and what its final result was. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} taskId The ID of the repair task. + * @member {string} [version] The version of the repair task. + * When creating a new repair task, the version must be set to zero. When + * updating a repair task, + * the version is used for optimistic concurrency checks. If the version is + * set to zero, the update will not check for write conflicts. If the version + * is set to a non-zero value, then the + * update will only succeed if the actual current version of the repair task + * matches this value. + * @member {string} [description] A description of the purpose of the repair + * task, or other informational details. + * May be set when the repair task is created, and is immutable once set. + * @member {string} state The workflow state of the repair task. Valid initial + * states are Created, Claimed, and Preparing. Possible values include: + * 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', 'Executing', + * 'Restoring', 'Completed' + * @member {number} [flags] A bitwise-OR of the following values, which gives + * additional details about the status of the repair task. + * - 1 - Cancellation of the repair has been requested + * - 2 - Abort of the repair has been requested + * - 4 - Approval of the repair was forced via client request + * @member {string} action The requested repair action. Must be specified when + * the repair task is created, and is immutable once set. + * @member {object} [target] The target object determines what actions the + * system will take to prepare for the impact of the repair, prior to approving + * execution of the repair. + * May be set when the repair task is created, and is immutable once set. + * @member {string} [target.kind] Polymorphic Discriminator + * @member {string} [executor] The name of the repair executor. Must be + * specified in Claimed and later states, and is immutable once set. + * @member {string} [executorData] A data string that the repair executor can + * use to store its internal state. + * @member {object} [impact] The impact object determines what actions the + * system will take to prepare for the impact of the repair, prior to approving + * execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. + * @member {string} [impact.kind] Polymorphic Discriminator + * @member {string} [resultStatus] A value describing the overall result of the + * repair task execution. Must be specified in the Restoring and later states, + * and is immutable once set. Possible values include: 'Invalid', 'Succeeded', + * 'Cancelled', 'Interrupted', 'Failed', 'Pending' + * @member {number} [resultCode] A numeric value providing additional details + * about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * @member {string} [resultDetails] A string providing additional details about + * the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * @member {object} [history] An object that contains timestamps of the repair + * task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. + * @member {date} [history.createdUtcTimestamp] The time when the repair task + * entered the Created state. + * @member {date} [history.claimedUtcTimestamp] The time when the repair task + * entered the Claimed state. + * @member {date} [history.preparingUtcTimestamp] The time when the repair task + * entered the Preparing state. + * @member {date} [history.approvedUtcTimestamp] The time when the repair task + * entered the Approved state + * @member {date} [history.executingUtcTimestamp] The time when the repair task + * entered the Executing state + * @member {date} [history.restoringUtcTimestamp] The time when the repair task + * entered the Restoring state + * @member {date} [history.completedUtcTimestamp] The time when the repair task + * entered the Completed state + * @member {date} [history.preparingHealthCheckStartUtcTimestamp] The time when + * the repair task started the health check in the Preparing state. + * @member {date} [history.preparingHealthCheckEndUtcTimestamp] The time when + * the repair task completed the health check in the Preparing state. + * @member {date} [history.restoringHealthCheckStartUtcTimestamp] The time when + * the repair task started the health check in the Restoring state. + * @member {date} [history.restoringHealthCheckEndUtcTimestamp] The time when + * the repair task completed the health check in the Restoring state. + * @member {string} [preparingHealthCheckState] The workflow state of the + * health check when the repair task is in the Preparing state. Possible values + * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @member {string} [restoringHealthCheckState] The workflow state of the + * health check when the repair task is in the Restoring state. Possible values + * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @member {boolean} [performPreparingHealthCheck] A value to determine if + * health checks will be performed when the repair task enters the Preparing + * state. + * @member {boolean} [performRestoringHealthCheck] A value to determine if + * health checks will be performed when the repair task enters the Restoring + * state. + */ +export interface RepairTask { + taskId: string; + version?: string; + description?: string; + state: string; + flags?: number; + action: string; + target?: RepairTargetDescriptionBase; + executor?: string; + executorData?: string; + impact?: RepairImpactDescriptionBase; + resultStatus?: string; + resultCode?: number; + resultDetails?: string; + history?: RepairTaskHistory; + preparingHealthCheckState?: string; + restoringHealthCheckState?: string; + performPreparingHealthCheck?: boolean; + performRestoringHealthCheck?: boolean; +} + +/** + * @class + * Initializes a new instance of the RepairTaskApproveDescription class. + * @constructor + * Describes a request for forced approval of a repair task. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} taskId The ID of the repair task. + * @member {string} [version] The current version number of the repair task. If + * non-zero, then the request will only succeed if this value matches the + * actual current version of the repair task. If zero, then no version check is + * performed. + */ +export interface RepairTaskApproveDescription { + taskId: string; + version?: string; +} + +/** + * @class + * Initializes a new instance of the RepairTaskCancelDescription class. + * @constructor + * Describes a request to cancel a repair task. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} taskId The ID of the repair task. + * @member {string} [version] The current version number of the repair task. If + * non-zero, then the request will only succeed if this value matches the + * actual current version of the repair task. If zero, then no version check is + * performed. + * @member {boolean} [requestAbort] _True_ if the repair should be stopped as + * soon as possible even if it has already started executing. _False_ if the + * repair should be cancelled only if execution has not yet started. + */ +export interface RepairTaskCancelDescription { + taskId: string; + version?: string; + requestAbort?: boolean; +} + +/** + * @class + * Initializes a new instance of the RepairTaskDeleteDescription class. + * @constructor + * Describes a request to delete a completed repair task. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} taskId The ID of the completed repair task to be deleted. + * @member {string} [version] The current version number of the repair task. If + * non-zero, then the request will only succeed if this value matches the + * actual current version of the repair task. If zero, then no version check is + * performed. + */ +export interface RepairTaskDeleteDescription { + taskId: string; + version?: string; +} + +/** + * @class + * Initializes a new instance of the RepairTaskUpdateHealthPolicyDescription class. + * @constructor + * Describes a request to update the health policy of a repair task. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @member {string} taskId The ID of the repair task to be updated. + * @member {string} [version] The current version number of the repair task. If + * non-zero, then the request will only succeed if this value matches the + * actual current value of the repair task. If zero, then no version check is + * performed. + * @member {boolean} [performPreparingHealthCheck] A boolean indicating if + * health check is to be performed in the Preparing stage of the repair task. + * If not specified the existing value should not be altered. Otherwise, + * specify the desired new value. + * @member {boolean} [performRestoringHealthCheck] A boolean indicating if + * health check is to be performed in the Restoring stage of the repair task. + * If not specified the existing value should not be altered. Otherwise, + * specify the desired new value. + */ +export interface RepairTaskUpdateHealthPolicyDescription { + taskId: string; + version?: string; + performPreparingHealthCheck?: boolean; + performRestoringHealthCheck?: boolean; +} + +/** + * @class + * Initializes a new instance of the RepairTaskUpdateInfo class. + * @constructor + * Describes the result of an operation that created or updated a repair task. + * + * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * + * @member {string} version The new version of the repair task. + */ +export interface RepairTaskUpdateInfo { + version: string; +} + +/** + * @class + * Initializes a new instance of the UploadChunkRange class. + * @constructor + * Information about which portion of the file to upload. + * + * @member {string} [startPosition] The start position of the portion of the + * file. It's represented by the number of bytes. + * @member {string} [endPosition] The end position of the portion of the file. + * It's represented by the number of bytes. + */ +export interface UploadChunkRange { + startPosition?: string; + endPosition?: string; +} + +/** + * @class + * Initializes a new instance of the UploadSessionInfo class. + * @constructor + * Information about an image store upload session. A session is associated + * with a relative path in the image store. + * + * @member {string} [storeRelativePath] The remote location within image store. + * This path is relative to the image store root. + * @member {uuid} [sessionId] A unique ID of the upload session. A session ID + * can be reused only if the session was committed or removed. + * @member {date} [modifiedDate] The date and time when the upload session was + * last modified. + * @member {string} [fileSize] The size in bytes of the uploading file. + * @member {array} [expectedRanges] List of chunk ranges that image store has + * not received yet. + */ +export interface UploadSessionInfo { + storeRelativePath?: string; + sessionId?: string; + modifiedDate?: Date; + fileSize?: string; + expectedRanges?: UploadChunkRange[]; +} + +/** + * @class + * Initializes a new instance of the UploadSession class. + * @constructor + * Information about a image store upload session + * + * @member {array} [uploadSessions] When querying upload session by upload + * session ID, the result contains only one upload session. When querying + * upload session by image store relative path, the result might contain + * multiple upload sessions. + */ +export interface UploadSession { + uploadSessions?: UploadSessionInfo[]; +} + +/** + * @class + * Initializes a new instance of the ContainerLogs class. + * @constructor + * Container logs. + * + * @member {string} [content] Container logs. + */ +export interface ContainerLogs { + content?: string; +} + +/** + * @class + * Initializes a new instance of the AveragePartitionLoadScalingTrigger class. + * @constructor + * Represents a scaling trigger related to an average load of a metric/resource + * of a partition. + * + * @member {string} metricName The name of the metric for which usage should be + * tracked. + * @member {string} lowerLoadThreshold The lower limit of the load below which + * a scale in operation should be performed. + * @member {string} upperLoadThreshold The upper limit of the load beyond which + * a scale out operation should be performed. + * @member {number} scaleIntervalInSeconds The period in seconds on which a + * decision is made whether to scale or not. + */ +export interface AveragePartitionLoadScalingTrigger extends ScalingTriggerDescription { + metricName: string; + lowerLoadThreshold: string; + upperLoadThreshold: string; + scaleIntervalInSeconds: number; +} + +/** + * @class + * Initializes a new instance of the AverageServiceLoadScalingTrigger class. + * @constructor + * Represents a scaling policy related to an average load of a metric/resource + * of a service. + * + * @member {string} metricName The name of the metric for which usage should be + * tracked. + * @member {string} lowerLoadThreshold The lower limit of the load below which + * a scale in operation should be performed. + * @member {string} upperLoadThreshold The upper limit of the load beyond which + * a scale out operation should be performed. + * @member {number} scaleIntervalInSeconds The period in seconds on which a + * decision is made whether to scale or not. + */ +export interface AverageServiceLoadScalingTrigger extends ScalingTriggerDescription { + metricName: string; + lowerLoadThreshold: string; + upperLoadThreshold: string; + scaleIntervalInSeconds: number; +} + +/** + * @class + * Initializes a new instance of the PartitionInstanceCountScaleMechanism class. + * @constructor + * Represents a scaling mechanism for adding or removing instances of stateless + * service partition. + * + * @member {number} minInstanceCount Minimum number of instances of the + * partition. + * @member {number} maxInstanceCount Maximum number of instances of the + * partition. + * @member {number} scaleIncrement The number of instances to add or remove + * during a scaling operation. + */ +export interface PartitionInstanceCountScaleMechanism extends ScalingMechanismDescription { + minInstanceCount: number; + maxInstanceCount: number; + scaleIncrement: number; +} + +/** + * @class + * Initializes a new instance of the AddRemoveIncrementalNamedPartitionScalingMechanism class. + * @constructor + * Represents a scaling mechanism for adding or removing named partitions of a + * stateless service. Partition names are in the format '0','1''N-1' + * + * @member {number} minPartitionCount Minimum number of named partitions of the + * service. + * @member {number} maxPartitionCount Maximum number of named partitions of the + * service. + * @member {number} scaleIncrement The number of instances to add or remove + * during a scaling operation. + */ +export interface AddRemoveIncrementalNamedPartitionScalingMechanism extends ScalingMechanismDescription { + minPartitionCount: number; + maxPartitionCount: number; + scaleIncrement: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationCreatedEvent class. + * @constructor + * Application Created event. + * + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {string} applicationDefinitionKind Application definition kind. + */ +export interface ApplicationCreatedEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; + applicationDefinitionKind: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationDeletedEvent class. + * @constructor + * Application Deleted event. + * + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + */ +export interface ApplicationDeletedEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationHealthReportCreatedEvent class. + * @constructor + * Application Health Report Created event. + * + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface ApplicationHealthReportCreatedEvent extends ApplicationEvent { + applicationInstanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the ApplicationHealthReportExpiredEvent class. + * @constructor + * Application Health Report Expired event. + * + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface ApplicationHealthReportExpiredEvent extends ApplicationEvent { + applicationInstanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the ApplicationUpgradeCompleteEvent class. + * @constructor + * Application Upgrade Complete event. + * + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in + * milli-seconds. + */ +export interface ApplicationUpgradeCompleteEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; + overallUpgradeElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationUpgradeDomainCompleteEvent class. + * @constructor + * Application Upgrade Domain Complete event. + * + * @member {string} applicationTypeName Application type name. + * @member {string} currentApplicationTypeVersion Current Application type + * version. + * @member {string} applicationTypeVersion Target Application type version. + * @member {string} upgradeState State of upgrade. + * @member {string} upgradeDomains Upgrade domains. + * @member {number} upgradeDomainElapsedTimeInMs Upgrade time of domain in + * milli-seconds. + */ +export interface ApplicationUpgradeDomainCompleteEvent extends ApplicationEvent { + applicationTypeName: string; + currentApplicationTypeVersion: string; + applicationTypeVersion: string; + upgradeState: string; + upgradeDomains: string; + upgradeDomainElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationUpgradeRollbackCompleteEvent class. + * @constructor + * Application Upgrade Rollback Complete event. + * + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {string} failureReason Describes reason of failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in + * milli-seconds. + */ +export interface ApplicationUpgradeRollbackCompleteEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; + failureReason: string; + overallUpgradeElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationUpgradeRollbackStartEvent class. + * @constructor + * Application Upgrade Rollback Start event. + * + * @member {string} applicationTypeName Application type name. + * @member {string} currentApplicationTypeVersion Current Application type + * version. + * @member {string} applicationTypeVersion Target Application type version. + * @member {string} failureReason Describes reason of failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in + * milli-seconds. + */ +export interface ApplicationUpgradeRollbackStartEvent extends ApplicationEvent { + applicationTypeName: string; + currentApplicationTypeVersion: string; + applicationTypeVersion: string; + failureReason: string; + overallUpgradeElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationUpgradeStartEvent class. + * @constructor + * Application Upgrade Start event. + * + * @member {string} applicationTypeName Application type name. + * @member {string} currentApplicationTypeVersion Current Application type + * version. + * @member {string} applicationTypeVersion Target Application type version. + * @member {string} upgradeType Type of upgrade. + * @member {string} rollingUpgradeMode Mode of upgrade. + * @member {string} failureAction Action if failed. + */ +export interface ApplicationUpgradeStartEvent extends ApplicationEvent { + applicationTypeName: string; + currentApplicationTypeVersion: string; + applicationTypeVersion: string; + upgradeType: string; + rollingUpgradeMode: string; + failureAction: string; +} + +/** + * @class + * Initializes a new instance of the DeployedApplicationHealthReportCreatedEvent class. + * @constructor + * Deployed Application Health Report Created event. + * + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface DeployedApplicationHealthReportCreatedEvent extends ApplicationEvent { + applicationInstanceId: number; + nodeName: string; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the DeployedApplicationHealthReportExpiredEvent class. + * @constructor + * Deployed Application Health Report Expired event. + * + * @member {number} applicationInstanceId Id of Application instance. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface DeployedApplicationHealthReportExpiredEvent extends ApplicationEvent { + applicationInstanceId: number; + nodeName: string; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the ProcessDeactivatedEvent class. + * @constructor + * Process Deactivated event. + * + * @member {string} serviceName Name of Service. + * @member {string} servicePackageName Name of Service package. + * @member {string} servicePackageActivationId Activation Id of Service + * package. + * @member {boolean} isExclusive Indicates IsExclusive flag. + * @member {string} codePackageName Name of Code package. + * @member {string} entryPointType Type of EntryPoint. + * @member {string} exeName Name of executable. + * @member {number} processId Process Id. + * @member {string} hostId Host Id. + * @member {number} exitCode Exit code of process. + * @member {boolean} unexpectedTermination Indicates if termination is + * unexpected. + * @member {date} startTime Start time of process. + */ +export interface ProcessDeactivatedEvent extends ApplicationEvent { + serviceName: string; + servicePackageName: string; + servicePackageActivationId: string; + isExclusive: boolean; + codePackageName: string; + entryPointType: string; + exeName: string; + processId: number; + hostId: string; + exitCode: number; + unexpectedTermination: boolean; + startTime: Date; +} + +/** + * @class + * Initializes a new instance of the ContainerDeactivatedEvent class. + * @constructor + * Container Deactivated event. + * + * @member {string} serviceName Name of Service. + * @member {string} servicePackageName Name of Service package. + * @member {string} servicePackageActivationId Activation Id of Service + * package. + * @member {boolean} isExclusive Indicates IsExclusive flag. + * @member {string} codePackageName Name of Code package. + * @member {string} entryPointType Type of EntryPoint. + * @member {string} imageName Name of Container image. + * @member {string} containerName Name of Container. + * @member {string} hostId Host Id. + * @member {number} exitCode Exit code of process. + * @member {boolean} unexpectedTermination Indicates if termination is + * unexpected. + * @member {date} startTime Start time of process. + */ +export interface ContainerDeactivatedEvent extends ApplicationEvent { + serviceName: string; + servicePackageName: string; + servicePackageActivationId: string; + isExclusive: boolean; + codePackageName: string; + entryPointType: string; + imageName: string; + containerName: string; + hostId: string; + exitCode: number; + unexpectedTermination: boolean; + startTime: Date; +} + +/** + * @class + * Initializes a new instance of the NodeAbortedEvent class. + * @constructor + * Node Aborted event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ +export interface NodeAbortedEvent extends NodeEvent { + nodeInstance: number; + nodeId: string; + upgradeDomain: string; + faultDomain: string; + ipAddressOrFQDN: string; + hostname: string; + isSeedNode: boolean; + nodeVersion: string; +} + +/** + * @class + * Initializes a new instance of the NodeAbortingEvent class. + * @constructor + * Node Aborting event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ +export interface NodeAbortingEvent extends NodeEvent { + nodeInstance: number; + nodeId: string; + upgradeDomain: string; + faultDomain: string; + ipAddressOrFQDN: string; + hostname: string; + isSeedNode: boolean; + nodeVersion: string; +} + +/** + * @class + * Initializes a new instance of the NodeAddedEvent class. + * @constructor + * Node Added event. + * + * @member {string} nodeId Id of Node. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeType Type of Node. + * @member {string} fabricVersion Fabric version. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} nodeCapacities Capacities. + */ +export interface NodeAddedEvent extends NodeEvent { + nodeId: string; + nodeInstance: number; + nodeType: string; + fabricVersion: string; + ipAddressOrFQDN: string; + nodeCapacities: string; +} + +/** + * @class + * Initializes a new instance of the NodeCloseEvent class. + * @constructor + * Node Close event. + * + * @member {string} nodeId Id of Node. + * @member {string} nodeInstance Id of Node instance. + * @member {string} error Describes error. + */ +export interface NodeCloseEvent extends NodeEvent { + nodeId: string; + nodeInstance: string; + error: string; +} + +/** + * @class + * Initializes a new instance of the NodeClosingEvent class. + * @constructor + * Node Closing event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ +export interface NodeClosingEvent extends NodeEvent { + nodeInstance: number; + nodeId: string; + upgradeDomain: string; + faultDomain: string; + ipAddressOrFQDN: string; + hostname: string; + isSeedNode: boolean; + nodeVersion: string; +} + +/** + * @class + * Initializes a new instance of the NodeDeactivateCompleteEvent class. + * @constructor + * Node Deactivate Complete event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} effectiveDeactivateIntent Describes deactivate intent. + * @member {string} batchIdsWithDeactivateIntent Batch Ids. + * @member {date} startTime Start time. + */ +export interface NodeDeactivateCompleteEvent extends NodeEvent { + nodeInstance: number; + effectiveDeactivateIntent: string; + batchIdsWithDeactivateIntent: string; + startTime: Date; +} + +/** + * @class + * Initializes a new instance of the NodeDeactivateStartEvent class. + * @constructor + * Node Deactivate Start event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} batchId Batch Id. + * @member {string} deactivateIntent Describes deactivate intent. + */ +export interface NodeDeactivateStartEvent extends NodeEvent { + nodeInstance: number; + batchId: string; + deactivateIntent: string; +} + +/** + * @class + * Initializes a new instance of the NodeDownEvent class. + * @constructor + * Node Down event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {date} lastNodeUpAt Time when Node was last up. + */ +export interface NodeDownEvent extends NodeEvent { + nodeInstance: number; + lastNodeUpAt: Date; +} + +/** + * @class + * Initializes a new instance of the NodeHealthReportCreatedEvent class. + * @constructor + * Node Health Report Created event. + * + * @member {number} nodeInstanceId Id of Node instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface NodeHealthReportCreatedEvent extends NodeEvent { + nodeInstanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the NodeHealthReportExpiredEvent class. + * @constructor + * Node Health Report Expired event. + * + * @member {number} nodeInstanceId Id of Node instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface NodeHealthReportExpiredEvent extends NodeEvent { + nodeInstanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the NodeOpenedSuccessEvent class. + * @constructor + * Node Opened Success event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ +export interface NodeOpenedSuccessEvent extends NodeEvent { + nodeInstance: number; + nodeId: string; + upgradeDomain: string; + faultDomain: string; + ipAddressOrFQDN: string; + hostname: string; + isSeedNode: boolean; + nodeVersion: string; +} + +/** + * @class + * Initializes a new instance of the NodeOpenFailedEvent class. + * @constructor + * Node Open Failed event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + * @member {string} error Describes the error. + */ +export interface NodeOpenFailedEvent extends NodeEvent { + nodeInstance: number; + nodeId: string; + upgradeDomain: string; + faultDomain: string; + ipAddressOrFQDN: string; + hostname: string; + isSeedNode: boolean; + nodeVersion: string; + error: string; +} + +/** + * @class + * Initializes a new instance of the NodeOpeningEvent class. + * @constructor + * Node Opening event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ +export interface NodeOpeningEvent extends NodeEvent { + nodeInstance: number; + nodeId: string; + upgradeDomain: string; + faultDomain: string; + ipAddressOrFQDN: string; + hostname: string; + isSeedNode: boolean; + nodeVersion: string; +} + +/** + * @class + * Initializes a new instance of the NodeRemovedEvent class. + * @constructor + * Node Removed event. + * + * @member {string} nodeId Id of Node. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeType Type of Node. + * @member {string} fabricVersion Fabric version. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} nodeCapacities Capacities. + */ +export interface NodeRemovedEvent extends NodeEvent { + nodeId: string; + nodeInstance: number; + nodeType: string; + fabricVersion: string; + ipAddressOrFQDN: string; + nodeCapacities: string; +} + +/** + * @class + * Initializes a new instance of the NodeUpEvent class. + * @constructor + * Node Up event. + * + * @member {number} nodeInstance Id of Node instance. + * @member {date} lastNodeDownAt Time when Node was last down. + */ +export interface NodeUpEvent extends NodeEvent { + nodeInstance: number; + lastNodeDownAt: Date; +} + +/** + * @class + * Initializes a new instance of the PartitionHealthReportCreatedEvent class. + * @constructor + * Partition Health Report Created event. + * + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface PartitionHealthReportCreatedEvent extends PartitionEvent { + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the PartitionHealthReportExpiredEvent class. + * @constructor + * Partition Health Report Expired event. + * + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface PartitionHealthReportExpiredEvent extends PartitionEvent { + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the PartitionReconfigurationCompletedEvent class. + * @constructor + * Partition Reconfiguration Completed event. + * + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} nodeInstanceId Id of Node instance. + * @member {string} serviceType Type of Service. + * @member {number} ccEpochDataLossVersion CcEpochDataLoss version. + * @member {number} ccEpochConfigVersion CcEpochConfig version. + * @member {string} reconfigType Type of reconfiguration. + * @member {string} result Describes reconfiguration result. + * @member {number} phase0DurationMs Duration of Phase0 in milli-seconds. + * @member {number} phase1DurationMs Duration of Phase1 in milli-seconds. + * @member {number} phase2DurationMs Duration of Phase2 in milli-seconds. + * @member {number} phase3DurationMs Duration of Phase3 in milli-seconds. + * @member {number} phase4DurationMs Duration of Phase4 in milli-seconds. + * @member {number} totalDurationMs Total duration in milli-seconds. + */ +export interface PartitionReconfigurationCompletedEvent extends PartitionEvent { + nodeName: string; + nodeInstanceId: string; + serviceType: string; + ccEpochDataLossVersion: number; + ccEpochConfigVersion: number; + reconfigType: string; + result: string; + phase0DurationMs: number; + phase1DurationMs: number; + phase2DurationMs: number; + phase3DurationMs: number; + phase4DurationMs: number; + totalDurationMs: number; +} + +/** + * @class + * Initializes a new instance of the PartitionPrimaryMoveAnalysisEvent class. + * @constructor + * Partition Primary Move Analysis event. + * + * @member {date} whenMoveCompleted Time when the move was completed. + * @member {string} previousNode The name of a Service Fabric node. + * @member {string} currentNode The name of a Service Fabric node. + * @member {string} moveReason Move reason. + * @member {string} relevantTraces Relevant traces. + */ +export interface PartitionPrimaryMoveAnalysisEvent extends PartitionAnalysisEvent { + whenMoveCompleted: Date; + previousNode: string; + currentNode: string; + moveReason: string; + relevantTraces: string; +} + +/** + * @class + * Initializes a new instance of the ServiceCreatedEvent class. + * @constructor + * Service Created event. + * + * @member {string} serviceTypeName Service type name. + * @member {string} applicationName Application name. + * @member {string} applicationTypeName Application type name. + * @member {number} serviceInstance Id of Service instance. + * @member {boolean} isStateful Indicates if Service is stateful. + * @member {number} partitionCount Number of partitions. + * @member {number} targetReplicaSetSize Size of target replicas set. + * @member {number} minReplicaSetSize Minimum size of replicas set. + * @member {string} servicePackageVersion Version of Service package. + * @member {uuid} partitionId An internal ID used by Service Fabric to uniquely + * identify a partition. This is a randomly generated GUID when the service was + * created. The partition ID is unique and does not change for the lifetime of + * the service. If the same service was deleted and recreated the IDs of its + * partitions would be different. + */ +export interface ServiceCreatedEvent extends ServiceEvent { + serviceTypeName: string; + applicationName: string; + applicationTypeName: string; + serviceInstance: number; + isStateful: boolean; + partitionCount: number; + targetReplicaSetSize: number; + minReplicaSetSize: number; + servicePackageVersion: string; + partitionId: string; +} + +/** + * @class + * Initializes a new instance of the ServiceDeletedEvent class. + * @constructor + * Service Deleted event. + * + * @member {string} serviceTypeName Service type name. + * @member {string} applicationName Application name. + * @member {string} applicationTypeName Application type name. + * @member {number} serviceInstance Id of Service instance. + * @member {boolean} isStateful Indicates if Service is stateful. + * @member {number} partitionCount Number of partitions. + * @member {number} targetReplicaSetSize Size of target replicas set. + * @member {number} minReplicaSetSize Minimum size of replicas set. + * @member {string} servicePackageVersion Version of Service package. + */ +export interface ServiceDeletedEvent extends ServiceEvent { + serviceTypeName: string; + applicationName: string; + applicationTypeName: string; + serviceInstance: number; + isStateful: boolean; + partitionCount: number; + targetReplicaSetSize: number; + minReplicaSetSize: number; + servicePackageVersion: string; +} + +/** + * @class + * Initializes a new instance of the ServiceHealthReportCreatedEvent class. + * @constructor + * Service Health Report Created event. + * + * @member {number} instanceId Id of Service instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface ServiceHealthReportCreatedEvent extends ServiceEvent { + instanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the ServiceHealthReportExpiredEvent class. + * @constructor + * Service Health Report Expired event. + * + * @member {number} instanceId Id of Service instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface ServiceHealthReportExpiredEvent extends ServiceEvent { + instanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the DeployedServiceHealthReportCreatedEvent class. + * @constructor + * Deployed Service Health Report Created event. + * + * @member {string} serviceManifestName Service manifest name. + * @member {number} servicePackageInstanceId Id of Service package instance. + * @member {string} servicePackageActivationId Id of Service package + * activation. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} tTLTimespan Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface DeployedServiceHealthReportCreatedEvent extends ApplicationEvent { + serviceManifestName: string; + servicePackageInstanceId: number; + servicePackageActivationId: string; + nodeName: string; + sourceId: string; + property: string; + healthState: string; + tTLTimespan: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the DeployedServiceHealthReportExpiredEvent class. + * @constructor + * Deployed Service Health Report Expired event. + * + * @member {string} serviceManifest Service manifest name. + * @member {number} servicePackageInstanceId Id of Service package instance. + * @member {string} servicePackageActivationId Id of Service package + * activation. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} tTLTimespan Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface DeployedServiceHealthReportExpiredEvent extends ApplicationEvent { + serviceManifest: string; + servicePackageInstanceId: number; + servicePackageActivationId: string; + nodeName: string; + sourceId: string; + property: string; + healthState: string; + tTLTimespan: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the StatefulReplicaHealthReportCreatedEvent class. + * @constructor + * Stateful Replica Health Report Created event. + * + * @member {number} replicaInstanceId Id of Replica instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface StatefulReplicaHealthReportCreatedEvent extends ReplicaEvent { + replicaInstanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the StatefulReplicaHealthReportExpiredEvent class. + * @constructor + * Stateful Replica Health Report Expired event. + * + * @member {number} replicaInstanceId Id of Replica instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface StatefulReplicaHealthReportExpiredEvent extends ReplicaEvent { + replicaInstanceId: number; + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the StatelessReplicaHealthReportCreatedEvent class. + * @constructor + * Stateless Replica Health Report Created event. + * + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface StatelessReplicaHealthReportCreatedEvent extends ReplicaEvent { + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the StatelessReplicaHealthReportExpiredEvent class. + * @constructor + * Stateless Replica Health Report Expired event. + * + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface StatelessReplicaHealthReportExpiredEvent extends ReplicaEvent { + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the ClusterHealthReportCreatedEvent class. + * @constructor + * Cluster Health Report Created event. + * + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface ClusterHealthReportCreatedEvent extends ClusterEvent { + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the ClusterHealthReportExpiredEvent class. + * @constructor + * Cluster Health Report Expired event. + * + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ +export interface ClusterHealthReportExpiredEvent extends ClusterEvent { + sourceId: string; + property: string; + healthState: string; + timeToLiveMs: number; + sequenceNumber: number; + description: string; + removeWhenExpired: boolean; + sourceUtcTimestamp: Date; +} + +/** + * @class + * Initializes a new instance of the ClusterUpgradeCompleteEvent class. + * @constructor + * Cluster Upgrade Complete event. + * + * @member {string} targetClusterVersion Target Cluster version. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. + */ +export interface ClusterUpgradeCompleteEvent extends ClusterEvent { + targetClusterVersion: string; + overallUpgradeElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ClusterUpgradeDomainCompleteEvent class. + * @constructor + * Cluster Upgrade Domain Complete event. + * + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} upgradeState State of upgrade. + * @member {string} upgradeDomains Upgrade domains. + * @member {number} upgradeDomainElapsedTimeInMs Duration of domain upgrade in + * milli-seconds. + */ +export interface ClusterUpgradeDomainCompleteEvent extends ClusterEvent { + targetClusterVersion: string; + upgradeState: string; + upgradeDomains: string; + upgradeDomainElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ClusterUpgradeRollbackCompleteEvent class. + * @constructor + * Cluster Upgrade Rollback Complete event. + * + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} failureReason Describes failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. + */ +export interface ClusterUpgradeRollbackCompleteEvent extends ClusterEvent { + targetClusterVersion: string; + failureReason: string; + overallUpgradeElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ClusterUpgradeRollbackStartEvent class. + * @constructor + * Cluster Upgrade Rollback Start event. + * + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} failureReason Describes failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. + */ +export interface ClusterUpgradeRollbackStartEvent extends ClusterEvent { + targetClusterVersion: string; + failureReason: string; + overallUpgradeElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ClusterUpgradeStartEvent class. + * @constructor + * Cluster Upgrade Start event. + * + * @member {string} currentClusterVersion Current Cluster version. + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} upgradeType Type of upgrade. + * @member {string} rollingUpgradeMode Mode of upgrade. + * @member {string} failureAction Action if failed. + */ +export interface ClusterUpgradeStartEvent extends ClusterEvent { + currentClusterVersion: string; + targetClusterVersion: string; + upgradeType: string; + rollingUpgradeMode: string; + failureAction: string; +} + +/** + * @class + * Initializes a new instance of the ChaosStoppedEvent class. + * @constructor + * Chaos Stopped event. + * + * @member {string} reason Describes reason. + */ +export interface ChaosStoppedEvent extends ClusterEvent { + reason: string; +} + +/** + * @class + * Initializes a new instance of the ChaosStartedEvent class. + * @constructor + * Chaos Started event. + * + * @member {number} maxConcurrentFaults Maximum number of concurrent faults. + * @member {number} timeToRunInSeconds Time to run in seconds. + * @member {number} maxClusterStabilizationTimeoutInSeconds Maximum timeout for + * cluster stabilization in seconds. + * @member {number} waitTimeBetweenIterationsInSeconds Wait time between + * iterations in seconds. + * @member {number} waitTimeBetweenFautlsInSeconds Wait time between faults in + * seconds. + * @member {boolean} moveReplicaFaultEnabled Indicates MoveReplica fault is + * enabled. + * @member {string} includedNodeTypeList List of included Node types. + * @member {string} includedApplicationList List of included Applications. + * @member {string} clusterHealthPolicy Health policy. + * @member {string} chaosContext Chaos Context. + */ +export interface ChaosStartedEvent extends ClusterEvent { + maxConcurrentFaults: number; + timeToRunInSeconds: number; + maxClusterStabilizationTimeoutInSeconds: number; + waitTimeBetweenIterationsInSeconds: number; + waitTimeBetweenFautlsInSeconds: number; + moveReplicaFaultEnabled: boolean; + includedNodeTypeList: string; + includedApplicationList: string; + clusterHealthPolicy: string; + chaosContext: string; +} + +/** + * @class + * Initializes a new instance of the ChaosRestartNodeFaultCompletedEvent class. + * @constructor + * Chaos Restart Node Fault Completed event. + * + * @member {number} nodeInstanceId Id of Node instance. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + */ +export interface ChaosRestartNodeFaultCompletedEvent extends NodeEvent { + nodeInstanceId: number; + faultGroupId: string; + faultId: string; +} + +/** + * @class + * Initializes a new instance of the ChaosRestartCodePackageFaultScheduledEvent class. + * @constructor + * Chaos Restart Code Package Fault Scheduled event. + * + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} serviceManifestName Service manifest name. + * @member {string} codePackageName Code package name. + * @member {string} servicePackageActivationId Id of Service package + * activation. + */ +export interface ChaosRestartCodePackageFaultScheduledEvent extends ApplicationEvent { + faultGroupId: string; + faultId: string; + nodeName: string; + serviceManifestName: string; + codePackageName: string; + servicePackageActivationId: string; +} + +/** + * @class + * Initializes a new instance of the ChaosRestartCodePackageFaultCompletedEvent class. + * @constructor + * Chaos Restart Code Package Fault Completed event. + * + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} serviceManifestName Service manifest name. + * @member {string} codePackageName Code package name. + * @member {string} servicePackageActivationId Id of Service package + * activation. + */ +export interface ChaosRestartCodePackageFaultCompletedEvent extends ApplicationEvent { + faultGroupId: string; + faultId: string; + nodeName: string; + serviceManifestName: string; + codePackageName: string; + servicePackageActivationId: string; +} + +/** + * @class + * Initializes a new instance of the ChaosRemoveReplicaFaultScheduledEvent class. + * @constructor + * Chaos Remove Replica Fault Scheduled event. + * + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ +export interface ChaosRemoveReplicaFaultScheduledEvent extends ReplicaEvent { + faultGroupId: string; + faultId: string; + serviceUri: string; +} + +/** + * @class + * Initializes a new instance of the ChaosRemoveReplicaFaultCompletedEvent class. + * @constructor + * Chaos Remove Replica Fault Completed event. + * + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ +export interface ChaosRemoveReplicaFaultCompletedEvent extends ReplicaEvent { + faultGroupId: string; + faultId: string; + serviceUri: string; +} + +/** + * @class + * Initializes a new instance of the ChaosMoveSecondaryFaultScheduledEvent class. + * @constructor + * Chaos Move Secondary Fault Scheduled event. + * + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceName Service name. + * @member {string} sourceNode The name of a Service Fabric node. + * @member {string} destinationNode The name of a Service Fabric node. + * @member {boolean} forcedMove Indicates a forced move. + */ +export interface ChaosMoveSecondaryFaultScheduledEvent extends PartitionEvent { + faultGroupId: string; + faultId: string; + serviceName: string; + sourceNode: string; + destinationNode: string; + forcedMove: boolean; +} + +/** + * @class + * Initializes a new instance of the ChaosMovePrimaryFaultScheduledEvent class. + * @constructor + * Chaos Move Primary Fault Scheduled event. + * + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceName Service name. + * @member {string} nodeTo The name of a Service Fabric node. + * @member {boolean} forcedMove Indicates a forced move. + */ +export interface ChaosMovePrimaryFaultScheduledEvent extends PartitionEvent { + faultGroupId: string; + faultId: string; + serviceName: string; + nodeTo: string; + forcedMove: boolean; +} + +/** + * @class + * Initializes a new instance of the ChaosRestartReplicaFaultScheduledEvent class. + * @constructor + * Chaos Restart Replica Fault Scheduled event. + * + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ +export interface ChaosRestartReplicaFaultScheduledEvent extends ReplicaEvent { + faultGroupId: string; + faultId: string; + serviceUri: string; +} + +/** + * @class + * Initializes a new instance of the ChaosRestartNodeFaultScheduledEvent class. + * @constructor + * Chaos Restart Node Fault Scheduled event. + * + * @member {number} nodeInstanceId Id of Node instance. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + */ +export interface ChaosRestartNodeFaultScheduledEvent extends NodeEvent { + nodeInstanceId: number; + faultGroupId: string; + faultId: string; +} + +/** + * @class + * Initializes a new instance of the ServiceResourceDescription class. + * @constructor + * Describes a service fabric service resource. + * + * @member {string} osType The Operating system type required by the code in + * service. Possible values include: 'Linux', 'Windows' + * @member {array} codePackages Describes the set of code packages that forms + * the service. A code package describes the container and the properties for + * running it. All the code packages are started together on the same host and + * share the same context (network, process etc.). + * @member {array} [networkRefs] The names of the private networks that this + * service needs to be part of. + * @member {object} [diagnostics] Reference to sinks in DiagnosticsDescription. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.sinkRefs] List of sinks to be used if enabled. + * References the list of sinks in DiagnosticsDescription. + * @member {string} [description] User readable description of the service. + * @member {number} [replicaCount] The number of replicas of the service to + * create. Defaults to 1 if not specified. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [status] Represents the status of the service. Possible + * values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', + * 'Failed' + * @member {string} name Service resource name. + */ +export interface ServiceResourceDescription { + osType: string; + codePackages: ContainerCodePackageProperties[]; + networkRefs?: NetworkRef[]; + diagnostics?: DiagnosticsRef; + description?: string; + replicaCount?: number; + healthState?: string; + readonly status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticsSinkProperties class. + * @constructor + * Properties of a DiagnosticsSink. + * + * @member {string} [name] Name of the sink. This value is referenced by + * DiagnosticsReferenceDescription + * @member {string} [description] A description of the sink. + * @member {string} kind Polymorphic Discriminator + */ +export interface DiagnosticsSinkProperties { + name?: string; + description?: string; + kind: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticsDescription class. + * @constructor + * Describes the diagnostics options available + * + * @member {array} [sinks] List of supported sinks that can be referenced. + * @member {boolean} [enabled] Status of whether or not sinks are enabled. + * @member {array} [defaultSinkRefs] The sinks to be used if diagnostics is + * enabled. Sink choices can be overridden at the service and code package + * level. + */ +export interface DiagnosticsDescription { + sinks?: DiagnosticsSinkProperties[]; + enabled?: boolean; + defaultSinkRefs?: string[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationResourceDescription class. + * @constructor + * Describes a service fabric application resource. + * + * @member {string} [description] User readable description of the application. + * @member {string} [debugParams] Internal use. + * @member {array} [services] describes the services in the application. + * @member {string} [healthState] Describes the health state of an application + * resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * @member {string} [unhealthyEvaluation] When the application's health state + * is not 'Ok', this additional details from service fabric Health Manager for + * the user to know why the application is marked unhealthy. + * @member {string} [status] Status of the application resource. Possible + * values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', + * 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the application deployment. + * @member {array} [serviceNames] Names of the services in the application. + * @member {object} [diagnostics] Describes the diagnostics definition and + * usage for an application resource. + * @member {array} [diagnostics.sinks] List of supported sinks that can be + * referenced. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.defaultSinkRefs] The sinks to be used if + * diagnostics is enabled. Sink choices can be overridden at the service and + * code package level. + * @member {string} name Application resource name. + */ +export interface ApplicationResourceDescription { + description?: string; + debugParams?: string; + services?: ServiceResourceDescription[]; + readonly healthState?: string; + readonly unhealthyEvaluation?: string; + readonly status?: string; + readonly statusDetails?: string; + readonly serviceNames?: string[]; + diagnostics?: DiagnosticsDescription; + name: string; +} + +/** + * @class + * Initializes a new instance of the PagedServiceResourceDescriptionList class. + * @constructor + * The list of service resources in the cluster. The list is paged when all of + * the results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. + * + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service resource description. + */ +export interface PagedServiceResourceDescriptionList { + continuationToken?: string; + items?: ServiceResourceDescription[]; +} + +/** + * @class + * Initializes a new instance of the ServiceReplicaProperties class. + * @constructor + * Describes the properties of a service replica. * - * @member {string} taskId The ID of the repair task. - * @member {string} [version] The version of the repair task. - * When creating a new repair task, the version must be set to zero. When - * updating a repair task, - * the version is used for optimistic concurrency checks. If the version is - * set to zero, the update will not check for write conflicts. If the version - * is set to a non-zero value, then the - * update will only succeed if the actual current version of the repair task - * matches this value. - * @member {string} [description] A description of the purpose of the repair - * task, or other informational details. - * May be set when the repair task is created, and is immutable once set. - * @member {string} state The workflow state of the repair task. Valid initial - * states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' - * @member {number} [flags] A bitwise-OR of the following values, which gives - * additional details about the status of the repair task. - * - 1 - Cancellation of the repair has been requested - * - 2 - Abort of the repair has been requested - * - 4 - Approval of the repair was forced via client request - * @member {string} action The requested repair action. Must be specified when - * the repair task is created, and is immutable once set. - * @member {object} [target] - * @member {string} [target.kind] Polymorphic Discriminator - * @member {string} [executor] The name of the repair executor. Must be - * specified in Claimed and later states, and is immutable once set. - * @member {string} [executorData] A data string that the repair executor can - * use to store its internal state. - * @member {object} [impact] - * @member {string} [impact.kind] Polymorphic Discriminator - * @member {string} [resultStatus] A value describing the overall result of the - * repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. + * @member {string} osType The Operating system type required by the code in + * service. Possible values include: 'Linux', 'Windows' + * @member {array} codePackages Describes the set of code packages that forms + * the service. A code package describes the container and the properties for + * running it. All the code packages are started together on the same host and + * share the same context (network, process etc.). + * @member {array} [networkRefs] The names of the private networks that this + * service needs to be part of. + * @member {object} [diagnostics] Reference to sinks in DiagnosticsDescription. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.sinkRefs] List of sinks to be used if enabled. + * References the list of sinks in DiagnosticsDescription. + */ +export interface ServiceReplicaProperties { + osType: string; + codePackages: ContainerCodePackageProperties[]; + networkRefs?: NetworkRef[]; + diagnostics?: DiagnosticsRef; +} + +/** + * @class + * Initializes a new instance of the ServiceResourceReplicaDescription class. + * @constructor + * Describes a replica of a service resource. * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' - * @member {number} [resultCode] A numeric value providing additional details - * about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * @member {string} [resultDetails] A string providing additional details about - * the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * @member {object} [history] - * @member {date} [history.createdUtcTimestamp] The time when the repair task - * entered the Created state. - * @member {date} [history.claimedUtcTimestamp] The time when the repair task - * entered the Claimed state. - * @member {date} [history.preparingUtcTimestamp] The time when the repair task - * entered the Preparing state. - * @member {date} [history.approvedUtcTimestamp] The time when the repair task - * entered the Approved state - * @member {date} [history.executingUtcTimestamp] The time when the repair task - * entered the Executing state - * @member {date} [history.restoringUtcTimestamp] The time when the repair task - * entered the Restoring state - * @member {date} [history.completedUtcTimestamp] The time when the repair task - * entered the Completed state - * @member {date} [history.preparingHealthCheckStartUtcTimestamp] The time when - * the repair task started the health check in the Preparing state. - * @member {date} [history.preparingHealthCheckEndUtcTimestamp] The time when - * the repair task completed the health check in the Preparing state. - * @member {date} [history.restoringHealthCheckStartUtcTimestamp] The time when - * the repair task started the health check in the Restoring state. - * @member {date} [history.restoringHealthCheckEndUtcTimestamp] The time when - * the repair task completed the health check in the Restoring state. - * @member {string} [preparingHealthCheckState] Possible values include: - * 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' - * @member {string} [restoringHealthCheckState] Possible values include: - * 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' - * @member {boolean} [performPreparingHealthCheck] A value to determine if - * health checks will be performed when the repair task enters the Preparing - * state. - * @member {boolean} [performRestoringHealthCheck] A value to determine if - * health checks will be performed when the repair task enters the Restoring - * state. + * @member {string} replicaName Name of the replica. */ -export interface RepairTask { - taskId: string; - version?: string; - description?: string; - state: string; - flags?: number; - action: string; - target?: RepairTargetDescriptionBase; - executor?: string; - executorData?: string; - impact?: RepairImpactDescriptionBase; - resultStatus?: string; - resultCode?: number; - resultDetails?: string; - history?: RepairTaskHistory; - preparingHealthCheckState?: string; - restoringHealthCheckState?: string; - performPreparingHealthCheck?: boolean; - performRestoringHealthCheck?: boolean; +export interface ServiceResourceReplicaDescription extends ServiceReplicaProperties { + replicaName: string; } /** * @class - * Initializes a new instance of the RepairTaskApproveDescription class. + * Initializes a new instance of the PagedServiceResourceReplicaDescriptionList class. * @constructor - * Describes a request for forced approval of a repair task. + * The list of service resources in the cluster. The list is paged when all of + * the results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service resource description. + */ +export interface PagedServiceResourceReplicaDescriptionList { + continuationToken?: string; + items?: ServiceResourceReplicaDescription[]; +} + +/** + * @class + * Initializes a new instance of the VolumeProviderParametersAzureFile class. + * @constructor + * This type describes a volume provided by an Azure Files file share. * + * @member {string} accountName Name of the Azure storage account for the File + * Share. + * @member {string} [accountKey] Access key of the Azure storage account for + * the File Share. + * @member {string} shareName Name of the Azure Files file share that provides + * storage for the volume. + */ +export interface VolumeProviderParametersAzureFile { + accountName: string; + accountKey?: string; + shareName: string; +} + +/** + * @class + * Initializes a new instance of the VolumeResourceDescription class. + * @constructor + * Describes a service fabric volume resource. * - * @member {string} taskId The ID of the repair task. - * @member {string} [version] The current version number of the repair task. If - * non-zero, then the request will only succeed if this value matches the - * actual current version of the repair task. If zero, then no version check is - * performed. + * @member {string} [description] User readable description of the volume. + * @member {object} [azureFileParameters] This type describes a volume provided + * by an Azure Files file share. + * @member {string} [azureFileParameters.accountName] Name of the Azure storage + * account for the File Share. + * @member {string} [azureFileParameters.accountKey] Access key of the Azure + * storage account for the File Share. + * @member {string} [azureFileParameters.shareName] Name of the Azure Files + * file share that provides storage for the volume. + * @member {string} name Volume resource name. */ -export interface RepairTaskApproveDescription { - taskId: string; - version?: string; +export interface VolumeResourceDescription { + description?: string; + azureFileParameters?: VolumeProviderParametersAzureFile; + name: string; } /** * @class - * Initializes a new instance of the RepairTaskCancelDescription class. + * Initializes a new instance of the ImageRegistryCredential class. * @constructor - * Describes a request to cancel a repair task. + * Image registry credential. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {string} server Docker image registry server, without protocol such + * as `http` and `https`. + * @member {string} username The username for the private registry. + * @member {string} [password] The password for the private registry. + */ +export interface ImageRegistryCredential { + server: string; + username: string; + password?: string; +} + +/** + * @class + * Initializes a new instance of the EnvironmentVariable class. + * @constructor + * Describes an environment variable for the container. * + * @member {string} [name] The name of the environment variable. + * @member {string} [value] The value of the environment variable. + */ +export interface EnvironmentVariable { + name?: string; + value?: string; +} + +/** + * @class + * Initializes a new instance of the Setting class. + * @constructor + * Describes a setting for the container. * - * @member {string} taskId The ID of the repair task. - * @member {string} [version] The current version number of the repair task. If - * non-zero, then the request will only succeed if this value matches the - * actual current version of the repair task. If zero, then no version check is - * performed. - * @member {boolean} [requestAbort] _True_ if the repair should be stopped as - * soon as possible even if it has already started executing. _False_ if the - * repair should be cancelled only if execution has not yet started. + * @member {string} [name] The name of the setting. + * @member {string} [value] The value of the setting. */ -export interface RepairTaskCancelDescription { - taskId: string; - version?: string; - requestAbort?: boolean; +export interface Setting { + name?: string; + value?: string; } /** * @class - * Initializes a new instance of the RepairTaskDeleteDescription class. + * Initializes a new instance of the ContainerLabel class. * @constructor - * Describes a request to delete a completed repair task. + * Describes a container label. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {string} name The name of the container label. + * @member {string} value The value of the container label. + */ +export interface ContainerLabel { + name: string; + value: string; +} + +/** + * @class + * Initializes a new instance of the EndpointProperties class. + * @constructor + * Describes a container endpoint. * + * @member {string} name The name of the endpoint. + * @member {number} [port] Port used by the container. + */ +export interface EndpointProperties { + name: string; + port?: number; +} + +/** + * @class + * Initializes a new instance of the ResourceRequests class. + * @constructor + * This type describes the requested resources for a given container. It + * describes the least amount of resources required for the container. A + * container can consume more than requested resources up to the specified + * limits before being restarted. Currently, the requested resources are + * treated as limits. * - * @member {string} taskId The ID of the completed repair task to be deleted. - * @member {string} [version] The current version number of the repair task. If - * non-zero, then the request will only succeed if this value matches the - * actual current version of the repair task. If zero, then no version check is - * performed. + * @member {number} memoryInGB The memory request in GB for this container. + * @member {number} cpu Requested number of CPU cores. At present, only full + * cores are supported. */ -export interface RepairTaskDeleteDescription { - taskId: string; - version?: string; +export interface ResourceRequests { + memoryInGB: number; + cpu: number; } /** * @class - * Initializes a new instance of the RepairTaskUpdateHealthPolicyDescription class. + * Initializes a new instance of the ResourceLimits class. * @constructor - * Describes a request to update the health policy of a repair task. + * This type describes the resource limits for a given container. It describes + * the most amount of resources a container is allowed to use before being + * restarted. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {number} [memoryInGB] The memory limit in GB. + * @member {number} [cpu] CPU limits in cores. At present, only full cores are + * supported. + */ +export interface ResourceLimits { + memoryInGB?: number; + cpu?: number; +} + +/** + * @class + * Initializes a new instance of the ResourceRequirements class. + * @constructor + * This type describes the resource requirements for a container or a service. * + * @member {object} requests Describes the requested resources for a given + * container. + * @member {number} [requests.memoryInGB] The memory request in GB for this + * container. + * @member {number} [requests.cpu] Requested number of CPU cores. At present, + * only full cores are supported. + * @member {object} [limits] Describes the maximum limits on the resources for + * a given container. + * @member {number} [limits.memoryInGB] The memory limit in GB. + * @member {number} [limits.cpu] CPU limits in cores. At present, only full + * cores are supported. + */ +export interface ResourceRequirements { + requests: ResourceRequests; + limits?: ResourceLimits; +} + +/** + * @class + * Initializes a new instance of the ContainerVolume class. + * @constructor + * Describes how a volume is attached to a container. * - * @member {string} taskId The ID of the repair task to be updated. - * @member {string} [version] The current version number of the repair task. If - * non-zero, then the request will only succeed if this value matches the - * actual current value of the repair task. If zero, then no version check is - * performed. - * @member {boolean} [performPreparingHealthCheck] A boolean indicating if - * health check is to be performed in the Preparing stage of the repair task. - * If not specified the existing value should not be altered. Otherwise, - * specify the desired new value. - * @member {boolean} [performRestoringHealthCheck] A boolean indicating if - * health check is to be performed in the Restoring stage of the repair task. - * If not specified the existing value should not be altered. Otherwise, - * specify the desired new value. + * @member {string} name Name of the volume. + * @member {boolean} [readOnly] The flag indicating whether the volume is read + * only. Default is 'false'. + * @member {string} destinationPath The path within the container at which the + * volume should be mounted. Only valid path characters are allowed. */ -export interface RepairTaskUpdateHealthPolicyDescription { - taskId: string; - version?: string; - performPreparingHealthCheck?: boolean; - performRestoringHealthCheck?: boolean; +export interface ContainerVolume { + name: string; + readOnly?: boolean; + destinationPath: string; } /** * @class - * Initializes a new instance of the RepairTaskUpdateInfo class. + * Initializes a new instance of the ContainerState class. * @constructor - * Describes the result of an operation that created or updated a repair task. + * The container state. * - * This type supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @member {string} [state] The state of this container + * @member {date} [startTime] Date/time when the container state started. + * @member {string} [exitCode] The container exit code. + * @member {date} [finishTime] Date/time when the container state finished. + * @member {string} [detailStatus] Human-readable status of this state. + */ +export interface ContainerState { + state?: string; + startTime?: Date; + exitCode?: string; + finishTime?: Date; + detailStatus?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerEvent class. + * @constructor + * A container event. + * + * @member {string} [name] The name of the container event. + * @member {number} [count] The count of the event. + * @member {string} [firstTimestamp] Date/time of the first event. + * @member {string} [lastTimestamp] Date/time of the last event. + * @member {string} [message] The event message + * @member {string} [type] The event type. + */ +export interface ContainerEvent { + name?: string; + count?: number; + firstTimestamp?: string; + lastTimestamp?: string; + message?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerInstanceView class. + * @constructor + * Runtime information of a container instance. * + * @member {number} [restartCount] The number of times the container has been + * restarted. + * @member {object} [currentState] Current container instance state. + * @member {string} [currentState.state] The state of this container + * @member {date} [currentState.startTime] Date/time when the container state + * started. + * @member {string} [currentState.exitCode] The container exit code. + * @member {date} [currentState.finishTime] Date/time when the container state + * finished. + * @member {string} [currentState.detailStatus] Human-readable status of this + * state. + * @member {object} [previousState] Previous container instance state. + * @member {string} [previousState.state] The state of this container + * @member {date} [previousState.startTime] Date/time when the container state + * started. + * @member {string} [previousState.exitCode] The container exit code. + * @member {date} [previousState.finishTime] Date/time when the container state + * finished. + * @member {string} [previousState.detailStatus] Human-readable status of this + * state. + * @member {array} [events] The events of this container instance. + */ +export interface ContainerInstanceView { + restartCount?: number; + currentState?: ContainerState; + previousState?: ContainerState; + events?: ContainerEvent[]; +} + +/** + * @class + * Initializes a new instance of the DiagnosticsRef class. + * @constructor + * Reference to sinks in DiagnosticsDescription. + * + * @member {boolean} [enabled] Status of whether or not sinks are enabled. + * @member {array} [sinkRefs] List of sinks to be used if enabled. References + * the list of sinks in DiagnosticsDescription. + */ +export interface DiagnosticsRef { + enabled?: boolean; + sinkRefs?: string[]; +} + +/** + * @class + * Initializes a new instance of the ContainerCodePackageProperties class. + * @constructor + * Describes a container and its runtime properties. + * + * @member {string} name The name of the code package. + * @member {string} image The Container image to use. + * @member {object} [imageRegistryCredential] Image registry credential. + * @member {string} [imageRegistryCredential.server] Docker image registry + * server, without protocol such as `http` and `https`. + * @member {string} [imageRegistryCredential.username] The username for the + * private registry. + * @member {string} [imageRegistryCredential.password] The password for the + * private registry. + * @member {string} [entrypoint] Override for the default entry point in the + * container. + * @member {array} [commands] Command array to execute within the container in + * exec form. + * @member {array} [environmentVariables] The environment variables to set in + * this container + * @member {array} [settings] The settings to set in this container. The + * setting file path can be fetched from environment variable + * "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The + * path for Linux container is "/var/secrets". + * @member {array} [labels] The labels to set in this container. + * @member {array} [endpoints] The endpoints exposed by this container. + * @member {object} resources This type describes the resource requirements for + * a container or a service. + * @member {object} [resources.requests] Describes the requested resources for + * a given container. + * @member {number} [resources.requests.memoryInGB] The memory request in GB + * for this container. + * @member {number} [resources.requests.cpu] Requested number of CPU cores. At + * present, only full cores are supported. + * @member {object} [resources.limits] Describes the maximum limits on the + * resources for a given container. + * @member {number} [resources.limits.memoryInGB] The memory limit in GB. + * @member {number} [resources.limits.cpu] CPU limits in cores. At present, + * only full cores are supported. + * @member {array} [volumeRefs] The volumes to be attached to the container. + * @member {object} [instanceView] Runtime information of a container instance. + * @member {number} [instanceView.restartCount] The number of times the + * container has been restarted. + * @member {object} [instanceView.currentState] Current container instance + * state. + * @member {string} [instanceView.currentState.state] The state of this + * container + * @member {date} [instanceView.currentState.startTime] Date/time when the + * container state started. + * @member {string} [instanceView.currentState.exitCode] The container exit + * code. + * @member {date} [instanceView.currentState.finishTime] Date/time when the + * container state finished. + * @member {string} [instanceView.currentState.detailStatus] Human-readable + * status of this state. + * @member {object} [instanceView.previousState] Previous container instance + * state. + * @member {string} [instanceView.previousState.state] The state of this + * container + * @member {date} [instanceView.previousState.startTime] Date/time when the + * container state started. + * @member {string} [instanceView.previousState.exitCode] The container exit + * code. + * @member {date} [instanceView.previousState.finishTime] Date/time when the + * container state finished. + * @member {string} [instanceView.previousState.detailStatus] Human-readable + * status of this state. + * @member {array} [instanceView.events] The events of this container instance. + * @member {object} [diagnostics] Reference to sinks in DiagnosticsDescription. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.sinkRefs] List of sinks to be used if enabled. + * References the list of sinks in DiagnosticsDescription. + */ +export interface ContainerCodePackageProperties { + name: string; + image: string; + imageRegistryCredential?: ImageRegistryCredential; + entrypoint?: string; + commands?: string[]; + environmentVariables?: EnvironmentVariable[]; + settings?: Setting[]; + labels?: ContainerLabel[]; + endpoints?: EndpointProperties[]; + resources: ResourceRequirements; + volumeRefs?: ContainerVolume[]; + readonly instanceView?: ContainerInstanceView; + diagnostics?: DiagnosticsRef; +} + +/** + * @class + * Initializes a new instance of the NetworkRef class. + * @constructor + * Describes a network reference in a service. * - * @member {string} version The new version of the repair task. + * @member {string} [name] Name of the network. */ -export interface RepairTaskUpdateInfo { - version: string; +export interface NetworkRef { + name?: string; } diff --git a/lib/services/serviceFabric/lib/models/index.js b/lib/services/serviceFabric/lib/models/index.js index 688a00c81c..ca17e2f246 100644 --- a/lib/services/serviceFabric/lib/models/index.js +++ b/lib/services/serviceFabric/lib/models/index.js @@ -16,6 +16,9 @@ exports.AadMetadata = require('./aadMetadata'); exports.AadMetadataObject = require('./aadMetadataObject'); +exports.AnalysisEventMetadata = require('./analysisEventMetadata'); +exports.FabricEvent = require('./fabricEvent'); +exports.ApplicationEvent = require('./applicationEvent'); exports.EntityHealthState = require('./entityHealthState'); exports.ServiceHealthState = require('./serviceHealthState'); exports.DeployedApplicationHealthState = require('./deployedApplicationHealthState'); @@ -71,6 +74,7 @@ exports.CurrentUpgradeDomainProgressInfo = require('./currentUpgradeDomainProgre exports.FailureUpgradeDomainProgressInfo = require('./failureUpgradeDomainProgressInfo'); exports.ApplicationUpgradeProgressInfo = require('./applicationUpgradeProgressInfo'); exports.ClusterConfiguration = require('./clusterConfiguration'); +exports.ClusterEvent = require('./clusterEvent'); exports.NodeId = require('./nodeId'); exports.NodeHealthState = require('./nodeHealthState'); exports.ClusterHealth = require('./clusterHealth'); @@ -82,6 +86,10 @@ exports.ClusterHealthPolicy = require('./clusterHealthPolicy'); exports.ClusterHealthChunkQueryDescription = require('./clusterHealthChunkQueryDescription'); exports.ClusterHealthPolicies = require('./clusterHealthPolicies'); exports.ClusterManifest = require('./clusterManifest'); +exports.ContainerApiRequestBody = require('./containerApiRequestBody'); +exports.ContainerApiResult = require('./containerApiResult'); +exports.ContainerApiResponse = require('./containerApiResponse'); +exports.ContainerInstanceEvent = require('./containerInstanceEvent'); exports.DeactivationIntentDescription = require('./deactivationIntentDescription'); exports.DeltaNodesCheckHealthEvaluation = require('./deltaNodesCheckHealthEvaluation'); exports.DeployedServicePackageHealthState = require('./deployedServicePackageHealthState'); @@ -102,6 +110,7 @@ exports.HealthStateCount = require('./healthStateCount'); exports.EntityKindHealthStateCount = require('./entityKindHealthStateCount'); exports.HealthStatistics = require('./healthStatistics'); exports.Epoch = require('./epoch'); +exports.BackupEpoch = require('./backupEpoch'); exports.EventHealthEvaluation = require('./eventHealthEvaluation'); exports.FabricCodeVersionInfo = require('./fabricCodeVersionInfo'); exports.FabricConfigVersionInfo = require('./fabricConfigVersionInfo'); @@ -114,6 +123,7 @@ exports.NamedPartitionInformation = require('./namedPartitionInformation'); exports.NodeDeactivationTaskId = require('./nodeDeactivationTaskId'); exports.NodeDeactivationTask = require('./nodeDeactivationTask'); exports.NodeDeactivationInfo = require('./nodeDeactivationInfo'); +exports.NodeEvent = require('./nodeEvent'); exports.NodeHealth = require('./nodeHealth'); exports.NodeHealthEvaluation = require('./nodeHealthEvaluation'); exports.NodeInfo = require('./nodeInfo'); @@ -121,6 +131,7 @@ exports.NodeLoadMetricInformation = require('./nodeLoadMetricInformation'); exports.NodeLoadInfo = require('./nodeLoadInfo'); exports.NodesHealthEvaluation = require('./nodesHealthEvaluation'); exports.PagedApplicationInfoList = require('./pagedApplicationInfoList'); +exports.PagedDeployedApplicationInfoList = require('./pagedDeployedApplicationInfoList'); exports.PagedNodeInfoList = require('./pagedNodeInfoList'); exports.ServicePartitionInfo = require('./servicePartitionInfo'); exports.PagedServicePartitionInfoList = require('./pagedServicePartitionInfoList'); @@ -128,11 +139,16 @@ exports.ReplicaInfo = require('./replicaInfo'); exports.PagedReplicaInfoList = require('./pagedReplicaInfoList'); exports.ServiceInfo = require('./serviceInfo'); exports.PagedServiceInfoList = require('./pagedServiceInfoList'); +exports.PartitionEvent = require('./partitionEvent'); +exports.PartitionAnalysisEvent = require('./partitionAnalysisEvent'); exports.ReplicaHealthState = require('./replicaHealthState'); exports.PartitionHealth = require('./partitionHealth'); exports.PartitionHealthEvaluation = require('./partitionHealthEvaluation'); exports.PartitionHealthState = require('./partitionHealthState'); exports.ProvisionFabricDescription = require('./provisionFabricDescription'); +exports.ProvisionApplicationTypeDescriptionBase = require('./provisionApplicationTypeDescriptionBase'); +exports.ProvisionApplicationTypeDescription = require('./provisionApplicationTypeDescription'); +exports.ExternalStoreProvisionApplicationTypeDescription = require('./externalStoreProvisionApplicationTypeDescription'); exports.UnprovisionFabricDescription = require('./unprovisionFabricDescription'); exports.ResumeClusterUpgradeDescription = require('./resumeClusterUpgradeDescription'); exports.ClusterUpgradeHealthPolicyObject = require('./clusterUpgradeHealthPolicyObject'); @@ -144,10 +160,12 @@ exports.EnsureAvailabilitySafetyCheck = require('./ensureAvailabilitySafetyCheck exports.EnsurePartitionQurumSafetyCheck = require('./ensurePartitionQurumSafetyCheck'); exports.SeedNodeSafetyCheck = require('./seedNodeSafetyCheck'); exports.PartitionsHealthEvaluation = require('./partitionsHealthEvaluation'); +exports.ReplicaEvent = require('./replicaEvent'); exports.ReplicaHealth = require('./replicaHealth'); exports.ReplicaHealthEvaluation = require('./replicaHealthEvaluation'); exports.ReplicasHealthEvaluation = require('./replicasHealthEvaluation'); exports.RestartNodeDescription = require('./restartNodeDescription'); +exports.ServiceEvent = require('./serviceEvent'); exports.ServiceFromTemplateDescription = require('./serviceFromTemplateDescription'); exports.ServiceHealthEvaluation = require('./serviceHealthEvaluation'); exports.ServiceHealth = require('./serviceHealth'); @@ -159,6 +177,7 @@ exports.ServicePlacementPreferPrimaryDomainPolicyDescription = require('./servic exports.ServicePlacementRequiredDomainPolicyDescription = require('./servicePlacementRequiredDomainPolicyDescription'); exports.ServicePlacementRequireDomainDistributionPolicyDescription = require('./servicePlacementRequireDomainDistributionPolicyDescription'); exports.ServicesHealthEvaluation = require('./servicesHealthEvaluation'); +exports.ServiceLoadMetricDescription = require('./serviceLoadMetricDescription'); exports.ServiceTypeExtensionDescription = require('./serviceTypeExtensionDescription'); exports.ServiceTypeDescription = require('./serviceTypeDescription'); exports.ServiceTypeInfo = require('./serviceTypeInfo'); @@ -189,17 +208,27 @@ exports.ClusterUpgradeDescriptionObject = require('./clusterUpgradeDescriptionOb exports.FailedUpgradeDomainProgressObject = require('./failedUpgradeDomainProgressObject'); exports.ClusterUpgradeProgressObject = require('./clusterUpgradeProgressObject'); exports.ClusterConfigurationUpgradeDescription = require('./clusterConfigurationUpgradeDescription'); +exports.UpgradeOrchestrationServiceState = require('./upgradeOrchestrationServiceState'); +exports.UpgradeOrchestrationServiceStateSummary = require('./upgradeOrchestrationServiceStateSummary'); exports.ApplicationTypeImageStorePath = require('./applicationTypeImageStorePath'); -exports.ApplicationTypeImageStoreVersion = require('./applicationTypeImageStoreVersion'); +exports.UnprovisionApplicationTypeDescriptionInfo = require('./unprovisionApplicationTypeDescriptionInfo'); exports.CodePackageEntryPointStatistics = require('./codePackageEntryPointStatistics'); exports.CodePackageEntryPoint = require('./codePackageEntryPoint'); exports.DeployedCodePackageInfo = require('./deployedCodePackageInfo'); -exports.ChaosContextMapItem = require('./chaosContextMapItem'); exports.ChaosContext = require('./chaosContext'); +exports.ChaosTargetFilter = require('./chaosTargetFilter'); exports.ChaosParameters = require('./chaosParameters'); +exports.Chaos = require('./chaos'); +exports.ChaosParametersDictionaryItem = require('./chaosParametersDictionaryItem'); exports.ChaosEvent = require('./chaosEvent'); exports.ChaosEventWrapper = require('./chaosEventWrapper'); -exports.ChaosReport = require('./chaosReport'); +exports.ChaosEventsSegment = require('./chaosEventsSegment'); +exports.ChaosScheduleJobActiveDaysOfWeek = require('./chaosScheduleJobActiveDaysOfWeek'); +exports.TimeOfDay = require('./timeOfDay'); +exports.TimeRange = require('./timeRange'); +exports.ChaosScheduleJob = require('./chaosScheduleJob'); +exports.ChaosSchedule = require('./chaosSchedule'); +exports.ChaosScheduleDescription = require('./chaosScheduleDescription'); exports.ExecutingFaultsChaosEvent = require('./executingFaultsChaosEvent'); exports.StartedChaosEvent = require('./startedChaosEvent'); exports.StoppedChaosEvent = require('./stoppedChaosEvent'); @@ -216,11 +245,13 @@ exports.PagedComposeDeploymentStatusInfoList = require('./pagedComposeDeployment exports.CreateComposeDeploymentDescription = require('./createComposeDeploymentDescription'); exports.DeployedServicePackageInfo = require('./deployedServicePackageInfo'); exports.ServiceCorrelationDescription = require('./serviceCorrelationDescription'); -exports.ServiceLoadMetricDescription = require('./serviceLoadMetricDescription'); exports.PartitionSchemeDescription = require('./partitionSchemeDescription'); exports.NamedPartitionSchemeDescription = require('./namedPartitionSchemeDescription'); exports.SingletonPartitionSchemeDescription = require('./singletonPartitionSchemeDescription'); exports.UniformInt64RangePartitionSchemeDescription = require('./uniformInt64RangePartitionSchemeDescription'); +exports.ScalingTriggerDescription = require('./scalingTriggerDescription'); +exports.ScalingMechanismDescription = require('./scalingMechanismDescription'); +exports.ScalingPolicyDescription = require('./scalingPolicyDescription'); exports.ServiceDescription = require('./serviceDescription'); exports.StatefulServiceDescription = require('./statefulServiceDescription'); exports.StatelessServiceDescription = require('./statelessServiceDescription'); @@ -266,6 +297,56 @@ exports.PackageSharingPolicyInfo = require('./packageSharingPolicyInfo'); exports.DeployServicePackageToNodeDescription = require('./deployServicePackageToNodeDescription'); exports.ResumeApplicationUpgradeDescription = require('./resumeApplicationUpgradeDescription'); exports.ApplicationUpgradeUpdateDescription = require('./applicationUpgradeUpdateDescription'); +exports.NameDescription = require('./nameDescription'); +exports.PagedSubNameInfoList = require('./pagedSubNameInfoList'); +exports.PropertyValue = require('./propertyValue'); +exports.BinaryPropertyValue = require('./binaryPropertyValue'); +exports.Int64PropertyValue = require('./int64PropertyValue'); +exports.DoublePropertyValue = require('./doublePropertyValue'); +exports.StringPropertyValue = require('./stringPropertyValue'); +exports.GuidPropertyValue = require('./guidPropertyValue'); +exports.PropertyMetadata = require('./propertyMetadata'); +exports.PropertyInfo = require('./propertyInfo'); +exports.PagedPropertyInfoList = require('./pagedPropertyInfoList'); +exports.PropertyDescription = require('./propertyDescription'); +exports.PropertyBatchOperation = require('./propertyBatchOperation'); +exports.PropertyBatchDescriptionList = require('./propertyBatchDescriptionList'); +exports.CheckExistsPropertyBatchOperation = require('./checkExistsPropertyBatchOperation'); +exports.CheckSequencePropertyBatchOperation = require('./checkSequencePropertyBatchOperation'); +exports.CheckValuePropertyBatchOperation = require('./checkValuePropertyBatchOperation'); +exports.DeletePropertyBatchOperation = require('./deletePropertyBatchOperation'); +exports.GetPropertyBatchOperation = require('./getPropertyBatchOperation'); +exports.PutPropertyBatchOperation = require('./putPropertyBatchOperation'); +exports.PropertyBatchInfo = require('./propertyBatchInfo'); +exports.SuccessfulPropertyBatchInfo = require('./successfulPropertyBatchInfo'); +exports.FailedPropertyBatchInfo = require('./failedPropertyBatchInfo'); +exports.BackupScheduleDescription = require('./backupScheduleDescription'); +exports.BackupStorageDescription = require('./backupStorageDescription'); +exports.BackupPolicyDescription = require('./backupPolicyDescription'); +exports.PagedBackupPolicyDescriptionList = require('./pagedBackupPolicyDescriptionList'); +exports.BackupConfigurationInfo = require('./backupConfigurationInfo'); +exports.ApplicationBackupConfigurationInfo = require('./applicationBackupConfigurationInfo'); +exports.ServiceBackupConfigurationInfo = require('./serviceBackupConfigurationInfo'); +exports.BackupSuspensionInfo = require('./backupSuspensionInfo'); +exports.PagedBackupConfigurationInfoList = require('./pagedBackupConfigurationInfoList'); +exports.RestorePartitionDescription = require('./restorePartitionDescription'); +exports.RestoreProgressInfo = require('./restoreProgressInfo'); +exports.BackupPartitionDescription = require('./backupPartitionDescription'); +exports.BackupInfo = require('./backupInfo'); +exports.PagedBackupInfoList = require('./pagedBackupInfoList'); +exports.AzureBlobBackupStorageDescription = require('./azureBlobBackupStorageDescription'); +exports.FileShareBackupStorageDescription = require('./fileShareBackupStorageDescription'); +exports.FrequencyBasedBackupScheduleDescription = require('./frequencyBasedBackupScheduleDescription'); +exports.TimeBasedBackupScheduleDescription = require('./timeBasedBackupScheduleDescription'); +exports.BackupProgressInfo = require('./backupProgressInfo'); +exports.PartitionBackupConfigurationInfo = require('./partitionBackupConfigurationInfo'); +exports.BackupEntity = require('./backupEntity'); +exports.ApplicationBackupEntity = require('./applicationBackupEntity'); +exports.ServiceBackupEntity = require('./serviceBackupEntity'); +exports.PartitionBackupEntity = require('./partitionBackupEntity'); +exports.EnableBackupDescription = require('./enableBackupDescription'); +exports.PagedBackupEntityList = require('./pagedBackupEntityList'); +exports.GetBackupByStorageQueryDescription = require('./getBackupByStorageQueryDescription'); exports.NodeImpact = require('./nodeImpact'); exports.RepairImpactDescriptionBase = require('./repairImpactDescriptionBase'); exports.NodeRepairImpactDescription = require('./nodeRepairImpactDescription'); @@ -278,12 +359,108 @@ exports.RepairTaskCancelDescription = require('./repairTaskCancelDescription'); exports.RepairTaskDeleteDescription = require('./repairTaskDeleteDescription'); exports.RepairTaskUpdateHealthPolicyDescription = require('./repairTaskUpdateHealthPolicyDescription'); exports.RepairTaskUpdateInfo = require('./repairTaskUpdateInfo'); +exports.UploadChunkRange = require('./uploadChunkRange'); +exports.UploadSessionInfo = require('./uploadSessionInfo'); +exports.UploadSession = require('./uploadSession'); +exports.ContainerLogs = require('./containerLogs'); +exports.AveragePartitionLoadScalingTrigger = require('./averagePartitionLoadScalingTrigger'); +exports.AverageServiceLoadScalingTrigger = require('./averageServiceLoadScalingTrigger'); +exports.PartitionInstanceCountScaleMechanism = require('./partitionInstanceCountScaleMechanism'); +exports.AddRemoveIncrementalNamedPartitionScalingMechanism = require('./addRemoveIncrementalNamedPartitionScalingMechanism'); +exports.ApplicationCreatedEvent = require('./applicationCreatedEvent'); +exports.ApplicationDeletedEvent = require('./applicationDeletedEvent'); +exports.ApplicationHealthReportCreatedEvent = require('./applicationHealthReportCreatedEvent'); +exports.ApplicationHealthReportExpiredEvent = require('./applicationHealthReportExpiredEvent'); +exports.ApplicationUpgradeCompleteEvent = require('./applicationUpgradeCompleteEvent'); +exports.ApplicationUpgradeDomainCompleteEvent = require('./applicationUpgradeDomainCompleteEvent'); +exports.ApplicationUpgradeRollbackCompleteEvent = require('./applicationUpgradeRollbackCompleteEvent'); +exports.ApplicationUpgradeRollbackStartEvent = require('./applicationUpgradeRollbackStartEvent'); +exports.ApplicationUpgradeStartEvent = require('./applicationUpgradeStartEvent'); +exports.DeployedApplicationHealthReportCreatedEvent = require('./deployedApplicationHealthReportCreatedEvent'); +exports.DeployedApplicationHealthReportExpiredEvent = require('./deployedApplicationHealthReportExpiredEvent'); +exports.ProcessDeactivatedEvent = require('./processDeactivatedEvent'); +exports.ContainerDeactivatedEvent = require('./containerDeactivatedEvent'); +exports.NodeAbortedEvent = require('./nodeAbortedEvent'); +exports.NodeAbortingEvent = require('./nodeAbortingEvent'); +exports.NodeAddedEvent = require('./nodeAddedEvent'); +exports.NodeCloseEvent = require('./nodeCloseEvent'); +exports.NodeClosingEvent = require('./nodeClosingEvent'); +exports.NodeDeactivateCompleteEvent = require('./nodeDeactivateCompleteEvent'); +exports.NodeDeactivateStartEvent = require('./nodeDeactivateStartEvent'); +exports.NodeDownEvent = require('./nodeDownEvent'); +exports.NodeHealthReportCreatedEvent = require('./nodeHealthReportCreatedEvent'); +exports.NodeHealthReportExpiredEvent = require('./nodeHealthReportExpiredEvent'); +exports.NodeOpenedSuccessEvent = require('./nodeOpenedSuccessEvent'); +exports.NodeOpenFailedEvent = require('./nodeOpenFailedEvent'); +exports.NodeOpeningEvent = require('./nodeOpeningEvent'); +exports.NodeRemovedEvent = require('./nodeRemovedEvent'); +exports.NodeUpEvent = require('./nodeUpEvent'); +exports.PartitionHealthReportCreatedEvent = require('./partitionHealthReportCreatedEvent'); +exports.PartitionHealthReportExpiredEvent = require('./partitionHealthReportExpiredEvent'); +exports.PartitionReconfigurationCompletedEvent = require('./partitionReconfigurationCompletedEvent'); +exports.PartitionPrimaryMoveAnalysisEvent = require('./partitionPrimaryMoveAnalysisEvent'); +exports.ServiceCreatedEvent = require('./serviceCreatedEvent'); +exports.ServiceDeletedEvent = require('./serviceDeletedEvent'); +exports.ServiceHealthReportCreatedEvent = require('./serviceHealthReportCreatedEvent'); +exports.ServiceHealthReportExpiredEvent = require('./serviceHealthReportExpiredEvent'); +exports.DeployedServiceHealthReportCreatedEvent = require('./deployedServiceHealthReportCreatedEvent'); +exports.DeployedServiceHealthReportExpiredEvent = require('./deployedServiceHealthReportExpiredEvent'); +exports.StatefulReplicaHealthReportCreatedEvent = require('./statefulReplicaHealthReportCreatedEvent'); +exports.StatefulReplicaHealthReportExpiredEvent = require('./statefulReplicaHealthReportExpiredEvent'); +exports.StatelessReplicaHealthReportCreatedEvent = require('./statelessReplicaHealthReportCreatedEvent'); +exports.StatelessReplicaHealthReportExpiredEvent = require('./statelessReplicaHealthReportExpiredEvent'); +exports.ClusterHealthReportCreatedEvent = require('./clusterHealthReportCreatedEvent'); +exports.ClusterHealthReportExpiredEvent = require('./clusterHealthReportExpiredEvent'); +exports.ClusterUpgradeCompleteEvent = require('./clusterUpgradeCompleteEvent'); +exports.ClusterUpgradeDomainCompleteEvent = require('./clusterUpgradeDomainCompleteEvent'); +exports.ClusterUpgradeRollbackCompleteEvent = require('./clusterUpgradeRollbackCompleteEvent'); +exports.ClusterUpgradeRollbackStartEvent = require('./clusterUpgradeRollbackStartEvent'); +exports.ClusterUpgradeStartEvent = require('./clusterUpgradeStartEvent'); +exports.ChaosStoppedEvent = require('./chaosStoppedEvent'); +exports.ChaosStartedEvent = require('./chaosStartedEvent'); +exports.ChaosRestartNodeFaultCompletedEvent = require('./chaosRestartNodeFaultCompletedEvent'); +exports.ChaosRestartCodePackageFaultScheduledEvent = require('./chaosRestartCodePackageFaultScheduledEvent'); +exports.ChaosRestartCodePackageFaultCompletedEvent = require('./chaosRestartCodePackageFaultCompletedEvent'); +exports.ChaosRemoveReplicaFaultScheduledEvent = require('./chaosRemoveReplicaFaultScheduledEvent'); +exports.ChaosRemoveReplicaFaultCompletedEvent = require('./chaosRemoveReplicaFaultCompletedEvent'); +exports.ChaosMoveSecondaryFaultScheduledEvent = require('./chaosMoveSecondaryFaultScheduledEvent'); +exports.ChaosMovePrimaryFaultScheduledEvent = require('./chaosMovePrimaryFaultScheduledEvent'); +exports.ChaosRestartReplicaFaultScheduledEvent = require('./chaosRestartReplicaFaultScheduledEvent'); +exports.ChaosRestartNodeFaultScheduledEvent = require('./chaosRestartNodeFaultScheduledEvent'); +exports.ServiceResourceDescription = require('./serviceResourceDescription'); +exports.DiagnosticsSinkProperties = require('./diagnosticsSinkProperties'); +exports.DiagnosticsDescription = require('./diagnosticsDescription'); +exports.ApplicationResourceDescription = require('./applicationResourceDescription'); +exports.PagedServiceResourceDescriptionList = require('./pagedServiceResourceDescriptionList'); +exports.ServiceReplicaProperties = require('./serviceReplicaProperties'); +exports.ServiceResourceReplicaDescription = require('./serviceResourceReplicaDescription'); +exports.PagedServiceResourceReplicaDescriptionList = require('./pagedServiceResourceReplicaDescriptionList'); +exports.VolumeProviderParametersAzureFile = require('./volumeProviderParametersAzureFile'); +exports.VolumeResourceDescription = require('./volumeResourceDescription'); +exports.ImageRegistryCredential = require('./imageRegistryCredential'); +exports.EnvironmentVariable = require('./environmentVariable'); +exports.Setting = require('./setting'); +exports.ContainerLabel = require('./containerLabel'); +exports.EndpointProperties = require('./endpointProperties'); +exports.ResourceRequests = require('./resourceRequests'); +exports.ResourceLimits = require('./resourceLimits'); +exports.ResourceRequirements = require('./resourceRequirements'); +exports.ContainerVolume = require('./containerVolume'); +exports.ContainerState = require('./containerState'); +exports.ContainerEvent = require('./containerEvent'); +exports.ContainerInstanceView = require('./containerInstanceView'); +exports.DiagnosticsRef = require('./diagnosticsRef'); +exports.ContainerCodePackageProperties = require('./containerCodePackageProperties'); +exports.NetworkRef = require('./networkRef'); exports.discriminators = { + 'FabricEvent.ApplicationEvent' : exports.ApplicationEvent, 'HealthEvaluation' : exports.HealthEvaluation, 'HealthEvaluation.Application' : exports.ApplicationHealthEvaluation, 'HealthEvaluation.Applications' : exports.ApplicationsHealthEvaluation, 'HealthEvaluation.ApplicationTypeApplications' : exports.ApplicationTypeApplicationsHealthEvaluation, 'SafetyCheck' : exports.SafetyCheck, + 'FabricEvent.ClusterEvent' : exports.ClusterEvent, + 'FabricEvent.ContainerInstanceEvent' : exports.ContainerInstanceEvent, 'HealthEvaluation.DeltaNodesCheck' : exports.DeltaNodesCheckHealthEvaluation, 'HealthEvaluation.DeployedApplication' : exports.DeployedApplicationHealthEvaluation, 'HealthEvaluation.DeployedApplications' : exports.DeployedApplicationsHealthEvaluation, @@ -293,31 +470,40 @@ exports.discriminators = { 'DeployedServiceReplicaInfo.Stateful' : exports.DeployedStatefulServiceReplicaInfo, 'DeployedServiceReplicaInfo.Stateless' : exports.DeployedStatelessServiceInstanceInfo, 'HealthEvaluation.Event' : exports.EventHealthEvaluation, + 'FabricEvent' : exports.FabricEvent, 'PartitionInformation.Int64Range' : exports.Int64RangePartitionInformation, 'PartitionInformation.Named' : exports.NamedPartitionInformation, + 'FabricEvent.NodeEvent' : exports.NodeEvent, 'HealthEvaluation.Node' : exports.NodeHealthEvaluation, 'HealthEvaluation.Nodes' : exports.NodesHealthEvaluation, 'PartitionInformation' : exports.PartitionInformation, 'ServicePartitionInfo' : exports.ServicePartitionInfo, 'ReplicaInfo' : exports.ReplicaInfo, 'ServiceInfo' : exports.ServiceInfo, + 'FabricEvent.PartitionAnalysisEvent' : exports.PartitionAnalysisEvent, + 'FabricEvent.PartitionEvent' : exports.PartitionEvent, 'EntityHealthState.ReplicaHealthState' : exports.ReplicaHealthState, 'HealthEvaluation.Partition' : exports.PartitionHealthEvaluation, + 'ProvisionApplicationTypeDescriptionBase' : exports.ProvisionApplicationTypeDescriptionBase, + 'ProvisionApplicationTypeDescriptionBase.ImageStorePath' : exports.ProvisionApplicationTypeDescription, + 'ProvisionApplicationTypeDescriptionBase.ExternalStore' : exports.ExternalStoreProvisionApplicationTypeDescription, 'SafetyCheck.PartitionSafetyCheck' : exports.PartitionSafetyCheck, 'SafetyCheck.EnsureAvailability' : exports.EnsureAvailabilitySafetyCheck, 'SafetyCheck.EnsurePartitionQuorum' : exports.EnsurePartitionQurumSafetyCheck, 'SafetyCheck.EnsureSeedNodeQuorum' : exports.SeedNodeSafetyCheck, 'HealthEvaluation.Partitions' : exports.PartitionsHealthEvaluation, + 'FabricEvent.ReplicaEvent' : exports.ReplicaEvent, 'EntityHealth.ReplicaHealth' : exports.ReplicaHealth, 'HealthEvaluation.Replica' : exports.ReplicaHealthEvaluation, 'HealthEvaluation.Replicas' : exports.ReplicasHealthEvaluation, + 'FabricEvent.ServiceEvent' : exports.ServiceEvent, 'HealthEvaluation.Service' : exports.ServiceHealthEvaluation, 'ServicePlacementPolicyDescription.InvalidDomain' : exports.ServicePlacementInvalidDomainPolicyDescription, 'ServicePlacementPolicyDescription.NonPartiallyPlaceService' : exports.ServicePlacementNonPartiallyPlaceServicePolicyDescription, 'ServicePlacementPolicyDescription' : exports.ServicePlacementPolicyDescription, - 'ServicePlacementPolicyDescription.PreferPrimaryDomain' : exports.ServicePlacementPreferPrimaryDomainPolicyDescription, - 'ServicePlacementPolicyDescription.RequireDomain' : exports.ServicePlacementRequiredDomainPolicyDescription, - 'ServicePlacementPolicyDescription.RequireDomainDistribution' : exports.ServicePlacementRequireDomainDistributionPolicyDescription, + 'ServicePlacementPolicyDescription.PreferredPrimaryDomain' : exports.ServicePlacementPreferPrimaryDomainPolicyDescription, + 'ServicePlacementPolicyDescription.RequiredDomain' : exports.ServicePlacementRequiredDomainPolicyDescription, + 'ServicePlacementPolicyDescription.RequiredDomainDistribution' : exports.ServicePlacementRequireDomainDistributionPolicyDescription, 'HealthEvaluation.Services' : exports.ServicesHealthEvaluation, 'ServiceTypeDescription' : exports.ServiceTypeDescription, 'PartitionInformation.Singleton' : exports.SingletonPartitionInformation, @@ -351,6 +537,8 @@ exports.discriminators = { 'PartitionSchemeDescription.Named' : exports.NamedPartitionSchemeDescription, 'PartitionSchemeDescription.Singleton' : exports.SingletonPartitionSchemeDescription, 'PartitionSchemeDescription.UniformInt64Range' : exports.UniformInt64RangePartitionSchemeDescription, + 'ScalingTriggerDescription' : exports.ScalingTriggerDescription, + 'ScalingMechanismDescription' : exports.ScalingMechanismDescription, 'ServiceDescription' : exports.ServiceDescription, 'ServiceDescription.Stateful' : exports.StatefulServiceDescription, 'ServiceDescription.Stateless' : exports.StatelessServiceDescription, @@ -367,8 +555,103 @@ exports.discriminators = { 'ServiceUpdateDescription' : exports.ServiceUpdateDescription, 'ServiceUpdateDescription.Stateful' : exports.StatefulServiceUpdateDescription, 'ServiceUpdateDescription.Stateless' : exports.StatelessServiceUpdateDescription, + 'PropertyValue' : exports.PropertyValue, + 'PropertyValue.Binary' : exports.BinaryPropertyValue, + 'PropertyValue.Int64' : exports.Int64PropertyValue, + 'PropertyValue.Double' : exports.DoublePropertyValue, + 'PropertyValue.String' : exports.StringPropertyValue, + 'PropertyValue.Guid' : exports.GuidPropertyValue, + 'PropertyBatchOperation' : exports.PropertyBatchOperation, + 'PropertyBatchOperation.CheckExists' : exports.CheckExistsPropertyBatchOperation, + 'PropertyBatchOperation.CheckSequence' : exports.CheckSequencePropertyBatchOperation, + 'PropertyBatchOperation.CheckValue' : exports.CheckValuePropertyBatchOperation, + 'PropertyBatchOperation.Delete' : exports.DeletePropertyBatchOperation, + 'PropertyBatchOperation.Get' : exports.GetPropertyBatchOperation, + 'PropertyBatchOperation.Put' : exports.PutPropertyBatchOperation, + 'PropertyBatchInfo' : exports.PropertyBatchInfo, + 'PropertyBatchInfo.Successful' : exports.SuccessfulPropertyBatchInfo, + 'PropertyBatchInfo.Failed' : exports.FailedPropertyBatchInfo, + 'BackupScheduleDescription' : exports.BackupScheduleDescription, + 'BackupStorageDescription' : exports.BackupStorageDescription, + 'BackupConfigurationInfo.Application' : exports.ApplicationBackupConfigurationInfo, + 'BackupConfigurationInfo.Service' : exports.ServiceBackupConfigurationInfo, + 'BackupConfigurationInfo' : exports.BackupConfigurationInfo, + 'BackupStorageDescription.AzureBlobStore' : exports.AzureBlobBackupStorageDescription, + 'BackupStorageDescription.FileShare' : exports.FileShareBackupStorageDescription, + 'BackupScheduleDescription.FrequencyBased' : exports.FrequencyBasedBackupScheduleDescription, + 'BackupScheduleDescription.TimeBased' : exports.TimeBasedBackupScheduleDescription, + 'BackupConfigurationInfo.Partition' : exports.PartitionBackupConfigurationInfo, + 'BackupEntity' : exports.BackupEntity, + 'BackupEntity.Application' : exports.ApplicationBackupEntity, + 'BackupEntity.Service' : exports.ServiceBackupEntity, + 'BackupEntity.Partition' : exports.PartitionBackupEntity, 'RepairImpactDescriptionBase.Node' : exports.NodeRepairImpactDescription, 'RepairTargetDescriptionBase.Node' : exports.NodeRepairTargetDescription, 'RepairImpactDescriptionBase' : exports.RepairImpactDescriptionBase, - 'RepairTargetDescriptionBase' : exports.RepairTargetDescriptionBase + 'RepairTargetDescriptionBase' : exports.RepairTargetDescriptionBase, + 'ScalingTriggerDescription.AveragePartitionLoad' : exports.AveragePartitionLoadScalingTrigger, + 'ScalingTriggerDescription.AverageServiceLoad' : exports.AverageServiceLoadScalingTrigger, + 'ScalingMechanismDescription.PartitionInstanceCount' : exports.PartitionInstanceCountScaleMechanism, + 'ScalingMechanismDescription.AddRemoveIncrementalNamedPartition' : exports.AddRemoveIncrementalNamedPartitionScalingMechanism, + 'FabricEvent.ApplicationCreated' : exports.ApplicationCreatedEvent, + 'FabricEvent.ApplicationDeleted' : exports.ApplicationDeletedEvent, + 'FabricEvent.ApplicationHealthReportCreated' : exports.ApplicationHealthReportCreatedEvent, + 'FabricEvent.ApplicationHealthReportExpired' : exports.ApplicationHealthReportExpiredEvent, + 'FabricEvent.ApplicationUpgradeComplete' : exports.ApplicationUpgradeCompleteEvent, + 'FabricEvent.ApplicationUpgradeDomainComplete' : exports.ApplicationUpgradeDomainCompleteEvent, + 'FabricEvent.ApplicationUpgradeRollbackComplete' : exports.ApplicationUpgradeRollbackCompleteEvent, + 'FabricEvent.ApplicationUpgradeRollbackStart' : exports.ApplicationUpgradeRollbackStartEvent, + 'FabricEvent.ApplicationUpgradeStart' : exports.ApplicationUpgradeStartEvent, + 'FabricEvent.DeployedApplicationHealthReportCreated' : exports.DeployedApplicationHealthReportCreatedEvent, + 'FabricEvent.DeployedApplicationHealthReportExpired' : exports.DeployedApplicationHealthReportExpiredEvent, + 'FabricEvent.ProcessDeactivated' : exports.ProcessDeactivatedEvent, + 'FabricEvent.ContainerDeactivated' : exports.ContainerDeactivatedEvent, + 'FabricEvent.NodeAborted' : exports.NodeAbortedEvent, + 'FabricEvent.NodeAborting' : exports.NodeAbortingEvent, + 'FabricEvent.NodeAdded' : exports.NodeAddedEvent, + 'FabricEvent.NodeClose' : exports.NodeCloseEvent, + 'FabricEvent.NodeClosing' : exports.NodeClosingEvent, + 'FabricEvent.NodeDeactivateComplete' : exports.NodeDeactivateCompleteEvent, + 'FabricEvent.NodeDeactivateStart' : exports.NodeDeactivateStartEvent, + 'FabricEvent.NodeDown' : exports.NodeDownEvent, + 'FabricEvent.NodeHealthReportCreated' : exports.NodeHealthReportCreatedEvent, + 'FabricEvent.NodeHealthReportExpired' : exports.NodeHealthReportExpiredEvent, + 'FabricEvent.NodeOpenedSuccess' : exports.NodeOpenedSuccessEvent, + 'FabricEvent.NodeOpenFailed' : exports.NodeOpenFailedEvent, + 'FabricEvent.NodeOpening' : exports.NodeOpeningEvent, + 'FabricEvent.NodeRemoved' : exports.NodeRemovedEvent, + 'FabricEvent.NodeUp' : exports.NodeUpEvent, + 'FabricEvent.PartitionHealthReportCreated' : exports.PartitionHealthReportCreatedEvent, + 'FabricEvent.PartitionHealthReportExpired' : exports.PartitionHealthReportExpiredEvent, + 'FabricEvent.PartitionReconfigurationCompleted' : exports.PartitionReconfigurationCompletedEvent, + 'FabricEvent.PartitionPrimaryMoveAnalysis' : exports.PartitionPrimaryMoveAnalysisEvent, + 'FabricEvent.ServiceCreated' : exports.ServiceCreatedEvent, + 'FabricEvent.ServiceDeleted' : exports.ServiceDeletedEvent, + 'FabricEvent.ServiceHealthReportCreated' : exports.ServiceHealthReportCreatedEvent, + 'FabricEvent.ServiceHealthReportExpired' : exports.ServiceHealthReportExpiredEvent, + 'FabricEvent.DeployedServiceHealthReportCreated' : exports.DeployedServiceHealthReportCreatedEvent, + 'FabricEvent.DeployedServiceHealthReportExpired' : exports.DeployedServiceHealthReportExpiredEvent, + 'FabricEvent.StatefulReplicaHealthReportCreated' : exports.StatefulReplicaHealthReportCreatedEvent, + 'FabricEvent.StatefulReplicaHealthReportExpired' : exports.StatefulReplicaHealthReportExpiredEvent, + 'FabricEvent.StatelessReplicaHealthReportCreated' : exports.StatelessReplicaHealthReportCreatedEvent, + 'FabricEvent.StatelessReplicaHealthReportExpired' : exports.StatelessReplicaHealthReportExpiredEvent, + 'FabricEvent.ClusterHealthReportCreated' : exports.ClusterHealthReportCreatedEvent, + 'FabricEvent.ClusterHealthReportExpired' : exports.ClusterHealthReportExpiredEvent, + 'FabricEvent.ClusterUpgradeComplete' : exports.ClusterUpgradeCompleteEvent, + 'FabricEvent.ClusterUpgradeDomainComplete' : exports.ClusterUpgradeDomainCompleteEvent, + 'FabricEvent.ClusterUpgradeRollbackComplete' : exports.ClusterUpgradeRollbackCompleteEvent, + 'FabricEvent.ClusterUpgradeRollbackStart' : exports.ClusterUpgradeRollbackStartEvent, + 'FabricEvent.ClusterUpgradeStart' : exports.ClusterUpgradeStartEvent, + 'FabricEvent.ChaosStopped' : exports.ChaosStoppedEvent, + 'FabricEvent.ChaosStarted' : exports.ChaosStartedEvent, + 'FabricEvent.ChaosRestartNodeFaultCompleted' : exports.ChaosRestartNodeFaultCompletedEvent, + 'FabricEvent.ChaosRestartCodePackageFaultScheduled' : exports.ChaosRestartCodePackageFaultScheduledEvent, + 'FabricEvent.ChaosRestartCodePackageFaultCompleted' : exports.ChaosRestartCodePackageFaultCompletedEvent, + 'FabricEvent.ChaosRemoveReplicaFaultScheduled' : exports.ChaosRemoveReplicaFaultScheduledEvent, + 'FabricEvent.ChaosRemoveReplicaFaultCompleted' : exports.ChaosRemoveReplicaFaultCompletedEvent, + 'FabricEvent.ChaosMoveSecondaryFaultScheduled' : exports.ChaosMoveSecondaryFaultScheduledEvent, + 'FabricEvent.ChaosMovePrimaryFaultScheduled' : exports.ChaosMovePrimaryFaultScheduledEvent, + 'FabricEvent.ChaosRestartReplicaFaultScheduled' : exports.ChaosRestartReplicaFaultScheduledEvent, + 'FabricEvent.ChaosRestartNodeFaultScheduled' : exports.ChaosRestartNodeFaultScheduledEvent, + 'DiagnosticsSinkProperties' : exports.DiagnosticsSinkProperties }; diff --git a/lib/services/serviceFabric/lib/models/int64PropertyValue.js b/lib/services/serviceFabric/lib/models/int64PropertyValue.js new file mode 100644 index 0000000000..fde38a97a7 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/int64PropertyValue.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Service Fabric property value of type Int64. + * + * @extends models['PropertyValue'] + */ +class Int64PropertyValue extends models['PropertyValue'] { + /** + * Create a Int64PropertyValue. + * @member {string} data The data of the property value. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Int64PropertyValue + * + * @returns {object} metadata of Int64PropertyValue + * + */ + mapper() { + return { + required: false, + serializedName: 'Int64', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'Int64PropertyValue', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + data: { + required: true, + serializedName: 'Data', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Int64PropertyValue; diff --git a/lib/services/serviceFabric/lib/models/int64RangePartitionInformation.js b/lib/services/serviceFabric/lib/models/int64RangePartitionInformation.js index 5d8486028e..4041db0ed9 100644 --- a/lib/services/serviceFabric/lib/models/int64RangePartitionInformation.js +++ b/lib/services/serviceFabric/lib/models/int64RangePartitionInformation.js @@ -42,6 +42,11 @@ class Int64RangePartitionInformation extends models['PartitionInformation'] { serializedName: 'Int64Range', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServicePartitionKind', + clientName: 'servicePartitionKind' + }, + uberParent: 'PartitionInformation', className: 'Int64RangePartitionInformation', modelProperties: { id: { @@ -54,6 +59,7 @@ class Int64RangePartitionInformation extends models['PartitionInformation'] { servicePartitionKind: { required: true, serializedName: 'ServicePartitionKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/invokeDataLossResult.js b/lib/services/serviceFabric/lib/models/invokeDataLossResult.js index 70afa17050..14815cc695 100644 --- a/lib/services/serviceFabric/lib/models/invokeDataLossResult.js +++ b/lib/services/serviceFabric/lib/models/invokeDataLossResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents information about an operation in a terminal state (Completed or * Faulted). @@ -22,9 +20,15 @@ class InvokeDataLossResult { * Create a InvokeDataLossResult. * @member {number} [errorCode] If OperationState is Completed, this is 0. * If OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [selectedPartition] - * @member {string} [selectedPartition.serviceName] - * @member {uuid} [selectedPartition.partitionId] + * @member {object} [selectedPartition] This class returns information about + * the partition that the user-induced operation acted upon. + * @member {string} [selectedPartition.serviceName] The name of the service + * the partition belongs to. + * @member {uuid} [selectedPartition.partitionId] An internal ID used by + * Service Fabric to uniquely identify a partition. This is a randomly + * generated GUID when the service was created. The partition ID is unique + * and does not change for the lifetime of the service. If the same service + * was deleted and recreated the IDs of its partitions would be different. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/invokeQuorumLossResult.js b/lib/services/serviceFabric/lib/models/invokeQuorumLossResult.js index 2f9d12f63d..39288444a8 100644 --- a/lib/services/serviceFabric/lib/models/invokeQuorumLossResult.js +++ b/lib/services/serviceFabric/lib/models/invokeQuorumLossResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents information about an operation in a terminal state (Completed or * Faulted). @@ -22,9 +20,15 @@ class InvokeQuorumLossResult { * Create a InvokeQuorumLossResult. * @member {number} [errorCode] If OperationState is Completed, this is 0. * If OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [selectedPartition] - * @member {string} [selectedPartition.serviceName] - * @member {uuid} [selectedPartition.partitionId] + * @member {object} [selectedPartition] This class returns information about + * the partition that the user-induced operation acted upon. + * @member {string} [selectedPartition.serviceName] The name of the service + * the partition belongs to. + * @member {uuid} [selectedPartition.partitionId] An internal ID used by + * Service Fabric to uniquely identify a partition. This is a randomly + * generated GUID when the service was created. The partition ID is unique + * and does not change for the lifetime of the service. If the same service + * was deleted and recreated the IDs of its partitions would be different. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/keyValueStoreReplicaStatus.js b/lib/services/serviceFabric/lib/models/keyValueStoreReplicaStatus.js index fd026d5388..5146b52893 100644 --- a/lib/services/serviceFabric/lib/models/keyValueStoreReplicaStatus.js +++ b/lib/services/serviceFabric/lib/models/keyValueStoreReplicaStatus.js @@ -49,11 +49,17 @@ class KeyValueStoreReplicaStatus extends models['ReplicaStatusBase'] { serializedName: 'KeyValueStore', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ReplicaStatusBase', className: 'KeyValueStoreReplicaStatus', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/monitoringPolicyDescription.js b/lib/services/serviceFabric/lib/models/monitoringPolicyDescription.js index 06ccb16f64..259424999d 100644 --- a/lib/services/serviceFabric/lib/models/monitoringPolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/monitoringPolicyDescription.js @@ -17,13 +17,38 @@ class MonitoringPolicyDescription { /** * Create a MonitoringPolicyDescription. - * @member {string} [failureAction] Possible values include: 'Invalid', - * 'Rollback', 'Manual' - * @member {string} [healthCheckWaitDurationInMilliseconds] - * @member {string} [healthCheckStableDurationInMilliseconds] - * @member {string} [healthCheckRetryTimeoutInMilliseconds] - * @member {string} [upgradeTimeoutInMilliseconds] - * @member {string} [upgradeDomainTimeoutInMilliseconds] + * @member {string} [failureAction] The compensating action to perform when a + * Monitored upgrade encounters monitoring policy or health policy + * violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * @member {string} [healthCheckWaitDurationInMilliseconds] 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} [healthCheckStableDurationInMilliseconds] 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} [healthCheckRetryTimeoutInMilliseconds] 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} [upgradeTimeoutInMilliseconds] 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} [upgradeDomainTimeoutInMilliseconds] 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/serviceFabric/lib/models/nameDescription.js b/lib/services/serviceFabric/lib/models/nameDescription.js new file mode 100644 index 0000000000..17dccad407 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nameDescription.js @@ -0,0 +1,53 @@ +/* + * 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 a Service Fabric name. + * + */ +class NameDescription { + /** + * Create a NameDescription. + * @member {string} name The Service Fabric name, including the 'fabric:' URI + * scheme. + */ + constructor() { + } + + /** + * Defines the metadata of NameDescription + * + * @returns {object} metadata of NameDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'NameDescription', + type: { + name: 'Composite', + className: 'NameDescription', + modelProperties: { + name: { + required: true, + serializedName: 'Name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NameDescription; diff --git a/lib/services/serviceFabric/lib/models/namedPartitionInformation.js b/lib/services/serviceFabric/lib/models/namedPartitionInformation.js index a5a4973455..35033bc3d3 100644 --- a/lib/services/serviceFabric/lib/models/namedPartitionInformation.js +++ b/lib/services/serviceFabric/lib/models/namedPartitionInformation.js @@ -39,6 +39,11 @@ class NamedPartitionInformation extends models['PartitionInformation'] { serializedName: 'Named', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServicePartitionKind', + clientName: 'servicePartitionKind' + }, + uberParent: 'PartitionInformation', className: 'NamedPartitionInformation', modelProperties: { id: { @@ -51,6 +56,7 @@ class NamedPartitionInformation extends models['PartitionInformation'] { servicePartitionKind: { required: true, serializedName: 'ServicePartitionKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/namedPartitionSchemeDescription.js b/lib/services/serviceFabric/lib/models/namedPartitionSchemeDescription.js index 4ae3accf80..d6966a7a3a 100644 --- a/lib/services/serviceFabric/lib/models/namedPartitionSchemeDescription.js +++ b/lib/services/serviceFabric/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/serviceFabric/lib/models/networkRef.js b/lib/services/serviceFabric/lib/models/networkRef.js new file mode 100644 index 0000000000..3294cee7c4 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/networkRef.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a network reference in a service. + * + */ +class NetworkRef { + /** + * Create a NetworkRef. + * @member {string} [name] Name of the network. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkRef + * + * @returns {object} metadata of NetworkRef + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkRef', + type: { + name: 'Composite', + className: 'NetworkRef', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkRef; diff --git a/lib/services/serviceFabric/lib/models/nodeAbortedEvent.js b/lib/services/serviceFabric/lib/models/nodeAbortedEvent.js new file mode 100644 index 0000000000..e5a665f204 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeAbortedEvent.js @@ -0,0 +1,153 @@ +/* + * 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'); + +/** + * Node Aborted event. + * + * @extends models['NodeEvent'] + */ +class NodeAbortedEvent extends models['NodeEvent'] { + /** + * Create a NodeAbortedEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeAbortedEvent + * + * @returns {object} metadata of NodeAbortedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeAborted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeAbortedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + upgradeDomain: { + required: true, + serializedName: 'UpgradeDomain', + type: { + name: 'String' + } + }, + faultDomain: { + required: true, + serializedName: 'FaultDomain', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + hostname: { + required: true, + serializedName: 'Hostname', + type: { + name: 'String' + } + }, + isSeedNode: { + required: true, + serializedName: 'IsSeedNode', + type: { + name: 'Boolean' + } + }, + nodeVersion: { + required: true, + serializedName: 'NodeVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeAbortedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeAbortingEvent.js b/lib/services/serviceFabric/lib/models/nodeAbortingEvent.js new file mode 100644 index 0000000000..ceaa546c95 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeAbortingEvent.js @@ -0,0 +1,153 @@ +/* + * 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'); + +/** + * Node Aborting event. + * + * @extends models['NodeEvent'] + */ +class NodeAbortingEvent extends models['NodeEvent'] { + /** + * Create a NodeAbortingEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeAbortingEvent + * + * @returns {object} metadata of NodeAbortingEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeAborting', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeAbortingEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + upgradeDomain: { + required: true, + serializedName: 'UpgradeDomain', + type: { + name: 'String' + } + }, + faultDomain: { + required: true, + serializedName: 'FaultDomain', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + hostname: { + required: true, + serializedName: 'Hostname', + type: { + name: 'String' + } + }, + isSeedNode: { + required: true, + serializedName: 'IsSeedNode', + type: { + name: 'Boolean' + } + }, + nodeVersion: { + required: true, + serializedName: 'NodeVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeAbortingEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeAddedEvent.js b/lib/services/serviceFabric/lib/models/nodeAddedEvent.js new file mode 100644 index 0000000000..dbdf221891 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeAddedEvent.js @@ -0,0 +1,137 @@ +/* + * 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'); + +/** + * Node Added event. + * + * @extends models['NodeEvent'] + */ +class NodeAddedEvent extends models['NodeEvent'] { + /** + * Create a NodeAddedEvent. + * @member {string} nodeId Id of Node. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeType Type of Node. + * @member {string} fabricVersion Fabric version. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} nodeCapacities Capacities. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeAddedEvent + * + * @returns {object} metadata of NodeAddedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeAdded', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeAddedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeType: { + required: true, + serializedName: 'NodeType', + type: { + name: 'String' + } + }, + fabricVersion: { + required: true, + serializedName: 'FabricVersion', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + nodeCapacities: { + required: true, + serializedName: 'NodeCapacities', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeAddedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeCloseEvent.js b/lib/services/serviceFabric/lib/models/nodeCloseEvent.js new file mode 100644 index 0000000000..ccf940a9cb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeCloseEvent.js @@ -0,0 +1,113 @@ +/* + * 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'); + +/** + * Node Close event. + * + * @extends models['NodeEvent'] + */ +class NodeCloseEvent extends models['NodeEvent'] { + /** + * Create a NodeCloseEvent. + * @member {string} nodeId Id of Node. + * @member {string} nodeInstance Id of Node instance. + * @member {string} error Describes error. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeCloseEvent + * + * @returns {object} metadata of NodeCloseEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeClose', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeCloseEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'String' + } + }, + error: { + required: true, + serializedName: 'Error', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeCloseEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeClosingEvent.js b/lib/services/serviceFabric/lib/models/nodeClosingEvent.js new file mode 100644 index 0000000000..36cb8254ea --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeClosingEvent.js @@ -0,0 +1,153 @@ +/* + * 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'); + +/** + * Node Closing event. + * + * @extends models['NodeEvent'] + */ +class NodeClosingEvent extends models['NodeEvent'] { + /** + * Create a NodeClosingEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeClosingEvent + * + * @returns {object} metadata of NodeClosingEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeClosing', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeClosingEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + upgradeDomain: { + required: true, + serializedName: 'UpgradeDomain', + type: { + name: 'String' + } + }, + faultDomain: { + required: true, + serializedName: 'FaultDomain', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + hostname: { + required: true, + serializedName: 'Hostname', + type: { + name: 'String' + } + }, + isSeedNode: { + required: true, + serializedName: 'IsSeedNode', + type: { + name: 'Boolean' + } + }, + nodeVersion: { + required: true, + serializedName: 'NodeVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeClosingEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeDeactivateCompleteEvent.js b/lib/services/serviceFabric/lib/models/nodeDeactivateCompleteEvent.js new file mode 100644 index 0000000000..5d2584e37f --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeDeactivateCompleteEvent.js @@ -0,0 +1,121 @@ +/* + * 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'); + +/** + * Node Deactivate Complete event. + * + * @extends models['NodeEvent'] + */ +class NodeDeactivateCompleteEvent extends models['NodeEvent'] { + /** + * Create a NodeDeactivateCompleteEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} effectiveDeactivateIntent Describes deactivate intent. + * @member {string} batchIdsWithDeactivateIntent Batch Ids. + * @member {date} startTime Start time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeDeactivateCompleteEvent + * + * @returns {object} metadata of NodeDeactivateCompleteEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeDeactivateComplete', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeDeactivateCompleteEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + effectiveDeactivateIntent: { + required: true, + serializedName: 'EffectiveDeactivateIntent', + type: { + name: 'String' + } + }, + batchIdsWithDeactivateIntent: { + required: true, + serializedName: 'BatchIdsWithDeactivateIntent', + type: { + name: 'String' + } + }, + startTime: { + required: true, + serializedName: 'StartTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = NodeDeactivateCompleteEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeDeactivateStartEvent.js b/lib/services/serviceFabric/lib/models/nodeDeactivateStartEvent.js new file mode 100644 index 0000000000..1d2e9fa784 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeDeactivateStartEvent.js @@ -0,0 +1,113 @@ +/* + * 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'); + +/** + * Node Deactivate Start event. + * + * @extends models['NodeEvent'] + */ +class NodeDeactivateStartEvent extends models['NodeEvent'] { + /** + * Create a NodeDeactivateStartEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} batchId Batch Id. + * @member {string} deactivateIntent Describes deactivate intent. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeDeactivateStartEvent + * + * @returns {object} metadata of NodeDeactivateStartEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeDeactivateStart', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeDeactivateStartEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + batchId: { + required: true, + serializedName: 'BatchId', + type: { + name: 'String' + } + }, + deactivateIntent: { + required: true, + serializedName: 'DeactivateIntent', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeDeactivateStartEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeDeactivationInfo.js b/lib/services/serviceFabric/lib/models/nodeDeactivationInfo.js index e5425d7da6..2f3181b46f 100644 --- a/lib/services/serviceFabric/lib/models/nodeDeactivationInfo.js +++ b/lib/services/serviceFabric/lib/models/nodeDeactivationInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about the node deactivation. This information is valid for a * node that is undergoing deactivation or has already been deactivated. @@ -20,12 +18,15 @@ const models = require('./index'); class NodeDeactivationInfo { /** * Create a NodeDeactivationInfo. - * @member {string} [nodeDeactivationIntent] Possible values include: - * 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' - * @member {string} [nodeDeactivationStatus] Possible values include: 'None', - * 'SafetyCheckInProgress', 'SafetyCheckComplete', 'Completed' - * @member {array} [nodeDeactivationTask] - * @member {array} [pendingSafetyChecks] + * @member {string} [nodeDeactivationIntent] The intent or the reason for + * deactivating the node. Following are the possible values for it. Possible + * values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' + * @member {string} [nodeDeactivationStatus] The status of node deactivation + * operation. Following are the possible values. Possible values include: + * 'None', 'SafetyCheckInProgress', 'SafetyCheckComplete', 'Completed' + * @member {array} [nodeDeactivationTask] List of tasks representing the + * deactivation operation on the node. + * @member {array} [pendingSafetyChecks] List of pending safety checks */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/nodeDeactivationTask.js b/lib/services/serviceFabric/lib/models/nodeDeactivationTask.js index 7c35899b46..89a66400d5 100644 --- a/lib/services/serviceFabric/lib/models/nodeDeactivationTask.js +++ b/lib/services/serviceFabric/lib/models/nodeDeactivationTask.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The task representing the deactivation operation on the node. * @@ -19,12 +17,16 @@ const models = require('./index'); class NodeDeactivationTask { /** * Create a NodeDeactivationTask. - * @member {object} [nodeDeactivationTaskId] + * @member {object} [nodeDeactivationTaskId] Identity of the task related to + * deactivation operation on the node. * @member {string} [nodeDeactivationTaskId.id] Value of the task id. - * @member {string} [nodeDeactivationTaskId.nodeDeactivationTaskType] - * Possible values include: 'Invalid', 'Infrastructure', 'Repair', 'Client' - * @member {string} [nodeDeactivationIntent] Possible values include: - * 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' + * @member {string} [nodeDeactivationTaskId.nodeDeactivationTaskType] The + * type of the task that performed the node deactivation. Following are the + * possible values. Possible values include: 'Invalid', 'Infrastructure', + * 'Repair', 'Client' + * @member {string} [nodeDeactivationIntent] The intent or the reason for + * deactivating the node. Following are the possible values for it. Possible + * values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/nodeDeactivationTaskId.js b/lib/services/serviceFabric/lib/models/nodeDeactivationTaskId.js index a9636eab92..65b86e908d 100644 --- a/lib/services/serviceFabric/lib/models/nodeDeactivationTaskId.js +++ b/lib/services/serviceFabric/lib/models/nodeDeactivationTaskId.js @@ -18,8 +18,9 @@ class NodeDeactivationTaskId { /** * Create a NodeDeactivationTaskId. * @member {string} [id] Value of the task id. - * @member {string} [nodeDeactivationTaskType] Possible values include: - * 'Invalid', 'Infrastructure', 'Repair', 'Client' + * @member {string} [nodeDeactivationTaskType] The type of the task that + * performed the node deactivation. Following are the possible values. + * Possible values include: 'Invalid', 'Infrastructure', 'Repair', 'Client' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/nodeDownEvent.js b/lib/services/serviceFabric/lib/models/nodeDownEvent.js new file mode 100644 index 0000000000..d91bde47f3 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeDownEvent.js @@ -0,0 +1,105 @@ +/* + * 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'); + +/** + * Node Down event. + * + * @extends models['NodeEvent'] + */ +class NodeDownEvent extends models['NodeEvent'] { + /** + * Create a NodeDownEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {date} lastNodeUpAt Time when Node was last up. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeDownEvent + * + * @returns {object} metadata of NodeDownEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeDown', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeDownEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + lastNodeUpAt: { + required: true, + serializedName: 'LastNodeUpAt', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = NodeDownEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeEvent.js b/lib/services/serviceFabric/lib/models/nodeEvent.js new file mode 100644 index 0000000000..9fa73fdbaf --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeEvent.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Node Events. + * + * @extends models['FabricEvent'] + */ +class NodeEvent extends models['FabricEvent'] { + /** + * Create a NodeEvent. + * @member {string} nodeName The name of a Service Fabric node. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeEvent + * + * @returns {object} metadata of NodeEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeHealth.js b/lib/services/serviceFabric/lib/models/nodeHealth.js index e36887e251..0b9558b8d4 100644 --- a/lib/services/serviceFabric/lib/models/nodeHealth.js +++ b/lib/services/serviceFabric/lib/models/nodeHealth.js @@ -20,7 +20,8 @@ const models = require('./index'); class NodeHealth extends models['EntityHealth'] { /** * Create a NodeHealth. - * @member {string} [name] + * @member {string} [name] Name of the node whose health information is + * described by this object. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/nodeHealthEvaluation.js b/lib/services/serviceFabric/lib/models/nodeHealthEvaluation.js index f26941786d..0a68519d19 100644 --- a/lib/services/serviceFabric/lib/models/nodeHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/nodeHealthEvaluation.js @@ -23,8 +23,10 @@ const models = require('./index'); class NodeHealthEvaluation extends models['HealthEvaluation'] { /** * Create a NodeHealthEvaluation. - * @member {string} [nodeName] - * @member {array} [unhealthyEvaluations] + * @member {string} [nodeName] The name of a Service Fabric node. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the node. The types of the + * unhealthy evaluations can be EventHealthEvaluation. */ constructor() { super(); @@ -42,6 +44,11 @@ class NodeHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Node', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'NodeHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -61,6 +68,7 @@ class NodeHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/nodeHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/nodeHealthReportCreatedEvent.js new file mode 100644 index 0000000000..55aaee6480 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeHealthReportCreatedEvent.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'); + +/** + * Node Health Report Created event. + * + * @extends models['NodeEvent'] + */ +class NodeHealthReportCreatedEvent extends models['NodeEvent'] { + /** + * Create a NodeHealthReportCreatedEvent. + * @member {number} nodeInstanceId Id of Node instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeHealthReportCreatedEvent + * + * @returns {object} metadata of NodeHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstanceId: { + required: true, + serializedName: 'NodeInstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = NodeHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/nodeHealthReportExpiredEvent.js new file mode 100644 index 0000000000..5357baab58 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeHealthReportExpiredEvent.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'); + +/** + * Node Health Report Expired event. + * + * @extends models['NodeEvent'] + */ +class NodeHealthReportExpiredEvent extends models['NodeEvent'] { + /** + * Create a NodeHealthReportExpiredEvent. + * @member {number} nodeInstanceId Id of Node instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeHealthReportExpiredEvent + * + * @returns {object} metadata of NodeHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstanceId: { + required: true, + serializedName: 'NodeInstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = NodeHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeHealthState.js b/lib/services/serviceFabric/lib/models/nodeHealthState.js index 17c66c139d..aa8742852d 100644 --- a/lib/services/serviceFabric/lib/models/nodeHealthState.js +++ b/lib/services/serviceFabric/lib/models/nodeHealthState.js @@ -21,8 +21,9 @@ const models = require('./index'); class NodeHealthState extends models['EntityHealthState'] { /** * Create a NodeHealthState. - * @member {string} [name] - * @member {object} [id] + * @member {string} [name] The name of a Service Fabric node. + * @member {object} [id] An internal ID used by Service Fabric to uniquely + * identify a node. Node Id is deterministically generated from node name. * @member {string} [id.id] Value of the node Id. This is a 128 bit integer. */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/nodeHealthStateChunk.js b/lib/services/serviceFabric/lib/models/nodeHealthStateChunk.js index 9c59ce5c9b..22815f8be7 100644 --- a/lib/services/serviceFabric/lib/models/nodeHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/nodeHealthStateChunk.js @@ -16,13 +16,12 @@ const models = require('./index'); * Represents the health state chunk of a node, which contains the node name * and its aggregated health state. * - * * @extends models['EntityHealthStateChunk'] */ class NodeHealthStateChunk extends models['EntityHealthStateChunk'] { /** * Create a NodeHealthStateChunk. - * @member {string} [nodeName] + * @member {string} [nodeName] The name of a Service Fabric node. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/nodeHealthStateChunkList.js b/lib/services/serviceFabric/lib/models/nodeHealthStateChunkList.js index b5c78478c6..8595851ef6 100644 --- a/lib/services/serviceFabric/lib/models/nodeHealthStateChunkList.js +++ b/lib/services/serviceFabric/lib/models/nodeHealthStateChunkList.js @@ -17,7 +17,6 @@ const models = require('./index'); * filters in the chunk query. Returned by get cluster health state chunks * query. * - * * @extends models['EntityHealthStateChunkList'] */ class NodeHealthStateChunkList extends models['EntityHealthStateChunkList'] { diff --git a/lib/services/serviceFabric/lib/models/nodeHealthStateFilter.js b/lib/services/serviceFabric/lib/models/nodeHealthStateFilter.js index 7cc6cb8c62..b6a9865789 100644 --- a/lib/services/serviceFabric/lib/models/nodeHealthStateFilter.js +++ b/lib/services/serviceFabric/lib/models/nodeHealthStateFilter.js @@ -17,7 +17,6 @@ * properties. * Can be specified in the cluster health chunk query description. * - * */ class NodeHealthStateFilter { /** @@ -40,7 +39,7 @@ class NodeHealthStateFilter { * If not specified, default value is None, unless the node name is * specified. If the filter has default value and node name is specified, the * matching node is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches nodes with HealthState * value of OK (2) and Warning (4). @@ -55,8 +54,7 @@ class NodeHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The * value is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/nodeImpact.js b/lib/services/serviceFabric/lib/models/nodeImpact.js index eea867b7df..538b7b6c66 100644 --- a/lib/services/serviceFabric/lib/models/nodeImpact.js +++ b/lib/services/serviceFabric/lib/models/nodeImpact.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class NodeImpact { /** diff --git a/lib/services/serviceFabric/lib/models/nodeInfo.js b/lib/services/serviceFabric/lib/models/nodeInfo.js index 69c1ec4c9e..ee604e8dec 100644 --- a/lib/services/serviceFabric/lib/models/nodeInfo.js +++ b/lib/services/serviceFabric/lib/models/nodeInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a node in Service Fabric cluster. * @@ -19,7 +17,7 @@ const models = require('./index'); class NodeInfo { /** * Create a NodeInfo. - * @member {string} [name] + * @member {string} [name] The name of a Service Fabric node. * @member {string} [ipAddressOrFQDN] The IP address or fully qualified * domain name of the node. * @member {string} [type] The type of the node. @@ -27,31 +25,41 @@ class NodeInfo { * the node is running. * @member {string} [configVersion] The version of Service Fabric cluster * manifest that the node is using. - * @member {string} [nodeStatus] Possible values include: 'Invalid', 'Up', - * 'Down', 'Enabling', 'Disabling', 'Disabled', 'Unknown', 'Removed' + * @member {string} [nodeStatus] The status of the node. Possible values + * include: 'Invalid', 'Up', 'Down', 'Enabling', 'Disabling', 'Disabled', + * 'Unknown', 'Removed' * @member {string} [nodeUpTimeInSeconds] Time in seconds since the node has - * been in NodeStatus Up. Value ero indicates that the node is not Up. - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' + * been in NodeStatus Up. Value zero indicates that the node is not Up. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' * @member {boolean} [isSeedNode] Indicates if the node is a seed node or * not. Returns true if the node is a seed node, otherwise false. A quorum of * seed nodes are required for proper operation of Service Fabric cluster. * @member {string} [upgradeDomain] The upgrade domain of the node. * @member {string} [faultDomain] The fault domain of the node. - * @member {object} [id] + * @member {object} [id] An internal ID used by Service Fabric to uniquely + * identify a node. Node Id is deterministically generated from node name. * @member {string} [id.id] Value of the node Id. This is a 128 bit integer. - * @member {string} [instanceId] The id representing the node instance. While - * the Id of the node is deterministically generated from the node name and + * @member {string} [instanceId] The ID representing the node instance. While + * the ID of the node is deterministically generated from the node name and * remains same across restarts, the InstanceId changes every time node * restarts. - * @member {object} [nodeDeactivationInfo] - * @member {string} [nodeDeactivationInfo.nodeDeactivationIntent] Possible - * values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode' - * @member {string} [nodeDeactivationInfo.nodeDeactivationStatus] Possible - * values include: 'None', 'SafetyCheckInProgress', 'SafetyCheckComplete', - * 'Completed' - * @member {array} [nodeDeactivationInfo.nodeDeactivationTask] - * @member {array} [nodeDeactivationInfo.pendingSafetyChecks] + * @member {object} [nodeDeactivationInfo] Information about the node + * deactivation. This information is valid for a node that is undergoing + * deactivation or has already been deactivated. + * @member {string} [nodeDeactivationInfo.nodeDeactivationIntent] The intent + * or the reason for deactivating the node. Following are the possible values + * for it. Possible values include: 'Invalid', 'Pause', 'Restart', + * 'RemoveData', 'RemoveNode' + * @member {string} [nodeDeactivationInfo.nodeDeactivationStatus] The status + * of node deactivation operation. Following are the possible values. + * Possible values include: 'None', 'SafetyCheckInProgress', + * 'SafetyCheckComplete', 'Completed' + * @member {array} [nodeDeactivationInfo.nodeDeactivationTask] List of tasks + * representing the deactivation operation on the node. + * @member {array} [nodeDeactivationInfo.pendingSafetyChecks] List of pending + * safety checks * @member {boolean} [isStopped] Indicates if the node is stopped by calling * stop node API or not. Returns true if the node is stopped, otherwise * false. diff --git a/lib/services/serviceFabric/lib/models/nodeLoadInfo.js b/lib/services/serviceFabric/lib/models/nodeLoadInfo.js index b9aa6fd3de..e52096f079 100644 --- a/lib/services/serviceFabric/lib/models/nodeLoadInfo.js +++ b/lib/services/serviceFabric/lib/models/nodeLoadInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about load on a Service Fabric node. It holds a summary of all * metrics and their load on a node. @@ -20,7 +18,8 @@ const models = require('./index'); class NodeLoadInfo { /** * Create a NodeLoadInfo. - * @member {string} [nodeName] + * @member {string} [nodeName] Name of the node for which the load + * information is provided by this object. * @member {array} [nodeLoadMetricInformation] List that contains metrics and * their load information on this node. */ diff --git a/lib/services/serviceFabric/lib/models/nodeOpenFailedEvent.js b/lib/services/serviceFabric/lib/models/nodeOpenFailedEvent.js new file mode 100644 index 0000000000..147f21f661 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeOpenFailedEvent.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'); + +/** + * Node Open Failed event. + * + * @extends models['NodeEvent'] + */ +class NodeOpenFailedEvent extends models['NodeEvent'] { + /** + * Create a NodeOpenFailedEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + * @member {string} error Describes the error. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeOpenFailedEvent + * + * @returns {object} metadata of NodeOpenFailedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeOpenFailed', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeOpenFailedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + upgradeDomain: { + required: true, + serializedName: 'UpgradeDomain', + type: { + name: 'String' + } + }, + faultDomain: { + required: true, + serializedName: 'FaultDomain', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + hostname: { + required: true, + serializedName: 'Hostname', + type: { + name: 'String' + } + }, + isSeedNode: { + required: true, + serializedName: 'IsSeedNode', + type: { + name: 'Boolean' + } + }, + nodeVersion: { + required: true, + serializedName: 'NodeVersion', + type: { + name: 'String' + } + }, + error: { + required: true, + serializedName: 'Error', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeOpenFailedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeOpenedSuccessEvent.js b/lib/services/serviceFabric/lib/models/nodeOpenedSuccessEvent.js new file mode 100644 index 0000000000..85a48da92e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeOpenedSuccessEvent.js @@ -0,0 +1,153 @@ +/* + * 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'); + +/** + * Node Opened Success event. + * + * @extends models['NodeEvent'] + */ +class NodeOpenedSuccessEvent extends models['NodeEvent'] { + /** + * Create a NodeOpenedSuccessEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeOpenedSuccessEvent + * + * @returns {object} metadata of NodeOpenedSuccessEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeOpenedSuccess', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeOpenedSuccessEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + upgradeDomain: { + required: true, + serializedName: 'UpgradeDomain', + type: { + name: 'String' + } + }, + faultDomain: { + required: true, + serializedName: 'FaultDomain', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + hostname: { + required: true, + serializedName: 'Hostname', + type: { + name: 'String' + } + }, + isSeedNode: { + required: true, + serializedName: 'IsSeedNode', + type: { + name: 'Boolean' + } + }, + nodeVersion: { + required: true, + serializedName: 'NodeVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeOpenedSuccessEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeOpeningEvent.js b/lib/services/serviceFabric/lib/models/nodeOpeningEvent.js new file mode 100644 index 0000000000..bae045bc15 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeOpeningEvent.js @@ -0,0 +1,153 @@ +/* + * 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'); + +/** + * Node Opening event. + * + * @extends models['NodeEvent'] + */ +class NodeOpeningEvent extends models['NodeEvent'] { + /** + * Create a NodeOpeningEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeId Id of Node. + * @member {string} upgradeDomain Upgrade domain of Node. + * @member {string} faultDomain Fault domain of Node. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} hostname Name of Host. + * @member {boolean} isSeedNode Indicates if it is seed node. + * @member {string} nodeVersion Version of Node. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeOpeningEvent + * + * @returns {object} metadata of NodeOpeningEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeOpening', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeOpeningEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + upgradeDomain: { + required: true, + serializedName: 'UpgradeDomain', + type: { + name: 'String' + } + }, + faultDomain: { + required: true, + serializedName: 'FaultDomain', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + hostname: { + required: true, + serializedName: 'Hostname', + type: { + name: 'String' + } + }, + isSeedNode: { + required: true, + serializedName: 'IsSeedNode', + type: { + name: 'Boolean' + } + }, + nodeVersion: { + required: true, + serializedName: 'NodeVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeOpeningEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeRemovedEvent.js b/lib/services/serviceFabric/lib/models/nodeRemovedEvent.js new file mode 100644 index 0000000000..0e439e38fd --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeRemovedEvent.js @@ -0,0 +1,137 @@ +/* + * 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'); + +/** + * Node Removed event. + * + * @extends models['NodeEvent'] + */ +class NodeRemovedEvent extends models['NodeEvent'] { + /** + * Create a NodeRemovedEvent. + * @member {string} nodeId Id of Node. + * @member {number} nodeInstance Id of Node instance. + * @member {string} nodeType Type of Node. + * @member {string} fabricVersion Fabric version. + * @member {string} ipAddressOrFQDN IP address or FQDN. + * @member {string} nodeCapacities Capacities. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeRemovedEvent + * + * @returns {object} metadata of NodeRemovedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeRemoved', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeRemovedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeId: { + required: true, + serializedName: 'NodeId', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + nodeType: { + required: true, + serializedName: 'NodeType', + type: { + name: 'String' + } + }, + fabricVersion: { + required: true, + serializedName: 'FabricVersion', + type: { + name: 'String' + } + }, + ipAddressOrFQDN: { + required: true, + serializedName: 'IpAddressOrFQDN', + type: { + name: 'String' + } + }, + nodeCapacities: { + required: true, + serializedName: 'NodeCapacities', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeRemovedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeRepairImpactDescription.js b/lib/services/serviceFabric/lib/models/nodeRepairImpactDescription.js index bab68ee90c..674f471263 100644 --- a/lib/services/serviceFabric/lib/models/nodeRepairImpactDescription.js +++ b/lib/services/serviceFabric/lib/models/nodeRepairImpactDescription.js @@ -18,7 +18,6 @@ const models = require('./index'); * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @extends models['RepairImpactDescriptionBase'] */ class NodeRepairImpactDescription extends models['RepairImpactDescriptionBase'] { @@ -43,11 +42,17 @@ class NodeRepairImpactDescription extends models['RepairImpactDescriptionBase'] serializedName: 'Node', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'RepairImpactDescriptionBase', className: 'NodeRepairImpactDescription', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/nodeRepairTargetDescription.js b/lib/services/serviceFabric/lib/models/nodeRepairTargetDescription.js index 51ea00cf54..654e1ec5cc 100644 --- a/lib/services/serviceFabric/lib/models/nodeRepairTargetDescription.js +++ b/lib/services/serviceFabric/lib/models/nodeRepairTargetDescription.js @@ -18,7 +18,6 @@ const models = require('./index'); * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @extends models['RepairTargetDescriptionBase'] */ class NodeRepairTargetDescription extends models['RepairTargetDescriptionBase'] { @@ -42,11 +41,17 @@ class NodeRepairTargetDescription extends models['RepairTargetDescriptionBase'] serializedName: 'Node', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'RepairTargetDescriptionBase', className: 'NodeRepairTargetDescription', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/nodeResult.js b/lib/services/serviceFabric/lib/models/nodeResult.js index af10adea46..63ed2d75c6 100644 --- a/lib/services/serviceFabric/lib/models/nodeResult.js +++ b/lib/services/serviceFabric/lib/models/nodeResult.js @@ -18,7 +18,7 @@ class NodeResult { /** * Create a NodeResult. - * @member {string} [nodeName] + * @member {string} [nodeName] The name of a Service Fabric node. * @member {string} [nodeInstanceId] The node instance id. */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/nodeTransitionProgress.js b/lib/services/serviceFabric/lib/models/nodeTransitionProgress.js index 9de744467f..3bc6a7c810 100644 --- a/lib/services/serviceFabric/lib/models/nodeTransitionProgress.js +++ b/lib/services/serviceFabric/lib/models/nodeTransitionProgress.js @@ -10,27 +10,28 @@ 'use strict'; -const models = require('./index'); - /** * Information about an NodeTransition operation. This class contains an * OperationState and a NodeTransitionResult. The NodeTransitionResult is not * valid until OperationState * is Completed or Faulted. * - * */ class NodeTransitionProgress { /** * Create a NodeTransitionProgress. - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [nodeTransitionResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [nodeTransitionResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [nodeTransitionResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [nodeTransitionResult.nodeResult] - * @member {string} [nodeTransitionResult.nodeResult.nodeName] + * @member {object} [nodeTransitionResult.nodeResult] Contains information + * about a node that was targeted by a user-induced operation. + * @member {string} [nodeTransitionResult.nodeResult.nodeName] The name of a + * Service Fabric node. * @member {string} [nodeTransitionResult.nodeResult.nodeInstanceId] The node * instance id. */ diff --git a/lib/services/serviceFabric/lib/models/nodeTransitionResult.js b/lib/services/serviceFabric/lib/models/nodeTransitionResult.js index fde5ee56e9..4fdaf5a4ba 100644 --- a/lib/services/serviceFabric/lib/models/nodeTransitionResult.js +++ b/lib/services/serviceFabric/lib/models/nodeTransitionResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents information about an operation in a terminal state (Completed or * Faulted). @@ -22,8 +20,9 @@ class NodeTransitionResult { * Create a NodeTransitionResult. * @member {number} [errorCode] If OperationState is Completed, this is 0. * If OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [nodeResult] - * @member {string} [nodeResult.nodeName] + * @member {object} [nodeResult] Contains information about a node that was + * targeted by a user-induced operation. + * @member {string} [nodeResult.nodeName] The name of a Service Fabric node. * @member {string} [nodeResult.nodeInstanceId] The node instance id. */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/nodeUpEvent.js b/lib/services/serviceFabric/lib/models/nodeUpEvent.js new file mode 100644 index 0000000000..cfb4eceb32 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeUpEvent.js @@ -0,0 +1,105 @@ +/* + * 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'); + +/** + * Node Up event. + * + * @extends models['NodeEvent'] + */ +class NodeUpEvent extends models['NodeEvent'] { + /** + * Create a NodeUpEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {date} lastNodeDownAt Time when Node was last down. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeUpEvent + * + * @returns {object} metadata of NodeUpEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeUp', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeUpEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstance: { + required: true, + serializedName: 'NodeInstance', + type: { + name: 'Number' + } + }, + lastNodeDownAt: { + required: true, + serializedName: 'LastNodeDownAt', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = NodeUpEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeUpgradeProgressInfo.js b/lib/services/serviceFabric/lib/models/nodeUpgradeProgressInfo.js index 504fce8acf..369c2fbc5d 100644 --- a/lib/services/serviceFabric/lib/models/nodeUpgradeProgressInfo.js +++ b/lib/services/serviceFabric/lib/models/nodeUpgradeProgressInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about the upgrading node and its status * @@ -19,10 +17,11 @@ const models = require('./index'); class NodeUpgradeProgressInfo { /** * Create a NodeUpgradeProgressInfo. - * @member {string} [nodeName] - * @member {string} [upgradePhase] Possible values include: 'Invalid', - * 'PreUpgradeSafetyCheck', 'Upgrading', 'PostUpgradeSafetyCheck' - * @member {array} [pendingSafetyChecks] + * @member {string} [nodeName] The name of a Service Fabric node. + * @member {string} [upgradePhase] The state of the upgrading node. Possible + * values include: 'Invalid', 'PreUpgradeSafetyCheck', 'Upgrading', + * 'PostUpgradeSafetyCheck' + * @member {array} [pendingSafetyChecks] List of pending safety checks */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/nodesHealthEvaluation.js b/lib/services/serviceFabric/lib/models/nodesHealthEvaluation.js index e65df6d54c..04f94beeef 100644 --- a/lib/services/serviceFabric/lib/models/nodesHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/nodesHealthEvaluation.js @@ -27,7 +27,9 @@ class NodesHealthEvaluation extends models['HealthEvaluation'] { * unhealthy nodes from the ClusterHealthPolicy. * @member {number} [totalCount] Total number of nodes found in the health * store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * NodeHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -45,6 +47,11 @@ class NodesHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Nodes', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'NodesHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -64,6 +71,7 @@ class NodesHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/operationStatus.js b/lib/services/serviceFabric/lib/models/operationStatus.js index 72c672e372..ac17b741a5 100644 --- a/lib/services/serviceFabric/lib/models/operationStatus.js +++ b/lib/services/serviceFabric/lib/models/operationStatus.js @@ -18,12 +18,14 @@ class OperationStatus { /** * Create a OperationStatus. - * @member {uuid} [operationId] - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {string} [type] Possible values include: 'Invalid', - * 'PartitionDataLoss', 'PartitionQuorumLoss', 'PartitionRestart', - * 'NodeTransition' + * @member {uuid} [operationId] A GUID that identifies a call to this API. + * This is also passed into the corresponding GetProgress API. + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {string} [type] The type of the operation. Possible values + * include: 'Invalid', 'PartitionDataLoss', 'PartitionQuorumLoss', + * 'PartitionRestart', 'NodeTransition' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/packageSharingPolicyInfo.js b/lib/services/serviceFabric/lib/models/packageSharingPolicyInfo.js index e82901fa9d..9619bf4957 100644 --- a/lib/services/serviceFabric/lib/models/packageSharingPolicyInfo.js +++ b/lib/services/serviceFabric/lib/models/packageSharingPolicyInfo.js @@ -19,8 +19,10 @@ class PackageSharingPolicyInfo { * Create a PackageSharingPolicyInfo. * @member {string} [sharedPackageName] The name of code, configuration or * data package that should be shared. - * @member {string} [packageSharingScope] Possible values include: 'None', - * 'All', 'Code', 'Config', 'Data' + * @member {string} [packageSharingScope] Represents the scope for + * PackageSharingPolicy. This is specified during DeployServicePackageToNode + * operation. Possible values include: 'None', 'All', 'Code', 'Config', + * 'Data' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedApplicationInfoList.js b/lib/services/serviceFabric/lib/models/pagedApplicationInfoList.js index 14f990a6c1..e53e9d6a57 100644 --- a/lib/services/serviceFabric/lib/models/pagedApplicationInfoList.js +++ b/lib/services/serviceFabric/lib/models/pagedApplicationInfoList.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of applications in the cluster. The list is paged when all of the * results cannot fit in a single message. The next set of results can be @@ -22,8 +20,13 @@ const models = require('./index'); class PagedApplicationInfoList { /** * Create a PagedApplicationInfoList. - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of application information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedApplicationTypeInfoList.js b/lib/services/serviceFabric/lib/models/pagedApplicationTypeInfoList.js index a6638cb93f..00d4773a9b 100644 --- a/lib/services/serviceFabric/lib/models/pagedApplicationTypeInfoList.js +++ b/lib/services/serviceFabric/lib/models/pagedApplicationTypeInfoList.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of application types that are provisioned or being provisioned in * the cluster. The list is paged when all of the results cannot fit in a @@ -22,8 +20,13 @@ const models = require('./index'); class PagedApplicationTypeInfoList { /** * Create a PagedApplicationTypeInfoList. - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of application type information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedBackupConfigurationInfoList.js b/lib/services/serviceFabric/lib/models/pagedBackupConfigurationInfoList.js new file mode 100644 index 0000000000..136c88dc5b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedBackupConfigurationInfoList.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of backup configuration information. The list is paged when all of + * the results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. + * + */ +class PagedBackupConfigurationInfoList { + /** + * Create a PagedBackupConfigurationInfoList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of backup configuration information. + */ + constructor() { + } + + /** + * Defines the metadata of PagedBackupConfigurationInfoList + * + * @returns {object} metadata of PagedBackupConfigurationInfoList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedBackupConfigurationInfoList', + type: { + name: 'Composite', + className: 'PagedBackupConfigurationInfoList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackupConfigurationInfoElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'BackupConfigurationInfo', + className: 'BackupConfigurationInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedBackupConfigurationInfoList; diff --git a/lib/services/serviceFabric/lib/models/pagedBackupEntityList.js b/lib/services/serviceFabric/lib/models/pagedBackupEntityList.js new file mode 100644 index 0000000000..f52aa12e14 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedBackupEntityList.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of backup entities that are being periodically backed. The list is + * paged when all of the results cannot fit in a single message. The next set + * of results can be obtained by executing the same query with the continuation + * token provided in this list. + * + */ +class PagedBackupEntityList { + /** + * Create a PagedBackupEntityList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of backup entity information. + */ + constructor() { + } + + /** + * Defines the metadata of PagedBackupEntityList + * + * @returns {object} metadata of PagedBackupEntityList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedBackupEntityList', + type: { + name: 'Composite', + className: 'PagedBackupEntityList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackupEntityElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'EntityKind', + clientName: 'entityKind' + }, + uberParent: 'BackupEntity', + className: 'BackupEntity' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedBackupEntityList; diff --git a/lib/services/serviceFabric/lib/models/pagedBackupInfoList.js b/lib/services/serviceFabric/lib/models/pagedBackupInfoList.js new file mode 100644 index 0000000000..9cd840d4f4 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedBackupInfoList.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'; + +/** + * The list of backups. The list is paged when all of the results cannot fit in + * a single message. The next set of results can be obtained by executing the + * same query with the continuation token provided in this list. + * + */ +class PagedBackupInfoList { + /** + * Create a PagedBackupInfoList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of backup information. + */ + constructor() { + } + + /** + * Defines the metadata of PagedBackupInfoList + * + * @returns {object} metadata of PagedBackupInfoList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedBackupInfoList', + type: { + name: 'Composite', + className: 'PagedBackupInfoList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackupInfoElementType', + type: { + name: 'Composite', + className: 'BackupInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedBackupInfoList; diff --git a/lib/services/serviceFabric/lib/models/pagedBackupPolicyDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedBackupPolicyDescriptionList.js new file mode 100644 index 0000000000..eb58d932ce --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedBackupPolicyDescriptionList.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of backup policies configured in the cluster. The list is paged + * when all of the results cannot fit in a single message. The next set of + * results can be obtained by executing the same query with the continuation + * token provided in this list. + * + */ +class PagedBackupPolicyDescriptionList { + /** + * Create a PagedBackupPolicyDescriptionList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] The list of backup policies information. + */ + constructor() { + } + + /** + * Defines the metadata of PagedBackupPolicyDescriptionList + * + * @returns {object} metadata of PagedBackupPolicyDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedBackupPolicyDescriptionList', + type: { + name: 'Composite', + className: 'PagedBackupPolicyDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BackupPolicyDescriptionElementType', + type: { + name: 'Composite', + className: 'BackupPolicyDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedBackupPolicyDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedComposeDeploymentStatusInfoList.js b/lib/services/serviceFabric/lib/models/pagedComposeDeploymentStatusInfoList.js index 40c027f74e..93cddee908 100644 --- a/lib/services/serviceFabric/lib/models/pagedComposeDeploymentStatusInfoList.js +++ b/lib/services/serviceFabric/lib/models/pagedComposeDeploymentStatusInfoList.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of compose deployments in the cluster. The list is paged when all * of the results cannot fit in a single message. The next set of results can @@ -22,8 +20,13 @@ const models = require('./index'); class PagedComposeDeploymentStatusInfoList { /** * Create a PagedComposeDeploymentStatusInfoList. - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of compose deployment status information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedDeployedApplicationInfoList.js b/lib/services/serviceFabric/lib/models/pagedDeployedApplicationInfoList.js new file mode 100644 index 0000000000..d97505a45d --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedDeployedApplicationInfoList.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of deployed applications in activating, downloading, or active + * states on a node. + * The list is paged when all of the results cannot fit in a single message. + * The next set of results can be obtained by executing the same query with the + * continuation token provided in this list. + * + */ +class PagedDeployedApplicationInfoList { + /** + * Create a PagedDeployedApplicationInfoList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of deployed application information. + */ + constructor() { + } + + /** + * Defines the metadata of PagedDeployedApplicationInfoList + * + * @returns {object} metadata of PagedDeployedApplicationInfoList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedDeployedApplicationInfoList', + type: { + name: 'Composite', + className: 'PagedDeployedApplicationInfoList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeployedApplicationInfoElementType', + type: { + name: 'Composite', + className: 'DeployedApplicationInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedDeployedApplicationInfoList; diff --git a/lib/services/serviceFabric/lib/models/pagedNodeInfoList.js b/lib/services/serviceFabric/lib/models/pagedNodeInfoList.js index a780a9f126..8f1ae3eee8 100644 --- a/lib/services/serviceFabric/lib/models/pagedNodeInfoList.js +++ b/lib/services/serviceFabric/lib/models/pagedNodeInfoList.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of nodes in the cluster. The list is paged when all of the results * cannot fit in a single message. The next set of results can be obtained by @@ -21,8 +19,13 @@ const models = require('./index'); class PagedNodeInfoList { /** * Create a PagedNodeInfoList. - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of node information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedPropertyInfoList.js b/lib/services/serviceFabric/lib/models/pagedPropertyInfoList.js new file mode 100644 index 0000000000..dad4c04fa5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedPropertyInfoList.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'; + +/** + * The paged list of Service Fabric properties under a given name. The list is + * paged when all of the results cannot fit in a single message. The next set + * of results can be obtained by executing the same query with the continuation + * token provided in this list. + * + */ +class PagedPropertyInfoList { + /** + * Create a PagedPropertyInfoList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {boolean} [isConsistent] Indicates whether any property under the + * given name has been modified during the enumeration. If there was a + * modification, this property value is false. + * @member {array} [properties] List of property information. + */ + constructor() { + } + + /** + * Defines the metadata of PagedPropertyInfoList + * + * @returns {object} metadata of PagedPropertyInfoList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedPropertyInfoList', + type: { + name: 'Composite', + className: 'PagedPropertyInfoList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + isConsistent: { + required: false, + serializedName: 'IsConsistent', + type: { + name: 'Boolean' + } + }, + properties: { + required: false, + serializedName: 'Properties', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PropertyInfoElementType', + type: { + name: 'Composite', + className: 'PropertyInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedPropertyInfoList; diff --git a/lib/services/serviceFabric/lib/models/pagedReplicaInfoList.js b/lib/services/serviceFabric/lib/models/pagedReplicaInfoList.js index 465b865017..3fbd3ed5c1 100644 --- a/lib/services/serviceFabric/lib/models/pagedReplicaInfoList.js +++ b/lib/services/serviceFabric/lib/models/pagedReplicaInfoList.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of replicas in the cluster for a given partition. The list is paged * when all of the results cannot fit in a single message. The next set of @@ -22,8 +20,13 @@ const models = require('./index'); class PagedReplicaInfoList { /** * Create a PagedReplicaInfoList. - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of replica information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedServiceInfoList.js b/lib/services/serviceFabric/lib/models/pagedServiceInfoList.js index dd19b53c6b..a4687ffde8 100644 --- a/lib/services/serviceFabric/lib/models/pagedServiceInfoList.js +++ b/lib/services/serviceFabric/lib/models/pagedServiceInfoList.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of services in the cluster for an application. The list is paged * when all of the results cannot fit in a single message. The next set of @@ -22,8 +20,13 @@ const models = require('./index'); class PagedServiceInfoList { /** * Create a PagedServiceInfoList. - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedServicePartitionInfoList.js b/lib/services/serviceFabric/lib/models/pagedServicePartitionInfoList.js index 5f1949ed31..a84775fbbd 100644 --- a/lib/services/serviceFabric/lib/models/pagedServicePartitionInfoList.js +++ b/lib/services/serviceFabric/lib/models/pagedServicePartitionInfoList.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of partition in the cluster for a service. The list is paged when * all of the results cannot fit in a single message. The next set of results @@ -22,8 +20,13 @@ const models = require('./index'); class PagedServicePartitionInfoList { /** * Create a PagedServicePartitionInfoList. - * @member {string} [continuationToken] - * @member {array} [items] + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service partition information. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedServiceResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedServiceResourceDescriptionList.js new file mode 100644 index 0000000000..b708d9bb53 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedServiceResourceDescriptionList.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of service resources in the cluster. The list is paged when all of + * the results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. + * + */ +class PagedServiceResourceDescriptionList { + /** + * Create a PagedServiceResourceDescriptionList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service resource description. + */ + constructor() { + } + + /** + * Defines the metadata of PagedServiceResourceDescriptionList + * + * @returns {object} metadata of PagedServiceResourceDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedServiceResourceDescriptionList', + type: { + name: 'Composite', + className: 'PagedServiceResourceDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceResourceDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedServiceResourceDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedServiceResourceReplicaDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedServiceResourceReplicaDescriptionList.js new file mode 100644 index 0000000000..4e49b456b1 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedServiceResourceReplicaDescriptionList.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of service resources in the cluster. The list is paged when all of + * the results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. + * + */ +class PagedServiceResourceReplicaDescriptionList { + /** + * Create a PagedServiceResourceReplicaDescriptionList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {array} [items] List of service resource description. + */ + constructor() { + } + + /** + * Defines the metadata of PagedServiceResourceReplicaDescriptionList + * + * @returns {object} metadata of PagedServiceResourceReplicaDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedServiceResourceReplicaDescriptionList', + type: { + name: 'Composite', + className: 'PagedServiceResourceReplicaDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceResourceReplicaDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceResourceReplicaDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedServiceResourceReplicaDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedSubNameInfoList.js b/lib/services/serviceFabric/lib/models/pagedSubNameInfoList.js new file mode 100644 index 0000000000..d5bc7f1727 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedSubNameInfoList.js @@ -0,0 +1,85 @@ +/* + * 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'; + +/** + * A paged list of Service Fabric names. The list is paged when all of the + * results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. + * + */ +class PagedSubNameInfoList { + /** + * Create a PagedSubNameInfoList. + * @member {string} [continuationToken] The continuation token parameter is + * used to obtain next set of results. The continuation token is included in + * the response of the API when the results from the system do not fit in a + * single response. When this value is passed to the next API call, the API + * returns next set of results. If there are no further results, then the + * continuation token is not included in the response. + * @member {boolean} [isConsistent] Indicates whether any name under the + * given name has been modified during the enumeration. If there was a + * modification, this property value is false. + * @member {array} [subNames] List of the child names. + */ + constructor() { + } + + /** + * Defines the metadata of PagedSubNameInfoList + * + * @returns {object} metadata of PagedSubNameInfoList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedSubNameInfoList', + type: { + name: 'Composite', + className: 'PagedSubNameInfoList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + isConsistent: { + required: false, + serializedName: 'IsConsistent', + type: { + name: 'Boolean' + } + }, + subNames: { + required: false, + serializedName: 'SubNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedSubNameInfoList; diff --git a/lib/services/serviceFabric/lib/models/partitionAnalysisEvent.js b/lib/services/serviceFabric/lib/models/partitionAnalysisEvent.js new file mode 100644 index 0000000000..0df9eff7df --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionAnalysisEvent.js @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Partition Analysis Events. + * + * @extends models['PartitionEvent'] + */ +class PartitionAnalysisEvent extends models['PartitionEvent'] { + /** + * Create a PartitionAnalysisEvent. + * @member {object} metadata Metadata about an Analysis Event. + * @member {moment.duration} [metadata.delay] The analysis delay. + * @member {moment.duration} [metadata.duration] The duration of analysis. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionAnalysisEvent + * + * @returns {object} metadata of PartitionAnalysisEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionAnalysisEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionAnalysisEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + metadata: { + required: true, + serializedName: 'Metadata', + type: { + name: 'Composite', + className: 'AnalysisEventMetadata' + } + } + } + } + }; + } +} + +module.exports = PartitionAnalysisEvent; diff --git a/lib/services/serviceFabric/lib/models/partitionBackupConfigurationInfo.js b/lib/services/serviceFabric/lib/models/partitionBackupConfigurationInfo.js new file mode 100644 index 0000000000..cbda0dac55 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionBackupConfigurationInfo.js @@ -0,0 +1,105 @@ +/* + * 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'); + +/** + * Backup configuration information, for a specific partition, specifying what + * backup policy is being applied and suspend description, if any. + * + * @extends models['BackupConfigurationInfo'] + */ +class PartitionBackupConfigurationInfo extends models['BackupConfigurationInfo'] { + /** + * Create a PartitionBackupConfigurationInfo. + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionBackupConfigurationInfo + * + * @returns {object} metadata of PartitionBackupConfigurationInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'Partition', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'BackupConfigurationInfo', + className: 'PartitionBackupConfigurationInfo', + modelProperties: { + policyName: { + required: false, + serializedName: 'PolicyName', + type: { + name: 'String' + } + }, + policyInheritedFrom: { + required: false, + serializedName: 'PolicyInheritedFrom', + type: { + name: 'String' + } + }, + suspensionInfo: { + required: false, + serializedName: 'SuspensionInfo', + type: { + name: 'Composite', + className: 'BackupSuspensionInfo' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceName: { + required: false, + serializedName: 'ServiceName', + type: { + name: 'String' + } + }, + partitionId: { + required: false, + serializedName: 'PartitionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PartitionBackupConfigurationInfo; diff --git a/lib/services/serviceFabric/lib/models/partitionBackupEntity.js b/lib/services/serviceFabric/lib/models/partitionBackupEntity.js new file mode 100644 index 0000000000..2533083c48 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionBackupEntity.js @@ -0,0 +1,82 @@ +/* + * 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'); + +/** + * Identifies the Service Fabric stateful partition which is being backed up. + * + * @extends models['BackupEntity'] + */ +class PartitionBackupEntity extends models['BackupEntity'] { + /** + * Create a PartitionBackupEntity. + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionBackupEntity + * + * @returns {object} metadata of PartitionBackupEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'Partition', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'EntityKind', + clientName: 'entityKind' + }, + uberParent: 'BackupEntity', + className: 'PartitionBackupEntity', + modelProperties: { + entityKind: { + required: true, + serializedName: 'EntityKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceName: { + required: false, + serializedName: 'ServiceName', + type: { + name: 'String' + } + }, + partitionId: { + required: false, + serializedName: 'PartitionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PartitionBackupEntity; diff --git a/lib/services/serviceFabric/lib/models/partitionDataLossProgress.js b/lib/services/serviceFabric/lib/models/partitionDataLossProgress.js index 6c3d2f3459..2c0e2da5ff 100644 --- a/lib/services/serviceFabric/lib/models/partitionDataLossProgress.js +++ b/lib/services/serviceFabric/lib/models/partitionDataLossProgress.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a partition data loss user-induced operation. * @@ -19,15 +17,25 @@ const models = require('./index'); class PartitionDataLossProgress { /** * Create a PartitionDataLossProgress. - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [invokeDataLossResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [invokeDataLossResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [invokeDataLossResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [invokeDataLossResult.selectedPartition] - * @member {string} [invokeDataLossResult.selectedPartition.serviceName] - * @member {uuid} [invokeDataLossResult.selectedPartition.partitionId] + * @member {object} [invokeDataLossResult.selectedPartition] This class + * returns information about the partition that the user-induced operation + * acted upon. + * @member {string} [invokeDataLossResult.selectedPartition.serviceName] The + * name of the service the partition belongs to. + * @member {uuid} [invokeDataLossResult.selectedPartition.partitionId] An + * internal ID used by Service Fabric to uniquely identify a partition. This + * is a randomly generated GUID when the service was created. The partition + * ID is unique and does not change for the lifetime of the service. If the + * same service was deleted and recreated the IDs of its partitions would be + * different. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/partitionEvent.js b/lib/services/serviceFabric/lib/models/partitionEvent.js new file mode 100644 index 0000000000..ba4a05c79b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionEvent.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Partition Events. + * + * @extends models['FabricEvent'] + */ +class PartitionEvent extends models['FabricEvent'] { + /** + * Create a PartitionEvent. + * @member {uuid} partitionId An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionEvent + * + * @returns {object} metadata of PartitionEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PartitionEvent; diff --git a/lib/services/serviceFabric/lib/models/partitionHealth.js b/lib/services/serviceFabric/lib/models/partitionHealth.js index 569499c40b..26bbeace82 100644 --- a/lib/services/serviceFabric/lib/models/partitionHealth.js +++ b/lib/services/serviceFabric/lib/models/partitionHealth.js @@ -20,7 +20,8 @@ const models = require('./index'); class PartitionHealth extends models['EntityHealth'] { /** * Create a PartitionHealth. - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] ID of the partition whose health information + * is described by this object. * @member {array} [replicaHealthStates] The list of replica health states * associated with the partition. */ diff --git a/lib/services/serviceFabric/lib/models/partitionHealthEvaluation.js b/lib/services/serviceFabric/lib/models/partitionHealthEvaluation.js index 20790908fd..9f15d593aa 100644 --- a/lib/services/serviceFabric/lib/models/partitionHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/partitionHealthEvaluation.js @@ -23,8 +23,12 @@ const models = require('./index'); class PartitionHealthEvaluation extends models['HealthEvaluation'] { /** * Create a PartitionHealthEvaluation. - * @member {uuid} [partitionId] - * @member {array} [unhealthyEvaluations] + * @member {uuid} [partitionId] Id of the partition whose health evaluation + * is described by this object. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the partition. The types of + * the unhealthy evaluations can be ReplicasHealthEvaluation or + * EventHealthEvaluation. */ constructor() { super(); @@ -42,6 +46,11 @@ class PartitionHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Partition', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'PartitionHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -61,6 +70,7 @@ class PartitionHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/partitionHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/partitionHealthReportCreatedEvent.js new file mode 100644 index 0000000000..34db2b81ef --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionHealthReportCreatedEvent.js @@ -0,0 +1,153 @@ +/* + * 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'); + +/** + * Partition Health Report Created event. + * + * @extends models['PartitionEvent'] + */ +class PartitionHealthReportCreatedEvent extends models['PartitionEvent'] { + /** + * Create a PartitionHealthReportCreatedEvent. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionHealthReportCreatedEvent + * + * @returns {object} metadata of PartitionHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = PartitionHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/partitionHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/partitionHealthReportExpiredEvent.js new file mode 100644 index 0000000000..d1f8842de6 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionHealthReportExpiredEvent.js @@ -0,0 +1,153 @@ +/* + * 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'); + +/** + * Partition Health Report Expired event. + * + * @extends models['PartitionEvent'] + */ +class PartitionHealthReportExpiredEvent extends models['PartitionEvent'] { + /** + * Create a PartitionHealthReportExpiredEvent. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionHealthReportExpiredEvent + * + * @returns {object} metadata of PartitionHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = PartitionHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/partitionHealthState.js b/lib/services/serviceFabric/lib/models/partitionHealthState.js index f4a7fd56c2..64935f886d 100644 --- a/lib/services/serviceFabric/lib/models/partitionHealthState.js +++ b/lib/services/serviceFabric/lib/models/partitionHealthState.js @@ -21,7 +21,8 @@ const models = require('./index'); class PartitionHealthState extends models['EntityHealthState'] { /** * Create a PartitionHealthState. - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition whose health state is + * described by this object. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/partitionHealthStateChunk.js b/lib/services/serviceFabric/lib/models/partitionHealthStateChunk.js index cdc83afc9b..b167bcb2be 100644 --- a/lib/services/serviceFabric/lib/models/partitionHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/partitionHealthStateChunk.js @@ -14,17 +14,18 @@ const models = require('./index'); /** * Represents the health state chunk of a partition, which contains the - * partition id, its aggregated health state and any replicas that respect the + * partition ID, its aggregated health state and any replicas that respect the * filters in the cluster health chunk query description. * - * * @extends models['EntityHealthStateChunk'] */ class PartitionHealthStateChunk extends models['EntityHealthStateChunk'] { /** * Create a PartitionHealthStateChunk. - * @member {uuid} [partitionId] - * @member {object} [replicaHealthStateChunks] + * @member {uuid} [partitionId] The Id of the partition. + * @member {object} [replicaHealthStateChunks] The list of replica health + * state chunks belonging to the partition that respect the filters in the + * cluster health chunk query description. * @member {array} [replicaHealthStateChunks.items] The list of replica * health state chunks that respect the input filters in the chunk query. */ diff --git a/lib/services/serviceFabric/lib/models/partitionHealthStateChunkList.js b/lib/services/serviceFabric/lib/models/partitionHealthStateChunkList.js index a5acd8314f..7b32f63188 100644 --- a/lib/services/serviceFabric/lib/models/partitionHealthStateChunkList.js +++ b/lib/services/serviceFabric/lib/models/partitionHealthStateChunkList.js @@ -10,15 +10,12 @@ 'use strict'; -const models = require('./index'); - /** * The list of partition health state chunks that respect the input filters in * the chunk query description. * Returned by get cluster health state chunks query as part of the parent * application hierarchy. * - * */ class PartitionHealthStateChunkList { /** diff --git a/lib/services/serviceFabric/lib/models/partitionHealthStateFilter.js b/lib/services/serviceFabric/lib/models/partitionHealthStateFilter.js index 81b5815256..9ba9bfb462 100644 --- a/lib/services/serviceFabric/lib/models/partitionHealthStateFilter.js +++ b/lib/services/serviceFabric/lib/models/partitionHealthStateFilter.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Defines matching criteria to determine whether a partition should be * included as a child of a service in the cluster health chunk. @@ -21,7 +19,6 @@ const models = require('./index'); * One filter can match zero, one or multiple partitions, depending on its * properties. * - * */ class PartitionHealthStateFilter { /** @@ -42,10 +39,10 @@ class PartitionHealthStateFilter { * The possible values are integer value of one of the following health * states. Only partitions that match the filter are returned. All partitions * are used to evaluate the cluster aggregated health state. - * If not specified, default value is None, unless the partition id is - * specified. If the filter has default value and partition id is specified, + * If not specified, default value is None, unless the partition ID is + * specified. If the filter has default value and partition ID is specified, * the matching partition is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches partitions with * HealthState value of OK (2) and Warning (4). @@ -60,8 +57,7 @@ class PartitionHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The * value is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [replicaFilters] Defines a list of filters that specify * which replicas to be included in the returned cluster health chunk as * children of the parent partition. The replicas are returned only if the diff --git a/lib/services/serviceFabric/lib/models/partitionInformation.js b/lib/services/serviceFabric/lib/models/partitionInformation.js index 1d1c22033a..9e335c0fbf 100644 --- a/lib/services/serviceFabric/lib/models/partitionInformation.js +++ b/lib/services/serviceFabric/lib/models/partitionInformation.js @@ -18,7 +18,11 @@ class PartitionInformation { /** * Create a PartitionInformation. - * @member {uuid} [id] + * @member {uuid} [id] An internal ID used by Service Fabric to uniquely + * identify a partition. This is a randomly generated GUID when the service + * was created. The partition ID is unique and does not change for the + * lifetime of the service. If the same service was deleted and recreated the + * IDs of its partitions would be different. * @member {string} servicePartitionKind Polymorphic Discriminator */ constructor() { @@ -53,6 +57,7 @@ class PartitionInformation { servicePartitionKind: { required: true, serializedName: 'ServicePartitionKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/partitionInstanceCountScaleMechanism.js b/lib/services/serviceFabric/lib/models/partitionInstanceCountScaleMechanism.js new file mode 100644 index 0000000000..1cdfeca389 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionInstanceCountScaleMechanism.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a scaling mechanism for adding or removing instances of stateless + * service partition. + * + * @extends models['ScalingMechanismDescription'] + */ +class PartitionInstanceCountScaleMechanism extends models['ScalingMechanismDescription'] { + /** + * Create a PartitionInstanceCountScaleMechanism. + * @member {number} minInstanceCount Minimum number of instances of the + * partition. + * @member {number} maxInstanceCount Maximum number of instances of the + * partition. + * @member {number} scaleIncrement The number of instances to add or remove + * during a scaling operation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionInstanceCountScaleMechanism + * + * @returns {object} metadata of PartitionInstanceCountScaleMechanism + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionInstanceCount', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingMechanismDescription', + className: 'PartitionInstanceCountScaleMechanism', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + minInstanceCount: { + required: true, + serializedName: 'MinInstanceCount', + type: { + name: 'Number' + } + }, + maxInstanceCount: { + required: true, + serializedName: 'MaxInstanceCount', + type: { + name: 'Number' + } + }, + scaleIncrement: { + required: true, + serializedName: 'ScaleIncrement', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = PartitionInstanceCountScaleMechanism; diff --git a/lib/services/serviceFabric/lib/models/partitionLoadInformation.js b/lib/services/serviceFabric/lib/models/partitionLoadInformation.js index 9c8d795c4d..d9c977e618 100644 --- a/lib/services/serviceFabric/lib/models/partitionLoadInformation.js +++ b/lib/services/serviceFabric/lib/models/partitionLoadInformation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents load information for a partition, which contains the primary and * secondary reported load metrics. @@ -19,12 +17,11 @@ const models = require('./index'); * default load for the service of the partition. * For default loads, LoadMetricReport's LastReportedUtc is set to 0. * - * */ class PartitionLoadInformation { /** * Create a PartitionLoadInformation. - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition. * @member {array} [primaryLoadMetricReports] Array of load reports from the * primary replica for this partition. * @member {array} [secondaryLoadMetricReports] Array of aggregated load diff --git a/lib/services/serviceFabric/lib/models/partitionPrimaryMoveAnalysisEvent.js b/lib/services/serviceFabric/lib/models/partitionPrimaryMoveAnalysisEvent.js new file mode 100644 index 0000000000..6677b99a8a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionPrimaryMoveAnalysisEvent.js @@ -0,0 +1,137 @@ +/* + * 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'); + +/** + * Partition Primary Move Analysis event. + * + * @extends models['PartitionAnalysisEvent'] + */ +class PartitionPrimaryMoveAnalysisEvent extends models['PartitionAnalysisEvent'] { + /** + * Create a PartitionPrimaryMoveAnalysisEvent. + * @member {date} whenMoveCompleted Time when the move was completed. + * @member {string} previousNode The name of a Service Fabric node. + * @member {string} currentNode The name of a Service Fabric node. + * @member {string} moveReason Move reason. + * @member {string} relevantTraces Relevant traces. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionPrimaryMoveAnalysisEvent + * + * @returns {object} metadata of PartitionPrimaryMoveAnalysisEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionPrimaryMoveAnalysis', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionPrimaryMoveAnalysisEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + metadata: { + required: true, + serializedName: 'Metadata', + type: { + name: 'Composite', + className: 'AnalysisEventMetadata' + } + }, + whenMoveCompleted: { + required: true, + serializedName: 'WhenMoveCompleted', + type: { + name: 'DateTime' + } + }, + previousNode: { + required: true, + serializedName: 'PreviousNode', + type: { + name: 'String' + } + }, + currentNode: { + required: true, + serializedName: 'CurrentNode', + type: { + name: 'String' + } + }, + moveReason: { + required: true, + serializedName: 'MoveReason', + type: { + name: 'String' + } + }, + relevantTraces: { + required: true, + serializedName: 'RelevantTraces', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PartitionPrimaryMoveAnalysisEvent; diff --git a/lib/services/serviceFabric/lib/models/partitionQuorumLossProgress.js b/lib/services/serviceFabric/lib/models/partitionQuorumLossProgress.js index 691ca77061..4423af06ec 100644 --- a/lib/services/serviceFabric/lib/models/partitionQuorumLossProgress.js +++ b/lib/services/serviceFabric/lib/models/partitionQuorumLossProgress.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a partition quorum loss user-induced operation. * @@ -19,15 +17,25 @@ const models = require('./index'); class PartitionQuorumLossProgress { /** * Create a PartitionQuorumLossProgress. - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [invokeQuorumLossResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [invokeQuorumLossResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [invokeQuorumLossResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [invokeQuorumLossResult.selectedPartition] + * @member {object} [invokeQuorumLossResult.selectedPartition] This class + * returns information about the partition that the user-induced operation + * acted upon. * @member {string} [invokeQuorumLossResult.selectedPartition.serviceName] - * @member {uuid} [invokeQuorumLossResult.selectedPartition.partitionId] + * The name of the service the partition belongs to. + * @member {uuid} [invokeQuorumLossResult.selectedPartition.partitionId] An + * internal ID used by Service Fabric to uniquely identify a partition. This + * is a randomly generated GUID when the service was created. The partition + * ID is unique and does not change for the lifetime of the service. If the + * same service was deleted and recreated the IDs of its partitions would be + * different. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/partitionReconfigurationCompletedEvent.js b/lib/services/serviceFabric/lib/models/partitionReconfigurationCompletedEvent.js new file mode 100644 index 0000000000..8e2a42268b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionReconfigurationCompletedEvent.js @@ -0,0 +1,193 @@ +/* + * 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'); + +/** + * Partition Reconfiguration Completed event. + * + * @extends models['PartitionEvent'] + */ +class PartitionReconfigurationCompletedEvent extends models['PartitionEvent'] { + /** + * Create a PartitionReconfigurationCompletedEvent. + * @member {string} nodeName The name of a Service Fabric node. + * @member {string} nodeInstanceId Id of Node instance. + * @member {string} serviceType Type of Service. + * @member {number} ccEpochDataLossVersion CcEpochDataLoss version. + * @member {number} ccEpochConfigVersion CcEpochConfig version. + * @member {string} reconfigType Type of reconfiguration. + * @member {string} result Describes reconfiguration result. + * @member {number} phase0DurationMs Duration of Phase0 in milli-seconds. + * @member {number} phase1DurationMs Duration of Phase1 in milli-seconds. + * @member {number} phase2DurationMs Duration of Phase2 in milli-seconds. + * @member {number} phase3DurationMs Duration of Phase3 in milli-seconds. + * @member {number} phase4DurationMs Duration of Phase4 in milli-seconds. + * @member {number} totalDurationMs Total duration in milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PartitionReconfigurationCompletedEvent + * + * @returns {object} metadata of PartitionReconfigurationCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionReconfigurationCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionReconfigurationCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + nodeName: { + required: true, + serializedName: 'NodeName', + type: { + name: 'String' + } + }, + nodeInstanceId: { + required: true, + serializedName: 'NodeInstanceId', + type: { + name: 'String' + } + }, + serviceType: { + required: true, + serializedName: 'ServiceType', + type: { + name: 'String' + } + }, + ccEpochDataLossVersion: { + required: true, + serializedName: 'CcEpochDataLossVersion', + type: { + name: 'Number' + } + }, + ccEpochConfigVersion: { + required: true, + serializedName: 'CcEpochConfigVersion', + type: { + name: 'Number' + } + }, + reconfigType: { + required: true, + serializedName: 'ReconfigType', + type: { + name: 'String' + } + }, + result: { + required: true, + serializedName: 'Result', + type: { + name: 'String' + } + }, + phase0DurationMs: { + required: true, + serializedName: 'Phase0DurationMs', + type: { + name: 'Number' + } + }, + phase1DurationMs: { + required: true, + serializedName: 'Phase1DurationMs', + type: { + name: 'Number' + } + }, + phase2DurationMs: { + required: true, + serializedName: 'Phase2DurationMs', + type: { + name: 'Number' + } + }, + phase3DurationMs: { + required: true, + serializedName: 'Phase3DurationMs', + type: { + name: 'Number' + } + }, + phase4DurationMs: { + required: true, + serializedName: 'Phase4DurationMs', + type: { + name: 'Number' + } + }, + totalDurationMs: { + required: true, + serializedName: 'TotalDurationMs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = PartitionReconfigurationCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/partitionRestartProgress.js b/lib/services/serviceFabric/lib/models/partitionRestartProgress.js index 86efad23b1..b0e137bac8 100644 --- a/lib/services/serviceFabric/lib/models/partitionRestartProgress.js +++ b/lib/services/serviceFabric/lib/models/partitionRestartProgress.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a partition restart user-induced operation. * @@ -19,15 +17,25 @@ const models = require('./index'); class PartitionRestartProgress { /** * Create a PartitionRestartProgress. - * @member {string} [state] Possible values include: 'Invalid', 'Running', - * 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled' - * @member {object} [restartPartitionResult] + * @member {string} [state] The state of the operation. Possible values + * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', + * 'Cancelled', 'ForceCancelled' + * @member {object} [restartPartitionResult] Represents information about an + * operation in a terminal state (Completed or Faulted). * @member {number} [restartPartitionResult.errorCode] If OperationState is * Completed, this is 0. If OperationState is Faulted, this is an error code * indicating the reason. - * @member {object} [restartPartitionResult.selectedPartition] + * @member {object} [restartPartitionResult.selectedPartition] This class + * returns information about the partition that the user-induced operation + * acted upon. * @member {string} [restartPartitionResult.selectedPartition.serviceName] - * @member {uuid} [restartPartitionResult.selectedPartition.partitionId] + * The name of the service the partition belongs to. + * @member {uuid} [restartPartitionResult.selectedPartition.partitionId] An + * internal ID used by Service Fabric to uniquely identify a partition. This + * is a randomly generated GUID when the service was created. The partition + * ID is unique and does not change for the lifetime of the service. If the + * same service was deleted and recreated the IDs of its partitions would be + * different. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/partitionSafetyCheck.js b/lib/services/serviceFabric/lib/models/partitionSafetyCheck.js index 4f500893ea..20346af247 100644 --- a/lib/services/serviceFabric/lib/models/partitionSafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/partitionSafetyCheck.js @@ -21,7 +21,8 @@ const models = require('./index'); class PartitionSafetyCheck extends models['SafetyCheck'] { /** * Create a PartitionSafetyCheck. - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition which is undergoing the + * safety check. */ constructor() { super(); @@ -39,11 +40,17 @@ class PartitionSafetyCheck extends models['SafetyCheck'] { serializedName: 'PartitionSafetyCheck', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'PartitionSafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/partitionSchemeDescription.js b/lib/services/serviceFabric/lib/models/partitionSchemeDescription.js index 012b278aad..a4f278c3d0 100644 --- a/lib/services/serviceFabric/lib/models/partitionSchemeDescription.js +++ b/lib/services/serviceFabric/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/serviceFabric/lib/models/partitionsHealthEvaluation.js b/lib/services/serviceFabric/lib/models/partitionsHealthEvaluation.js index 12b1dfa9ed..e2d0c11563 100644 --- a/lib/services/serviceFabric/lib/models/partitionsHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/partitionsHealthEvaluation.js @@ -28,7 +28,9 @@ class PartitionsHealthEvaluation extends models['HealthEvaluation'] { * ServiceTypeHealthPolicy. * @member {number} [totalCount] Total number of partitions of the service * from the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * PartitionHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -46,6 +48,11 @@ class PartitionsHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Partitions', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'PartitionsHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -65,6 +72,7 @@ class PartitionsHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/primaryReplicatorStatus.js b/lib/services/serviceFabric/lib/models/primaryReplicatorStatus.js index 991df58fcf..6d9c0a143e 100644 --- a/lib/services/serviceFabric/lib/models/primaryReplicatorStatus.js +++ b/lib/services/serviceFabric/lib/models/primaryReplicatorStatus.js @@ -13,13 +13,16 @@ const models = require('./index'); /** - * Class representing a PrimaryReplicatorStatus. + * Provides statistics about the Service Fabric Replicator, when it is + * functioning in a Primary role. + * * @extends models['ReplicatorStatus'] */ class PrimaryReplicatorStatus extends models['ReplicatorStatus'] { /** * Create a PrimaryReplicatorStatus. - * @member {object} [replicationQueueStatus] + * @member {object} [replicationQueueStatus] Details about the replication + * queue on the primary replicator. * @member {number} [replicationQueueStatus.queueUtilizationPercentage] * Represents the utilization of the queue. A value of 0 indicates that the * queue is empty and a value of 100 indicates the queue is full. @@ -45,7 +48,8 @@ class PrimaryReplicatorStatus extends models['ReplicatorStatus'] { * @member {string} [replicationQueueStatus.lastSequenceNumber] Represents * the latest sequence number of the operation that is available in the * queue. - * @member {array} [remoteReplicators] + * @member {array} [remoteReplicators] The status of all the active and idle + * secondary replicators that the primary is aware of. */ constructor() { super(); @@ -63,11 +67,17 @@ class PrimaryReplicatorStatus extends models['ReplicatorStatus'] { serializedName: 'Primary', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ReplicatorStatus', className: 'PrimaryReplicatorStatus', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/processDeactivatedEvent.js b/lib/services/serviceFabric/lib/models/processDeactivatedEvent.js new file mode 100644 index 0000000000..f1da294ad5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/processDeactivatedEvent.js @@ -0,0 +1,187 @@ +/* + * 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'); + +/** + * Process Deactivated event. + * + * @extends models['ApplicationEvent'] + */ +class ProcessDeactivatedEvent extends models['ApplicationEvent'] { + /** + * Create a ProcessDeactivatedEvent. + * @member {string} serviceName Name of Service. + * @member {string} servicePackageName Name of Service package. + * @member {string} servicePackageActivationId Activation Id of Service + * package. + * @member {boolean} isExclusive Indicates IsExclusive flag. + * @member {string} codePackageName Name of Code package. + * @member {string} entryPointType Type of EntryPoint. + * @member {string} exeName Name of executable. + * @member {number} processId Process Id. + * @member {string} hostId Host Id. + * @member {number} exitCode Exit code of process. + * @member {boolean} unexpectedTermination Indicates if termination is + * unexpected. + * @member {date} startTime Start time of process. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProcessDeactivatedEvent + * + * @returns {object} metadata of ProcessDeactivatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ProcessDeactivated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ProcessDeactivatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'ApplicationId', + type: { + name: 'String' + } + }, + serviceName: { + required: true, + serializedName: 'ServiceName', + type: { + name: 'String' + } + }, + servicePackageName: { + required: true, + serializedName: 'ServicePackageName', + type: { + name: 'String' + } + }, + servicePackageActivationId: { + required: true, + serializedName: 'ServicePackageActivationId', + type: { + name: 'String' + } + }, + isExclusive: { + required: true, + serializedName: 'IsExclusive', + type: { + name: 'Boolean' + } + }, + codePackageName: { + required: true, + serializedName: 'CodePackageName', + type: { + name: 'String' + } + }, + entryPointType: { + required: true, + serializedName: 'EntryPointType', + type: { + name: 'String' + } + }, + exeName: { + required: true, + serializedName: 'ExeName', + type: { + name: 'String' + } + }, + processId: { + required: true, + serializedName: 'ProcessId', + type: { + name: 'Number' + } + }, + hostId: { + required: true, + serializedName: 'HostId', + type: { + name: 'String' + } + }, + exitCode: { + required: true, + serializedName: 'ExitCode', + type: { + name: 'Number' + } + }, + unexpectedTermination: { + required: true, + serializedName: 'UnexpectedTermination', + type: { + name: 'Boolean' + } + }, + startTime: { + required: true, + serializedName: 'StartTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ProcessDeactivatedEvent; diff --git a/lib/services/serviceFabric/lib/models/propertyBatchDescriptionList.js b/lib/services/serviceFabric/lib/models/propertyBatchDescriptionList.js new file mode 100644 index 0000000000..ec661e93bd --- /dev/null +++ b/lib/services/serviceFabric/lib/models/propertyBatchDescriptionList.js @@ -0,0 +1,67 @@ +/* + * 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 a list of property batch operations to be executed. Either all or + * none of the operations will be committed. + * + */ +class PropertyBatchDescriptionList { + /** + * Create a PropertyBatchDescriptionList. + * @member {array} [operations] A list of the property batch operations to be + * executed. + */ + constructor() { + } + + /** + * Defines the metadata of PropertyBatchDescriptionList + * + * @returns {object} metadata of PropertyBatchDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PropertyBatchDescriptionList', + type: { + name: 'Composite', + className: 'PropertyBatchDescriptionList', + modelProperties: { + operations: { + required: false, + serializedName: 'Operations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PropertyBatchOperationElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'PropertyBatchOperation' + } + } + } + } + } + } + }; + } +} + +module.exports = PropertyBatchDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/propertyBatchInfo.js b/lib/services/serviceFabric/lib/models/propertyBatchInfo.js new file mode 100644 index 0000000000..47501112ff --- /dev/null +++ b/lib/services/serviceFabric/lib/models/propertyBatchInfo.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Information about the results of a property batch. + * + */ +class PropertyBatchInfo { + /** + * Create a PropertyBatchInfo. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of PropertyBatchInfo + * + * @returns {object} metadata of PropertyBatchInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'PropertyBatchInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchInfo', + className: 'PropertyBatchInfo', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PropertyBatchInfo; diff --git a/lib/services/serviceFabric/lib/models/propertyBatchOperation.js b/lib/services/serviceFabric/lib/models/propertyBatchOperation.js new file mode 100644 index 0000000000..f10f324ecc --- /dev/null +++ b/lib/services/serviceFabric/lib/models/propertyBatchOperation.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Represents the base type for property operations that can be put into a + * batch and submitted. + * + */ +class PropertyBatchOperation { + /** + * Create a PropertyBatchOperation. + * @member {string} propertyName The name of the Service Fabric property. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of PropertyBatchOperation + * + * @returns {object} metadata of PropertyBatchOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'PropertyBatchOperation', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'PropertyBatchOperation', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PropertyBatchOperation; diff --git a/lib/services/serviceFabric/lib/models/propertyDescription.js b/lib/services/serviceFabric/lib/models/propertyDescription.js new file mode 100644 index 0000000000..f6f9a6bda7 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/propertyDescription.js @@ -0,0 +1,76 @@ +/* + * 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'; + +/** + * Description of a Service Fabric property. + * + */ +class PropertyDescription { + /** + * Create a PropertyDescription. + * @member {string} propertyName The name of the Service Fabric property. + * @member {string} [customTypeId] The property's custom type ID. Using this + * property, the user is able to tag the type of the value of the property. + * @member {object} value Describes a Service Fabric property value. + * @member {string} [value.kind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of PropertyDescription + * + * @returns {object} metadata of PropertyDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'PropertyDescription', + type: { + name: 'Composite', + className: 'PropertyDescription', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + customTypeId: { + required: false, + serializedName: 'CustomTypeId', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'Value', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'PropertyValue' + } + } + } + } + }; + } +} + +module.exports = PropertyDescription; diff --git a/lib/services/serviceFabric/lib/models/propertyInfo.js b/lib/services/serviceFabric/lib/models/propertyInfo.js new file mode 100644 index 0000000000..d1474beb1f --- /dev/null +++ b/lib/services/serviceFabric/lib/models/propertyInfo.js @@ -0,0 +1,91 @@ +/* + * 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'; + +/** + * Information about a Service Fabric property. + * + */ +class PropertyInfo { + /** + * Create a PropertyInfo. + * @member {string} name The name of the Service Fabric property. + * @member {object} [value] Describes a Service Fabric property value. + * @member {string} [value.kind] Polymorphic Discriminator + * @member {object} metadata The metadata associated with a property, + * including the property's name. + * @member {string} [metadata.typeId] The kind of property, determined by the + * type of data. Following are the possible values. Possible values include: + * 'Invalid', 'Binary', 'Int64', 'Double', 'String', 'Guid' + * @member {string} [metadata.customTypeId] The property's custom type ID. + * @member {string} [metadata.parent] The name of the parent Service Fabric + * Name for the property. It could be thought of as the name-space/table + * under which the property exists. + * @member {number} [metadata.sizeInBytes] The length of the serialized + * property value. + * @member {date} [metadata.lastModifiedUtcTimestamp] Represents when the + * Property was last modified. Only write operations will cause this field to + * be updated. + * @member {string} [metadata.sequenceNumber] The version of the property. + * Every time a property is modified, its sequence number is increased. + */ + constructor() { + } + + /** + * Defines the metadata of PropertyInfo + * + * @returns {object} metadata of PropertyInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'PropertyInfo', + type: { + name: 'Composite', + className: 'PropertyInfo', + modelProperties: { + name: { + required: true, + serializedName: 'Name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'Value', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'PropertyValue' + } + }, + metadata: { + required: true, + serializedName: 'Metadata', + type: { + name: 'Composite', + className: 'PropertyMetadata' + } + } + } + } + }; + } +} + +module.exports = PropertyInfo; diff --git a/lib/services/serviceFabric/lib/models/propertyMetadata.js b/lib/services/serviceFabric/lib/models/propertyMetadata.js new file mode 100644 index 0000000000..2e4d6fdcb0 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/propertyMetadata.js @@ -0,0 +1,99 @@ +/* + * 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 metadata associated with a property, including the property's name. + * + */ +class PropertyMetadata { + /** + * Create a PropertyMetadata. + * @member {string} [typeId] The kind of property, determined by the type of + * data. Following are the possible values. Possible values include: + * 'Invalid', 'Binary', 'Int64', 'Double', 'String', 'Guid' + * @member {string} [customTypeId] The property's custom type ID. + * @member {string} [parent] The name of the parent Service Fabric Name for + * the property. It could be thought of as the name-space/table under which + * the property exists. + * @member {number} [sizeInBytes] The length of the serialized property + * value. + * @member {date} [lastModifiedUtcTimestamp] Represents when the Property was + * last modified. Only write operations will cause this field to be updated. + * @member {string} [sequenceNumber] The version of the property. Every time + * a property is modified, its sequence number is increased. + */ + constructor() { + } + + /** + * Defines the metadata of PropertyMetadata + * + * @returns {object} metadata of PropertyMetadata + * + */ + mapper() { + return { + required: false, + serializedName: 'PropertyMetadata', + type: { + name: 'Composite', + className: 'PropertyMetadata', + modelProperties: { + typeId: { + required: false, + serializedName: 'TypeId', + type: { + name: 'String' + } + }, + customTypeId: { + required: false, + serializedName: 'CustomTypeId', + type: { + name: 'String' + } + }, + parent: { + required: false, + serializedName: 'Parent', + type: { + name: 'String' + } + }, + sizeInBytes: { + required: false, + serializedName: 'SizeInBytes', + type: { + name: 'Number' + } + }, + lastModifiedUtcTimestamp: { + required: false, + serializedName: 'LastModifiedUtcTimestamp', + type: { + name: 'DateTime' + } + }, + sequenceNumber: { + required: false, + serializedName: 'SequenceNumber', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PropertyMetadata; diff --git a/lib/services/serviceFabric/lib/models/propertyValue.js b/lib/services/serviceFabric/lib/models/propertyValue.js new file mode 100644 index 0000000000..1586928290 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/propertyValue.js @@ -0,0 +1,58 @@ +/* + * 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 a Service Fabric property value. + * + */ +class PropertyValue { + /** + * Create a PropertyValue. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of PropertyValue + * + * @returns {object} metadata of PropertyValue + * + */ + mapper() { + return { + required: false, + serializedName: 'PropertyValue', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'PropertyValue', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PropertyValue; diff --git a/lib/services/serviceFabric/lib/models/provisionApplicationTypeDescription.js b/lib/services/serviceFabric/lib/models/provisionApplicationTypeDescription.js new file mode 100644 index 0000000000..954ec3fd92 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/provisionApplicationTypeDescription.js @@ -0,0 +1,90 @@ +/* + * 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 the operation to register or provision an application type using + * an application package uploaded to the Service Fabric image store. + * + * @extends models['ProvisionApplicationTypeDescriptionBase'] + */ +class ProvisionApplicationTypeDescription extends models['ProvisionApplicationTypeDescriptionBase'] { + /** + * Create a ProvisionApplicationTypeDescription. + * @member {string} applicationTypeBuildPath The relative path for the + * application package in the image store specified during the prior upload + * operation. + * @member {string} [applicationPackageCleanupPolicy] The kind of action that + * needs to be taken for cleaning up the application package after successful + * provision. Possible values include: 'Invalid', 'Default', 'Automatic', + * 'Manual' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProvisionApplicationTypeDescription + * + * @returns {object} metadata of ProvisionApplicationTypeDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageStorePath', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ProvisionApplicationTypeDescriptionBase', + className: 'ProvisionApplicationTypeDescription', + modelProperties: { + async: { + required: true, + serializedName: 'Async', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + applicationTypeBuildPath: { + required: true, + serializedName: 'ApplicationTypeBuildPath', + type: { + name: 'String' + } + }, + applicationPackageCleanupPolicy: { + required: false, + serializedName: 'ApplicationPackageCleanupPolicy', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProvisionApplicationTypeDescription; diff --git a/lib/services/serviceFabric/lib/models/provisionApplicationTypeDescriptionBase.js b/lib/services/serviceFabric/lib/models/provisionApplicationTypeDescriptionBase.js new file mode 100644 index 0000000000..073aba7f7c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/provisionApplicationTypeDescriptionBase.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Represents the type of registration or provision requested, and if the + * operation needs to be asynchronous or not. Supported types of provision + * operations are from either image store or external store. + * + */ +class ProvisionApplicationTypeDescriptionBase { + /** + * Create a ProvisionApplicationTypeDescriptionBase. + * @member {boolean} async Indicates whether or not provisioning should occur + * asynchronously. When set to true, the provision operation returns when the + * request is accepted by the system, and the provision operation continues + * without any timeout limit. The default value is false. For large + * application packages, we recommend setting the value to true. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ProvisionApplicationTypeDescriptionBase + * + * @returns {object} metadata of ProvisionApplicationTypeDescriptionBase + * + */ + mapper() { + return { + required: false, + serializedName: 'ProvisionApplicationTypeDescriptionBase', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ProvisionApplicationTypeDescriptionBase', + className: 'ProvisionApplicationTypeDescriptionBase', + modelProperties: { + async: { + required: true, + serializedName: 'Async', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProvisionApplicationTypeDescriptionBase; diff --git a/lib/services/serviceFabric/lib/models/putPropertyBatchOperation.js b/lib/services/serviceFabric/lib/models/putPropertyBatchOperation.js new file mode 100644 index 0000000000..cd72f42392 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/putPropertyBatchOperation.js @@ -0,0 +1,94 @@ +/* + * 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'); + +/** + * Puts the specified property under the specified name. + * Note that if one PropertyBatchOperation in a PropertyBatch fails, + * the entire batch fails and cannot be committed in a transactional manner. + * + * @extends models['PropertyBatchOperation'] + */ +class PutPropertyBatchOperation extends models['PropertyBatchOperation'] { + /** + * Create a PutPropertyBatchOperation. + * @member {object} value Describes a Service Fabric property value. + * @member {string} [value.kind] Polymorphic Discriminator + * @member {string} [customTypeId] The property's custom type ID. Using this + * property, the user is able to tag the type of the value of the property. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PutPropertyBatchOperation + * + * @returns {object} metadata of PutPropertyBatchOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'Put', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchOperation', + className: 'PutPropertyBatchOperation', + modelProperties: { + propertyName: { + required: true, + serializedName: 'PropertyName', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'Value', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'PropertyValue' + } + }, + customTypeId: { + required: false, + serializedName: 'CustomTypeId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PutPropertyBatchOperation; diff --git a/lib/services/serviceFabric/lib/models/reconfigurationInformation.js b/lib/services/serviceFabric/lib/models/reconfigurationInformation.js index 64cf45b7f8..be89980076 100644 --- a/lib/services/serviceFabric/lib/models/reconfigurationInformation.js +++ b/lib/services/serviceFabric/lib/models/reconfigurationInformation.js @@ -18,13 +18,17 @@ class ReconfigurationInformation { /** * Create a ReconfigurationInformation. - * @member {string} [previousConfigurationRole] Possible values include: - * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' - * @member {string} [reconfigurationPhase] Possible values include: - * 'Unknown', 'None', 'Phase0', 'Phase1', 'Phase2', 'Phase3', 'Phase4', - * 'AbortPhaseZero' - * @member {string} [reconfigurationType] Possible values include: 'Unknown', - * 'SwapPrimary', 'Failover', 'Other' + * @member {string} [previousConfigurationRole] Replica role before + * reconfiguration started. Possible values include: 'Unknown', 'None', + * 'Primary', 'IdleSecondary', 'ActiveSecondary' + * @member {string} [reconfigurationPhase] Current phase of ongoing + * reconfiguration. If no reconfiguration is taking place then this value + * will be "None". Possible values include: 'Unknown', 'None', 'Phase0', + * 'Phase1', 'Phase2', 'Phase3', 'Phase4', 'AbortPhaseZero' + * @member {string} [reconfigurationType] Type of current ongoing + * reconfiguration. If no reconfiguration is taking place then this value + * will be "None". Possible values include: 'Unknown', 'SwapPrimary', + * 'Failover', 'Other' * @member {date} [reconfigurationStartTimeUtc] Start time (in UTC) of the * ongoing reconfiguration. If no reconfiguration is taking place then this * value will be zero date-time. diff --git a/lib/services/serviceFabric/lib/models/remoteReplicatorAcknowledgementStatus.js b/lib/services/serviceFabric/lib/models/remoteReplicatorAcknowledgementStatus.js index 46f78ab28f..6ad29b0e35 100644 --- a/lib/services/serviceFabric/lib/models/remoteReplicatorAcknowledgementStatus.js +++ b/lib/services/serviceFabric/lib/models/remoteReplicatorAcknowledgementStatus.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Provides details about the remote replicators from the primary replicator's * point of view. @@ -20,7 +18,9 @@ const models = require('./index'); class RemoteReplicatorAcknowledgementStatus { /** * Create a RemoteReplicatorAcknowledgementStatus. - * @member {object} [replicationStreamAcknowledgementDetail] + * @member {object} [replicationStreamAcknowledgementDetail] Details about + * the acknowledgements for operations that are part of the replication + * stream data. * @member {string} * [replicationStreamAcknowledgementDetail.averageReceiveDuration] Represents * the average duration it takes for the remote replicator to receive an @@ -36,7 +36,8 @@ class RemoteReplicatorAcknowledgementStatus { * [replicationStreamAcknowledgementDetail.receivedAndNotAppliedCount] * Represents the number of operations received and not yet applied by a * remote replicator. - * @member {object} [copyStreamAcknowledgementDetail] + * @member {object} [copyStreamAcknowledgementDetail] Details about the + * acknowledgements for operations that are part of the copy stream data. * @member {string} [copyStreamAcknowledgementDetail.averageReceiveDuration] * Represents the average duration it takes for the remote replicator to * receive an operation. diff --git a/lib/services/serviceFabric/lib/models/remoteReplicatorStatus.js b/lib/services/serviceFabric/lib/models/remoteReplicatorStatus.js index 22edbb0d35..524a6b5753 100644 --- a/lib/services/serviceFabric/lib/models/remoteReplicatorStatus.js +++ b/lib/services/serviceFabric/lib/models/remoteReplicatorStatus.js @@ -10,18 +10,16 @@ 'use strict'; -const models = require('./index'); - /** * Represents the state of the secondary replicator from the primary * replicator’s point of view. * - * */ class RemoteReplicatorStatus { /** * Create a RemoteReplicatorStatus. - * @member {string} [replicaId] + * @member {string} [replicaId] Represents the replica ID of the remote + * secondary replicator. * @member {date} [lastAcknowledgementProcessedTimeUtc] The last timestamp * (in UTC) when an acknowledgement from the secondary replicator was * processed on the primary. @@ -43,9 +41,12 @@ class RemoteReplicatorStatus { * operation sequence number that the secondary has applied to its state. * A value of -1 implies that the secondary has applied all copy operations * and the copy process is complete. - * @member {object} [remoteReplicatorAcknowledgementStatus] + * @member {object} [remoteReplicatorAcknowledgementStatus] Represents the + * acknowledgment status for the remote secondary replicator. * @member {object} * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail] + * Details about the acknowledgements for operations that are part of the + * replication stream data. * @member {string} * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.averageReceiveDuration] * Represents the average duration it takes for the remote replicator to @@ -64,6 +65,8 @@ class RemoteReplicatorStatus { * remote replicator. * @member {object} * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail] + * Details about the acknowledgements for operations that are part of the + * copy stream data. * @member {string} * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.averageReceiveDuration] * Represents the average duration it takes for the remote replicator to diff --git a/lib/services/serviceFabric/lib/models/repairImpactDescriptionBase.js b/lib/services/serviceFabric/lib/models/repairImpactDescriptionBase.js index d7bc20dc2f..8a61e6592a 100644 --- a/lib/services/serviceFabric/lib/models/repairImpactDescriptionBase.js +++ b/lib/services/serviceFabric/lib/models/repairImpactDescriptionBase.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairImpactDescriptionBase { /** @@ -48,6 +47,7 @@ class RepairImpactDescriptionBase { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/repairTargetDescriptionBase.js b/lib/services/serviceFabric/lib/models/repairTargetDescriptionBase.js index 48f404230a..da73a43f75 100644 --- a/lib/services/serviceFabric/lib/models/repairTargetDescriptionBase.js +++ b/lib/services/serviceFabric/lib/models/repairTargetDescriptionBase.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTargetDescriptionBase { /** @@ -48,6 +47,7 @@ class RepairTargetDescriptionBase { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/repairTask.js b/lib/services/serviceFabric/lib/models/repairTask.js index 65c7545442..64d5320ee4 100644 --- a/lib/services/serviceFabric/lib/models/repairTask.js +++ b/lib/services/serviceFabric/lib/models/repairTask.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents a repair task, which includes information about what kind of * repair was requested, what its progress is, and what its final result was. @@ -19,7 +17,6 @@ const models = require('./index'); * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTask { /** @@ -37,25 +34,9 @@ class RepairTask { * task, or other informational details. * May be set when the repair task is created, and is immutable once set. * @member {string} state The workflow state of the repair task. Valid - * initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the - * Repair Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' * @member {number} [flags] A bitwise-OR of the following values, which gives * additional details about the status of the repair task. * - 1 - Cancellation of the repair has been requested @@ -63,34 +44,25 @@ class RepairTask { * - 4 - Approval of the repair was forced via client request * @member {string} action The requested repair action. Must be specified * when the repair task is created, and is immutable once set. - * @member {object} [target] + * @member {object} [target] The target object determines what actions the + * system will take to prepare for the impact of the repair, prior to + * approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. * @member {string} [target.kind] Polymorphic Discriminator * @member {string} [executor] The name of the repair executor. Must be * specified in Claimed and later states, and is immutable once set. * @member {string} [executorData] A data string that the repair executor can * use to store its internal state. - * @member {object} [impact] + * @member {object} [impact] The impact object determines what actions the + * system will take to prepare for the impact of the repair, prior to + * approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. * @member {string} [impact.kind] Polymorphic Discriminator * @member {string} [resultStatus] A value describing the overall result of - * the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was - * interrupted by a cancellation request after some work had already been - * performed. - * - Failed - Indicates that there was a failure during execution of the - * repair task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * the repair task execution. Must be specified in the Restoring and later + * states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' * @member {number} [resultCode] A numeric value providing additional details * about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once @@ -99,7 +71,10 @@ class RepairTask { * about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. - * @member {object} [history] + * @member {object} [history] An object that contains timestamps of the + * repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly + * modified. * @member {date} [history.createdUtcTimestamp] The time when the repair task * entered the Created state. * @member {date} [history.claimedUtcTimestamp] The time when the repair task @@ -122,10 +97,14 @@ class RepairTask { * when the repair task started the health check in the Restoring state. * @member {date} [history.restoringHealthCheckEndUtcTimestamp] The time when * the repair task completed the health check in the Restoring state. - * @member {string} [preparingHealthCheckState] Possible values include: - * 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' - * @member {string} [restoringHealthCheckState] Possible values include: - * 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @member {string} [preparingHealthCheckState] The workflow state of the + * health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * @member {string} [restoringHealthCheckState] The workflow state of the + * health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * @member {boolean} [performPreparingHealthCheck] A value to determine if * health checks will be performed when the repair task enters the Preparing * state. diff --git a/lib/services/serviceFabric/lib/models/repairTaskApproveDescription.js b/lib/services/serviceFabric/lib/models/repairTaskApproveDescription.js index 2796ee16f9..7ae39ef59e 100644 --- a/lib/services/serviceFabric/lib/models/repairTaskApproveDescription.js +++ b/lib/services/serviceFabric/lib/models/repairTaskApproveDescription.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTaskApproveDescription { /** @@ -25,7 +24,7 @@ class RepairTaskApproveDescription { * @member {string} [version] The current version number of the repair task. * If non-zero, then the request will only succeed if this value matches the * actual current version of the repair task. If zero, then no version check - * is performed. + * is performed. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/repairTaskCancelDescription.js b/lib/services/serviceFabric/lib/models/repairTaskCancelDescription.js index 828d4bb7c6..e4b4d9f368 100644 --- a/lib/services/serviceFabric/lib/models/repairTaskCancelDescription.js +++ b/lib/services/serviceFabric/lib/models/repairTaskCancelDescription.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTaskCancelDescription { /** @@ -25,10 +24,10 @@ class RepairTaskCancelDescription { * @member {string} [version] The current version number of the repair task. * If non-zero, then the request will only succeed if this value matches the * actual current version of the repair task. If zero, then no version check - * is performed. + * is performed. * @member {boolean} [requestAbort] _True_ if the repair should be stopped as * soon as possible even if it has already started executing. _False_ if the - * repair should be cancelled only if execution has not yet started. + * repair should be cancelled only if execution has not yet started. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/repairTaskDeleteDescription.js b/lib/services/serviceFabric/lib/models/repairTaskDeleteDescription.js index 6f58323d14..b866081185 100644 --- a/lib/services/serviceFabric/lib/models/repairTaskDeleteDescription.js +++ b/lib/services/serviceFabric/lib/models/repairTaskDeleteDescription.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTaskDeleteDescription { /** diff --git a/lib/services/serviceFabric/lib/models/repairTaskHistory.js b/lib/services/serviceFabric/lib/models/repairTaskHistory.js index 10f65b3b93..ab6c94deab 100644 --- a/lib/services/serviceFabric/lib/models/repairTaskHistory.js +++ b/lib/services/serviceFabric/lib/models/repairTaskHistory.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTaskHistory { /** diff --git a/lib/services/serviceFabric/lib/models/repairTaskUpdateHealthPolicyDescription.js b/lib/services/serviceFabric/lib/models/repairTaskUpdateHealthPolicyDescription.js index 32fdf64e03..3207f74682 100644 --- a/lib/services/serviceFabric/lib/models/repairTaskUpdateHealthPolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/repairTaskUpdateHealthPolicyDescription.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTaskUpdateHealthPolicyDescription { /** diff --git a/lib/services/serviceFabric/lib/models/repairTaskUpdateInfo.js b/lib/services/serviceFabric/lib/models/repairTaskUpdateInfo.js index 021657e52b..5e9ef9003f 100644 --- a/lib/services/serviceFabric/lib/models/repairTaskUpdateInfo.js +++ b/lib/services/serviceFabric/lib/models/repairTaskUpdateInfo.js @@ -16,7 +16,6 @@ * This type supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * */ class RepairTaskUpdateInfo { /** diff --git a/lib/services/serviceFabric/lib/models/replicaEvent.js b/lib/services/serviceFabric/lib/models/replicaEvent.js new file mode 100644 index 0000000000..5dddbddf1f --- /dev/null +++ b/lib/services/serviceFabric/lib/models/replicaEvent.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Replica Events. + * + * @extends models['FabricEvent'] + */ +class ReplicaEvent extends models['FabricEvent'] { + /** + * Create a ReplicaEvent. + * @member {uuid} partitionId An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. + * @member {number} replicaId Id of a stateful service replica. ReplicaId is + * used by Service Fabric to uniquely identify a replica of a partition. It + * is unique within a partition and does not change for the lifetime of the + * replica. If a replica gets dropped and another replica gets created on the + * same node for the same partition, it will get a different value for the + * id. Sometimes the id of a stateless service instance is also referred as a + * replica id. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ReplicaEvent + * + * @returns {object} metadata of ReplicaEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ReplicaEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ReplicaEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ReplicaEvent; diff --git a/lib/services/serviceFabric/lib/models/replicaHealth.js b/lib/services/serviceFabric/lib/models/replicaHealth.js index 0eed573e57..cbc370fed4 100644 --- a/lib/services/serviceFabric/lib/models/replicaHealth.js +++ b/lib/services/serviceFabric/lib/models/replicaHealth.js @@ -18,13 +18,13 @@ const models = require('./index'); * Contains the replica aggregated health state, the health events and the * unhealthy evaluations. * - * * @extends models['EntityHealth'] */ class ReplicaHealth extends models['EntityHealth'] { /** * Create a ReplicaHealth. - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] Id of the partition to which this replica + * belongs. * @member {string} serviceKind Polymorphic Discriminator */ constructor() { @@ -105,6 +105,7 @@ class ReplicaHealth extends models['EntityHealth'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/replicaHealthEvaluation.js b/lib/services/serviceFabric/lib/models/replicaHealthEvaluation.js index 399caee136..c9a03ef5b3 100644 --- a/lib/services/serviceFabric/lib/models/replicaHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/replicaHealthEvaluation.js @@ -23,9 +23,21 @@ const models = require('./index'); class ReplicaHealthEvaluation extends models['HealthEvaluation'] { /** * Create a ReplicaHealthEvaluation. - * @member {uuid} [partitionId] - * @member {string} [replicaOrInstanceId] - * @member {array} [unhealthyEvaluations] + * @member {uuid} [partitionId] Id of the partition to which the replica + * belongs. + * @member {string} [replicaOrInstanceId] Id of a stateful service replica or + * a stateless service instance. This ID is used in the queries that apply to + * both stateful and stateless services. It is used by Service Fabric to + * uniquely identify a replica of a partition of a stateful service or an + * instance of a stateless service partition. It is unique within a partition + * and does not change for the lifetime of the replica or the instance. If a + * stateful replica gets dropped and another replica gets created on the same + * node for the same partition, it will get a different value for the ID. If + * a stateless instance is failed over on the same or different node it will + * get a different value for the ID. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the replica. The types of + * the unhealthy evaluations can be EventHealthEvaluation. */ constructor() { super(); @@ -43,6 +55,11 @@ class ReplicaHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Replica', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'ReplicaHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -62,6 +79,7 @@ class ReplicaHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/replicaHealthState.js b/lib/services/serviceFabric/lib/models/replicaHealthState.js index f1453fed8d..e2170c9665 100644 --- a/lib/services/serviceFabric/lib/models/replicaHealthState.js +++ b/lib/services/serviceFabric/lib/models/replicaHealthState.js @@ -21,7 +21,8 @@ const models = require('./index'); class ReplicaHealthState extends models['EntityHealthState'] { /** * Create a ReplicaHealthState. - * @member {uuid} [partitionId] + * @member {uuid} [partitionId] The ID of the partition to which this replica + * belongs. * @member {string} serviceKind Polymorphic Discriminator */ constructor() { @@ -64,6 +65,7 @@ class ReplicaHealthState extends models['EntityHealthState'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/replicaHealthStateChunk.js b/lib/services/serviceFabric/lib/models/replicaHealthStateChunk.js index e6b6c60f28..ccf310ebde 100644 --- a/lib/services/serviceFabric/lib/models/replicaHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/replicaHealthStateChunk.js @@ -18,13 +18,21 @@ const models = require('./index'); * The replica health state contains the replica ID and its aggregated health * state. * - * * @extends models['EntityHealthStateChunk'] */ class ReplicaHealthStateChunk extends models['EntityHealthStateChunk'] { /** * Create a ReplicaHealthStateChunk. - * @member {string} [replicaOrInstanceId] + * @member {string} [replicaOrInstanceId] Id of a stateful service replica or + * a stateless service instance. This ID is used in the queries that apply to + * both stateful and stateless services. It is used by Service Fabric to + * uniquely identify a replica of a partition of a stateful service or an + * instance of a stateless service partition. It is unique within a partition + * and does not change for the lifetime of the replica or the instance. If a + * stateful replica gets dropped and another replica gets created on the same + * node for the same partition, it will get a different value for the ID. If + * a stateless instance is failed over on the same or different node it will + * get a different value for the ID. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/replicaHealthStateChunkList.js b/lib/services/serviceFabric/lib/models/replicaHealthStateChunkList.js index d4709db8ee..3b23162ba3 100644 --- a/lib/services/serviceFabric/lib/models/replicaHealthStateChunkList.js +++ b/lib/services/serviceFabric/lib/models/replicaHealthStateChunkList.js @@ -10,13 +10,10 @@ 'use strict'; -const models = require('./index'); - /** * The list of replica health state chunks that respect the input filters in * the chunk query. Returned by get cluster health state chunks query. * - * */ class ReplicaHealthStateChunkList { /** diff --git a/lib/services/serviceFabric/lib/models/replicaHealthStateFilter.js b/lib/services/serviceFabric/lib/models/replicaHealthStateFilter.js index 087e3ae4a2..9a2d4f246a 100644 --- a/lib/services/serviceFabric/lib/models/replicaHealthStateFilter.js +++ b/lib/services/serviceFabric/lib/models/replicaHealthStateFilter.js @@ -20,13 +20,12 @@ * One filter can match zero, one or multiple replicas, depending on its * properties. * - * */ class ReplicaHealthStateFilter { /** * Create a ReplicaHealthStateFilter. * @member {string} [replicaOrInstanceIdFilter] Id of the stateful service - * replica or stateles service instance that matches the filter. The filter + * replica or stateless service instance that matches the filter. The filter * is applied only to the specified replica, if it exists. * If the replica doesn't exist, no replica is returned in the cluster health * chunk based on this filter. @@ -41,10 +40,10 @@ class ReplicaHealthStateFilter { * The possible values are integer value of one of the following health * states. Only replicas that match the filter are returned. All replicas are * used to evaluate the parent partition aggregated health state. - * If not specified, default value is None, unless the replica id is - * specified. If the filter has default value and replica id is specified, + * If not specified, default value is None, unless the replica ID is + * specified. If the filter has default value and replica ID is specified, * the matching replica is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches replicas with * HealthState value of OK (2) and Warning (4). @@ -59,8 +58,7 @@ class ReplicaHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The * value is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/replicaInfo.js b/lib/services/serviceFabric/lib/models/replicaInfo.js index ad9a3095a6..2d15886ec9 100644 --- a/lib/services/serviceFabric/lib/models/replicaInfo.js +++ b/lib/services/serviceFabric/lib/models/replicaInfo.js @@ -18,11 +18,13 @@ class ReplicaInfo { /** * Create a ReplicaInfo. - * @member {string} [replicaStatus] Possible values include: 'Invalid', - * 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped' - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [nodeName] + * @member {string} [replicaStatus] The status of a replica of a service. + * Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', + * 'Dropped' + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [nodeName] The name of a Service Fabric node. * @member {string} [address] The address the replica is listening on. * @member {string} [lastInBuildDurationInSeconds] The last in build duration * of the replica in seconds. @@ -88,6 +90,7 @@ class ReplicaInfo { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/replicaStatusBase.js b/lib/services/serviceFabric/lib/models/replicaStatusBase.js index 409e39e292..460ab23827 100644 --- a/lib/services/serviceFabric/lib/models/replicaStatusBase.js +++ b/lib/services/serviceFabric/lib/models/replicaStatusBase.js @@ -44,6 +44,7 @@ class ReplicaStatusBase { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/replicasHealthEvaluation.js b/lib/services/serviceFabric/lib/models/replicasHealthEvaluation.js index 6c2e4b77a7..8f674dc452 100644 --- a/lib/services/serviceFabric/lib/models/replicasHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/replicasHealthEvaluation.js @@ -28,7 +28,9 @@ class ReplicasHealthEvaluation extends models['HealthEvaluation'] { * ApplicationHealthPolicy. * @member {number} [totalCount] Total number of replicas in the partition * from the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ReplicaHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -46,6 +48,11 @@ class ReplicasHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Replicas', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'ReplicasHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -65,6 +72,7 @@ class ReplicasHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/replicatorQueueStatus.js b/lib/services/serviceFabric/lib/models/replicatorQueueStatus.js index 978ca5769f..2ffc88b6ed 100644 --- a/lib/services/serviceFabric/lib/models/replicatorQueueStatus.js +++ b/lib/services/serviceFabric/lib/models/replicatorQueueStatus.js @@ -19,7 +19,6 @@ * Depending on the role of the replicator, the properties in this type imply * different meanings. * - * */ class ReplicatorQueueStatus { /** diff --git a/lib/services/serviceFabric/lib/models/replicatorStatus.js b/lib/services/serviceFabric/lib/models/replicatorStatus.js index 1c3383da58..db865f2722 100644 --- a/lib/services/serviceFabric/lib/models/replicatorStatus.js +++ b/lib/services/serviceFabric/lib/models/replicatorStatus.js @@ -16,7 +16,6 @@ * replication/copy queue utilization, last acknowledgement received timestamp, * etc. * - * */ class ReplicatorStatus { /** @@ -48,6 +47,7 @@ class ReplicatorStatus { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/resolvedServiceEndpoint.js b/lib/services/serviceFabric/lib/models/resolvedServiceEndpoint.js index f744befead..d3aa347121 100644 --- a/lib/services/serviceFabric/lib/models/resolvedServiceEndpoint.js +++ b/lib/services/serviceFabric/lib/models/resolvedServiceEndpoint.js @@ -17,7 +17,8 @@ class ResolvedServiceEndpoint { /** * Create a ResolvedServiceEndpoint. - * @member {string} [kind] Possible values include: 'Invalid', 'Stateless', + * @member {string} [kind] The role of the replica where the endpoint is + * reported. Possible values include: 'Invalid', 'Stateless', * 'StatefulPrimary', 'StatefulSecondary' * @member {string} [address] The address of the endpoint. If the endpoint * has multiple listeners the address is a JSON object with one property per diff --git a/lib/services/serviceFabric/lib/models/resolvedServicePartition.js b/lib/services/serviceFabric/lib/models/resolvedServicePartition.js index 1fda991eee..d85c1ad1a7 100644 --- a/lib/services/serviceFabric/lib/models/resolvedServicePartition.js +++ b/lib/services/serviceFabric/lib/models/resolvedServicePartition.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a service partition and its associated endpoints. * @@ -19,12 +17,19 @@ const models = require('./index'); class ResolvedServicePartition { /** * Create a ResolvedServicePartition. - * @member {string} name - * @member {object} partitionInformation - * @member {uuid} [partitionInformation.id] + * @member {string} name The full name of the service with 'fabric:' URI + * scheme. + * @member {object} partitionInformation A representation of the resolved + * partition. + * @member {uuid} [partitionInformation.id] An internal ID used by Service + * Fabric to uniquely identify a partition. This is a randomly generated GUID + * when the service was created. The partition ID is unique and does not + * change for the lifetime of the service. If the same service was deleted + * and recreated the IDs of its partitions would be different. * @member {string} [partitionInformation.servicePartitionKind] Polymorphic * Discriminator - * @member {array} endpoints + * @member {array} endpoints List of resolved service endpoints of a service + * partition. * @member {string} version The version of this resolved service partition * result. This version should be passed in the next time the ResolveService * call is made via the PreviousRspVersion query parameter. diff --git a/lib/services/serviceFabric/lib/models/resourceLimits.js b/lib/services/serviceFabric/lib/models/resourceLimits.js new file mode 100644 index 0000000000..3fffe2627e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/resourceLimits.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'; + +/** + * This type describes the resource limits for a given container. It describes + * the most amount of resources a container is allowed to use before being + * restarted. + * + */ +class ResourceLimits { + /** + * Create a ResourceLimits. + * @member {number} [memoryInGB] The memory limit in GB. + * @member {number} [cpu] CPU limits in cores. At present, only full cores + * are supported. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceLimits + * + * @returns {object} metadata of ResourceLimits + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceLimits', + type: { + name: 'Composite', + className: 'ResourceLimits', + modelProperties: { + memoryInGB: { + required: false, + serializedName: 'memoryInGB', + type: { + name: 'Number' + } + }, + cpu: { + required: false, + serializedName: 'cpu', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ResourceLimits; diff --git a/lib/services/serviceFabric/lib/models/resourceRequests.js b/lib/services/serviceFabric/lib/models/resourceRequests.js new file mode 100644 index 0000000000..bd1d98bc45 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/resourceRequests.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * This type describes the requested resources for a given container. It + * describes the least amount of resources required for the container. A + * container can consume more than requested resources up to the specified + * limits before being restarted. Currently, the requested resources are + * treated as limits. + * + */ +class ResourceRequests { + /** + * Create a ResourceRequests. + * @member {number} memoryInGB The memory request in GB for this container. + * @member {number} cpu Requested number of CPU cores. At present, only full + * cores are supported. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceRequests + * + * @returns {object} metadata of ResourceRequests + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceRequests', + type: { + name: 'Composite', + className: 'ResourceRequests', + modelProperties: { + memoryInGB: { + required: true, + serializedName: 'memoryInGB', + type: { + name: 'Number' + } + }, + cpu: { + required: true, + serializedName: 'cpu', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ResourceRequests; diff --git a/lib/services/serviceFabric/lib/models/resourceRequirements.js b/lib/services/serviceFabric/lib/models/resourceRequirements.js new file mode 100644 index 0000000000..c3c063afb4 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/resourceRequirements.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * This type describes the resource requirements for a container or a service. + * + */ +class ResourceRequirements { + /** + * Create a ResourceRequirements. + * @member {object} requests Describes the requested resources for a given + * container. + * @member {number} [requests.memoryInGB] The memory request in GB for this + * container. + * @member {number} [requests.cpu] Requested number of CPU cores. At present, + * only full cores are supported. + * @member {object} [limits] Describes the maximum limits on the resources + * for a given container. + * @member {number} [limits.memoryInGB] The memory limit in GB. + * @member {number} [limits.cpu] CPU limits in cores. At present, only full + * cores are supported. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceRequirements + * + * @returns {object} metadata of ResourceRequirements + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceRequirements', + type: { + name: 'Composite', + className: 'ResourceRequirements', + modelProperties: { + requests: { + required: true, + serializedName: 'requests', + type: { + name: 'Composite', + className: 'ResourceRequests' + } + }, + limits: { + required: false, + serializedName: 'limits', + type: { + name: 'Composite', + className: 'ResourceLimits' + } + } + } + } + }; + } +} + +module.exports = ResourceRequirements; diff --git a/lib/services/serviceFabric/lib/models/restartDeployedCodePackageDescription.js b/lib/services/serviceFabric/lib/models/restartDeployedCodePackageDescription.js index 82b9ea352a..2411e3d6a7 100644 --- a/lib/services/serviceFabric/lib/models/restartDeployedCodePackageDescription.js +++ b/lib/services/serviceFabric/lib/models/restartDeployedCodePackageDescription.js @@ -11,18 +11,33 @@ 'use strict'; /** - * Defines description for restarting a deloyed code package on Service Fabric + * Defines description for restarting a deployed code package on Service Fabric * node. * - * */ class RestartDeployedCodePackageDescription { /** * Create a RestartDeployedCodePackageDescription. - * @member {string} serviceManifestName - * @member {string} [servicePackageActivationId] - * @member {string} codePackageName - * @member {string} codePackageInstanceId + * @member {string} serviceManifestName The name of service manifest that + * specified this code package. + * @member {string} [servicePackageActivationId] The ActivationId of a + * deployed service package. If ServicePackageActivationMode specified at the + * time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults + * to 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * @member {string} codePackageName The name of the code package defined in + * the service manifest. + * @member {string} codePackageInstanceId The instance ID for currently + * running entry point. For a code package setup entry point (if specified) + * runs first and after it finishes main entry point is started. + * Each time entry point executable is run, its instance ID will change. If 0 + * is passed in as the code package instance ID, the API will restart the + * code package with whatever instance ID it is currently running. + * If an instance ID other than 0 is passed in, the API will restart the code + * package only if the current Instance ID matches the passed in instance ID. + * Note, passing in the exact instance ID (not 0) in the API is safer, + * because if ensures at most one restart of the code package. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/restartNodeDescription.js b/lib/services/serviceFabric/lib/models/restartNodeDescription.js index 0304dd8c8e..3886dbea0a 100644 --- a/lib/services/serviceFabric/lib/models/restartNodeDescription.js +++ b/lib/services/serviceFabric/lib/models/restartNodeDescription.js @@ -17,13 +17,13 @@ class RestartNodeDescription { /** * Create a RestartNodeDescription. - * @member {string} nodeInstanceId The instance id of the target node. If - * instance id is specified the node is restarted only if it matches with the + * @member {string} nodeInstanceId The instance ID of the target node. If + * instance ID is specified the node is restarted only if it matches with the * current instance of the node. A default value of "0" would match any - * instance id. The instance id can be obtained using get node query. Default + * instance ID. The instance ID can be obtained using get node query. Default * value: '0' . * @member {string} [createFabricDump] Specify True to create a dump of the - * fabric node process. This is case sensitive. Possible values include: + * fabric node process. This is case-sensitive. Possible values include: * 'False', 'True'. Default value: 'False' . */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/restartPartitionResult.js b/lib/services/serviceFabric/lib/models/restartPartitionResult.js index 3dd4588449..2eedcf686a 100644 --- a/lib/services/serviceFabric/lib/models/restartPartitionResult.js +++ b/lib/services/serviceFabric/lib/models/restartPartitionResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents information about an operation in a terminal state (Completed or * Faulted). @@ -22,9 +20,15 @@ class RestartPartitionResult { * Create a RestartPartitionResult. * @member {number} [errorCode] If OperationState is Completed, this is 0. * If OperationState is Faulted, this is an error code indicating the reason. - * @member {object} [selectedPartition] - * @member {string} [selectedPartition.serviceName] - * @member {uuid} [selectedPartition.partitionId] + * @member {object} [selectedPartition] This class returns information about + * the partition that the user-induced operation acted upon. + * @member {string} [selectedPartition.serviceName] The name of the service + * the partition belongs to. + * @member {uuid} [selectedPartition.partitionId] An internal ID used by + * Service Fabric to uniquely identify a partition. This is a randomly + * generated GUID when the service was created. The partition ID is unique + * and does not change for the lifetime of the service. If the same service + * was deleted and recreated the IDs of its partitions would be different. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/restorePartitionDescription.js b/lib/services/serviceFabric/lib/models/restorePartitionDescription.js new file mode 100644 index 0000000000..fbae05a48b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/restorePartitionDescription.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Specifies the parameters needed to trigger a restore of a specific + * partition. + * + */ +class RestorePartitionDescription { + /** + * Create a RestorePartitionDescription. + * @member {uuid} backupId Unique backup ID. + * @member {string} backupLocation Location of the backup relative to the + * backup storage specified/ configured. + * @member {object} [backupStorage] Location of the backup from where the + * partition will be restored. + * @member {string} [backupStorage.friendlyName] Friendly name for this + * backup storage. + * @member {string} [backupStorage.storageKind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of RestorePartitionDescription + * + * @returns {object} metadata of RestorePartitionDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'RestorePartitionDescription', + type: { + name: 'Composite', + className: 'RestorePartitionDescription', + modelProperties: { + backupId: { + required: true, + serializedName: 'BackupId', + type: { + name: 'String' + } + }, + backupLocation: { + required: true, + serializedName: 'BackupLocation', + type: { + name: 'String' + } + }, + backupStorage: { + required: false, + serializedName: 'BackupStorage', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'StorageKind', + clientName: 'storageKind' + }, + uberParent: 'BackupStorageDescription', + className: 'BackupStorageDescription' + } + } + } + } + }; + } +} + +module.exports = RestorePartitionDescription; diff --git a/lib/services/serviceFabric/lib/models/restoreProgressInfo.js b/lib/services/serviceFabric/lib/models/restoreProgressInfo.js new file mode 100644 index 0000000000..743a88c9a7 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/restoreProgressInfo.js @@ -0,0 +1,262 @@ +/* + * 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 progress of a restore operation on a partition. + * + */ +class RestoreProgressInfo { + /** + * Create a RestoreProgressInfo. + * @member {string} [restoreState] Represents the current state of the + * partition restore operation. Possible values include: 'Invalid', + * 'Accepted', 'RestoreInProgress', 'Success', 'Failure', 'Timeout' + * @member {date} [timeStampUtc] Timestamp when operation succeeded or + * failed. + * @member {object} [restoredEpoch] Describes the epoch at which the + * partition is restored. + * @member {string} [restoredEpoch.configurationNumber] The current + * configuration number of this Epoch. The configuration number is an + * increasing value that is updated whenever the configuration of this + * replica set changes. + * @member {string} [restoredEpoch.dataLossNumber] The current dataloss + * number of this Epoch. The data loss number property is an increasing value + * which is updated whenever data loss is suspected, as when loss of a quorum + * of replicas in the replica set that includes the Primary replica. + * @member {string} [restoredLsn] Restored LSN. + * @member {object} [failureError] Denotes the failure encountered in + * performing restore operation. + * @member {string} [failureError.code] Defines the fabric error codes that + * be returned as part of the error object in response to Service Fabric API + * operations that are not successful. Following are the error code values + * that can be returned for a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request + * Entity Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT". Possible values include: + * 'FABRIC_E_INVALID_PARTITION_KEY', + * 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', + * 'FABRIC_E_APPLICATION_NOT_UPGRADING', + * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_FABRIC_NOT_UPGRADING', + * 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', + * 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', + * 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', + * 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', + * 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', + * 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', + * 'FABRIC_E_SERVICE_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', + * 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', + * 'FABRIC_E_PARTITION_NOT_FOUND', 'FABRIC_E_REPLICA_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', + * 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', + * 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', + * 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', + * 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', + * 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', + * 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', + * 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', + * 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_SERVICE_ALREADY_EXISTS', + * 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_TYPE_IN_USE', + * 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', + * 'FABRIC_E_FABRIC_VERSION_IN_USE', 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_NAME_ALREADY_EXISTS', 'FABRIC_E_NAME_NOT_EMPTY', + * 'FABRIC_E_PROPERTY_CHECK_FAILED', 'FABRIC_E_SERVICE_METADATA_MISMATCH', + * 'FABRIC_E_SERVICE_TYPE_MISMATCH', 'FABRIC_E_HEALTH_STALE_REPORT', + * 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', + * 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', + * 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', + * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', + * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', + * 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', + * 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', + * 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', + * 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError' + * @member {string} [failureError.message] Error message. + */ + constructor() { + } + + /** + * Defines the metadata of RestoreProgressInfo + * + * @returns {object} metadata of RestoreProgressInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'RestoreProgressInfo', + type: { + name: 'Composite', + className: 'RestoreProgressInfo', + modelProperties: { + restoreState: { + required: false, + serializedName: 'RestoreState', + type: { + name: 'String' + } + }, + timeStampUtc: { + required: false, + serializedName: 'TimeStampUtc', + type: { + name: 'DateTime' + } + }, + restoredEpoch: { + required: false, + serializedName: 'RestoredEpoch', + type: { + name: 'Composite', + className: 'BackupEpoch' + } + }, + restoredLsn: { + required: false, + serializedName: 'RestoredLsn', + type: { + name: 'String' + } + }, + failureError: { + required: false, + serializedName: 'FailureError', + type: { + name: 'Composite', + className: 'FabricErrorError' + } + } + } + } + }; + } +} + +module.exports = RestoreProgressInfo; diff --git a/lib/services/serviceFabric/lib/models/rollingUpgradeUpdateDescription.js b/lib/services/serviceFabric/lib/models/rollingUpgradeUpdateDescription.js index bc8b256d4f..21b7692ac9 100644 --- a/lib/services/serviceFabric/lib/models/rollingUpgradeUpdateDescription.js +++ b/lib/services/serviceFabric/lib/models/rollingUpgradeUpdateDescription.js @@ -18,18 +18,52 @@ class RollingUpgradeUpdateDescription { /** * Create a RollingUpgradeUpdateDescription. - * @member {string} rollingUpgradeMode Possible values include: 'Invalid', - * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: - * 'UnmonitoredAuto' . - * @member {boolean} [forceRestart] - * @member {number} [replicaSetCheckTimeoutInMilliseconds] - * @member {string} [failureAction] Possible values include: 'Invalid', - * 'Rollback', 'Manual' - * @member {string} [healthCheckWaitDurationInMilliseconds] - * @member {string} [healthCheckStableDurationInMilliseconds] - * @member {string} [healthCheckRetryTimeoutInMilliseconds] - * @member {string} [upgradeTimeoutInMilliseconds] - * @member {string} [upgradeDomainTimeoutInMilliseconds] + * @member {string} rollingUpgradeMode The mode used to monitor health during + * a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + * Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + * 'UnmonitoredManual', 'Monitored'. Default value: 'UnmonitoredAuto' . + * @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 {number} [replicaSetCheckTimeoutInMilliseconds] 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 {string} [failureAction] The compensating action to perform when a + * Monitored upgrade encounters monitoring policy or health policy + * violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * @member {string} [healthCheckWaitDurationInMilliseconds] 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} [healthCheckStableDurationInMilliseconds] 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} [healthCheckRetryTimeoutInMilliseconds] 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} [upgradeTimeoutInMilliseconds] 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} [upgradeDomainTimeoutInMilliseconds] 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/serviceFabric/lib/models/safetyCheck.js b/lib/services/serviceFabric/lib/models/safetyCheck.js index 03c5b21328..0bed848453 100644 --- a/lib/services/serviceFabric/lib/models/safetyCheck.js +++ b/lib/services/serviceFabric/lib/models/safetyCheck.js @@ -46,6 +46,7 @@ class SafetyCheck { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/safetyCheckWrapper.js b/lib/services/serviceFabric/lib/models/safetyCheckWrapper.js index de3f38435f..b34380f8e6 100644 --- a/lib/services/serviceFabric/lib/models/safetyCheckWrapper.js +++ b/lib/services/serviceFabric/lib/models/safetyCheckWrapper.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A wrapper for the safety check object. Safety checks are performed by * service fabric before continuing with the operations. These checks ensure @@ -21,7 +19,9 @@ const models = require('./index'); class SafetyCheckWrapper { /** * Create a SafetyCheckWrapper. - * @member {object} [safetyCheck] + * @member {object} [safetyCheck] Represents a safety check performed by + * service fabric before continuing with the operations. These checks ensure + * the availability of the service and the reliability of the state. * @member {string} [safetyCheck.kind] Polymorphic Discriminator */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/scalingMechanismDescription.js b/lib/services/serviceFabric/lib/models/scalingMechanismDescription.js new file mode 100644 index 0000000000..b626851d30 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/scalingMechanismDescription.js @@ -0,0 +1,58 @@ +/* + * 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 mechanism for performing a scaling operation. + * + */ +class ScalingMechanismDescription { + /** + * Create a ScalingMechanismDescription. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ScalingMechanismDescription + * + * @returns {object} metadata of ScalingMechanismDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ScalingMechanismDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingMechanismDescription', + className: 'ScalingMechanismDescription', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ScalingMechanismDescription; diff --git a/lib/services/serviceFabric/lib/models/scalingPolicyDescription.js b/lib/services/serviceFabric/lib/models/scalingPolicyDescription.js new file mode 100644 index 0000000000..e88839220d --- /dev/null +++ b/lib/services/serviceFabric/lib/models/scalingPolicyDescription.js @@ -0,0 +1,76 @@ +/* + * 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 how the scaling should be performed + * + */ +class ScalingPolicyDescription { + /** + * Create a ScalingPolicyDescription. + * @member {object} scalingTrigger Specifies the trigger associated with this + * scaling policy + * @member {string} [scalingTrigger.kind] Polymorphic Discriminator + * @member {object} scalingMechanism Specifies the mechanism associated with + * this scaling policy + * @member {string} [scalingMechanism.kind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ScalingPolicyDescription + * + * @returns {object} metadata of ScalingPolicyDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ScalingPolicyDescription', + type: { + name: 'Composite', + className: 'ScalingPolicyDescription', + modelProperties: { + scalingTrigger: { + required: true, + serializedName: 'ScalingTrigger', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingTriggerDescription', + className: 'ScalingTriggerDescription' + } + }, + scalingMechanism: { + required: true, + serializedName: 'ScalingMechanism', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingMechanismDescription', + className: 'ScalingMechanismDescription' + } + } + } + } + }; + } +} + +module.exports = ScalingPolicyDescription; diff --git a/lib/services/serviceFabric/lib/models/scalingTriggerDescription.js b/lib/services/serviceFabric/lib/models/scalingTriggerDescription.js new file mode 100644 index 0000000000..933ace82bb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/scalingTriggerDescription.js @@ -0,0 +1,58 @@ +/* + * 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 trigger for performing a scaling operation. + * + */ +class ScalingTriggerDescription { + /** + * Create a ScalingTriggerDescription. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ScalingTriggerDescription + * + * @returns {object} metadata of ScalingTriggerDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ScalingTriggerDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ScalingTriggerDescription', + className: 'ScalingTriggerDescription', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ScalingTriggerDescription; diff --git a/lib/services/serviceFabric/lib/models/secondaryActiveReplicatorStatus.js b/lib/services/serviceFabric/lib/models/secondaryActiveReplicatorStatus.js index a39a87b71a..6f71503886 100644 --- a/lib/services/serviceFabric/lib/models/secondaryActiveReplicatorStatus.js +++ b/lib/services/serviceFabric/lib/models/secondaryActiveReplicatorStatus.js @@ -38,11 +38,17 @@ class SecondaryActiveReplicatorStatus extends models['SecondaryReplicatorStatus' serializedName: 'ActiveSecondary', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ReplicatorStatus', className: 'SecondaryActiveReplicatorStatus', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/secondaryIdleReplicatorStatus.js b/lib/services/serviceFabric/lib/models/secondaryIdleReplicatorStatus.js index 95f47b5aed..674c72d3a6 100644 --- a/lib/services/serviceFabric/lib/models/secondaryIdleReplicatorStatus.js +++ b/lib/services/serviceFabric/lib/models/secondaryIdleReplicatorStatus.js @@ -38,11 +38,17 @@ class SecondaryIdleReplicatorStatus extends models['SecondaryReplicatorStatus'] serializedName: 'IdleSecondary', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ReplicatorStatus', className: 'SecondaryIdleReplicatorStatus', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/secondaryReplicatorStatus.js b/lib/services/serviceFabric/lib/models/secondaryReplicatorStatus.js index 40cb69f869..12d9f1af33 100644 --- a/lib/services/serviceFabric/lib/models/secondaryReplicatorStatus.js +++ b/lib/services/serviceFabric/lib/models/secondaryReplicatorStatus.js @@ -13,13 +13,16 @@ const models = require('./index'); /** - * Class representing a SecondaryReplicatorStatus. + * Provides statistics about the Service Fabric Replicator, when it is + * functioning in a ActiveSecondary role. + * * @extends models['ReplicatorStatus'] */ class SecondaryReplicatorStatus extends models['ReplicatorStatus'] { /** * Create a SecondaryReplicatorStatus. - * @member {object} [replicationQueueStatus] + * @member {object} [replicationQueueStatus] Details about the replication + * queue on the secondary replicator. * @member {number} [replicationQueueStatus.queueUtilizationPercentage] * Represents the utilization of the queue. A value of 0 indicates that the * queue is empty and a value of 100 indicates the queue is full. @@ -52,7 +55,8 @@ class SecondaryReplicatorStatus extends models['ReplicatorStatus'] { * message was never received. * @member {boolean} [isInBuild] Value that indicates whether the replica is * currently being built. - * @member {object} [copyQueueStatus] + * @member {object} [copyQueueStatus] Details about the copy queue on the + * secondary replicator. * @member {number} [copyQueueStatus.queueUtilizationPercentage] Represents * the utilization of the queue. A value of 0 indicates that the queue is * empty and a value of 100 indicates the queue is full. @@ -102,11 +106,17 @@ class SecondaryReplicatorStatus extends models['ReplicatorStatus'] { serializedName: 'SecondaryReplicatorStatus', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ReplicatorStatus', className: 'SecondaryReplicatorStatus', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/seedNodeSafetyCheck.js b/lib/services/serviceFabric/lib/models/seedNodeSafetyCheck.js index 09ee7169a4..4e219e3749 100644 --- a/lib/services/serviceFabric/lib/models/seedNodeSafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/seedNodeSafetyCheck.js @@ -38,11 +38,17 @@ class SeedNodeSafetyCheck extends models['SafetyCheck'] { serializedName: 'EnsureSeedNodeQuorum', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'SeedNodeSafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/selectedPartition.js b/lib/services/serviceFabric/lib/models/selectedPartition.js index 439195b0cf..aff230e5f5 100644 --- a/lib/services/serviceFabric/lib/models/selectedPartition.js +++ b/lib/services/serviceFabric/lib/models/selectedPartition.js @@ -18,8 +18,13 @@ class SelectedPartition { /** * Create a SelectedPartition. - * @member {string} [serviceName] - * @member {uuid} [partitionId] + * @member {string} [serviceName] The name of the service the partition + * belongs to. + * @member {uuid} [partitionId] An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/serviceBackupConfigurationInfo.js b/lib/services/serviceFabric/lib/models/serviceBackupConfigurationInfo.js new file mode 100644 index 0000000000..5acd2905ae --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceBackupConfigurationInfo.js @@ -0,0 +1,94 @@ +/* + * 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'); + +/** + * Backup configuration information for a specific Service Fabric service + * specifying what backup policy is being applied and suspend description, if + * any. + * + * @extends models['BackupConfigurationInfo'] + */ +class ServiceBackupConfigurationInfo extends models['BackupConfigurationInfo'] { + /** + * Create a ServiceBackupConfigurationInfo. + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceBackupConfigurationInfo + * + * @returns {object} metadata of ServiceBackupConfigurationInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'Service', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'BackupConfigurationInfo', + className: 'ServiceBackupConfigurationInfo', + modelProperties: { + policyName: { + required: false, + serializedName: 'PolicyName', + type: { + name: 'String' + } + }, + policyInheritedFrom: { + required: false, + serializedName: 'PolicyInheritedFrom', + type: { + name: 'String' + } + }, + suspensionInfo: { + required: false, + serializedName: 'SuspensionInfo', + type: { + name: 'Composite', + className: 'BackupSuspensionInfo' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceName: { + required: false, + serializedName: 'ServiceName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceBackupConfigurationInfo; diff --git a/lib/services/serviceFabric/lib/models/serviceBackupEntity.js b/lib/services/serviceFabric/lib/models/serviceBackupEntity.js new file mode 100644 index 0000000000..c6e3ea8492 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceBackupEntity.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Identifies the Service Fabric stateful service which is being backed up. + * + * @extends models['BackupEntity'] + */ +class ServiceBackupEntity extends models['BackupEntity'] { + /** + * Create a ServiceBackupEntity. + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceBackupEntity + * + * @returns {object} metadata of ServiceBackupEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'Service', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'EntityKind', + clientName: 'entityKind' + }, + uberParent: 'BackupEntity', + className: 'ServiceBackupEntity', + modelProperties: { + entityKind: { + required: true, + serializedName: 'EntityKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceName: { + required: false, + serializedName: 'ServiceName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceBackupEntity; diff --git a/lib/services/serviceFabric/lib/models/serviceCorrelationDescription.js b/lib/services/serviceFabric/lib/models/serviceCorrelationDescription.js index 8b408ff009..007b505183 100644 --- a/lib/services/serviceFabric/lib/models/serviceCorrelationDescription.js +++ b/lib/services/serviceFabric/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/serviceFabric/lib/models/serviceCreatedEvent.js b/lib/services/serviceFabric/lib/models/serviceCreatedEvent.js new file mode 100644 index 0000000000..9732914087 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceCreatedEvent.js @@ -0,0 +1,173 @@ +/* + * 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'); + +/** + * Service Created event. + * + * @extends models['ServiceEvent'] + */ +class ServiceCreatedEvent extends models['ServiceEvent'] { + /** + * Create a ServiceCreatedEvent. + * @member {string} serviceTypeName Service type name. + * @member {string} applicationName Application name. + * @member {string} applicationTypeName Application type name. + * @member {number} serviceInstance Id of Service instance. + * @member {boolean} isStateful Indicates if Service is stateful. + * @member {number} partitionCount Number of partitions. + * @member {number} targetReplicaSetSize Size of target replicas set. + * @member {number} minReplicaSetSize Minimum size of replicas set. + * @member {string} servicePackageVersion Version of Service package. + * @member {uuid} partitionId An internal ID used by Service Fabric to + * uniquely identify a partition. This is a randomly generated GUID when the + * service was created. The partition ID is unique and does not change for + * the lifetime of the service. If the same service was deleted and recreated + * the IDs of its partitions would be different. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceCreatedEvent + * + * @returns {object} metadata of ServiceCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceId: { + required: true, + serializedName: 'ServiceId', + type: { + name: 'String' + } + }, + serviceTypeName: { + required: true, + serializedName: 'ServiceTypeName', + type: { + name: 'String' + } + }, + applicationName: { + required: true, + serializedName: 'ApplicationName', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + serviceInstance: { + required: true, + serializedName: 'ServiceInstance', + type: { + name: 'Number' + } + }, + isStateful: { + required: true, + serializedName: 'IsStateful', + type: { + name: 'Boolean' + } + }, + partitionCount: { + required: true, + serializedName: 'PartitionCount', + type: { + name: 'Number' + } + }, + targetReplicaSetSize: { + required: true, + serializedName: 'TargetReplicaSetSize', + type: { + name: 'Number' + } + }, + minReplicaSetSize: { + required: true, + serializedName: 'MinReplicaSetSize', + type: { + name: 'Number' + } + }, + servicePackageVersion: { + required: true, + serializedName: 'ServicePackageVersion', + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/serviceDeletedEvent.js b/lib/services/serviceFabric/lib/models/serviceDeletedEvent.js new file mode 100644 index 0000000000..2905650e7a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceDeletedEvent.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'); + +/** + * Service Deleted event. + * + * @extends models['ServiceEvent'] + */ +class ServiceDeletedEvent extends models['ServiceEvent'] { + /** + * Create a ServiceDeletedEvent. + * @member {string} serviceTypeName Service type name. + * @member {string} applicationName Application name. + * @member {string} applicationTypeName Application type name. + * @member {number} serviceInstance Id of Service instance. + * @member {boolean} isStateful Indicates if Service is stateful. + * @member {number} partitionCount Number of partitions. + * @member {number} targetReplicaSetSize Size of target replicas set. + * @member {number} minReplicaSetSize Minimum size of replicas set. + * @member {string} servicePackageVersion Version of Service package. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceDeletedEvent + * + * @returns {object} metadata of ServiceDeletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceDeleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceDeletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceId: { + required: true, + serializedName: 'ServiceId', + type: { + name: 'String' + } + }, + serviceTypeName: { + required: true, + serializedName: 'ServiceTypeName', + type: { + name: 'String' + } + }, + applicationName: { + required: true, + serializedName: 'ApplicationName', + type: { + name: 'String' + } + }, + applicationTypeName: { + required: true, + serializedName: 'ApplicationTypeName', + type: { + name: 'String' + } + }, + serviceInstance: { + required: true, + serializedName: 'ServiceInstance', + type: { + name: 'Number' + } + }, + isStateful: { + required: true, + serializedName: 'IsStateful', + type: { + name: 'Boolean' + } + }, + partitionCount: { + required: true, + serializedName: 'PartitionCount', + type: { + name: 'Number' + } + }, + targetReplicaSetSize: { + required: true, + serializedName: 'TargetReplicaSetSize', + type: { + name: 'Number' + } + }, + minReplicaSetSize: { + required: true, + serializedName: 'MinReplicaSetSize', + type: { + name: 'Number' + } + }, + servicePackageVersion: { + required: true, + serializedName: 'ServicePackageVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceDeletedEvent; diff --git a/lib/services/serviceFabric/lib/models/serviceDescription.js b/lib/services/serviceFabric/lib/models/serviceDescription.js index 68da78b456..d409bb25a1 100644 --- a/lib/services/serviceFabric/lib/models/serviceDescription.js +++ b/lib/services/serviceFabric/lib/models/serviceDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A ServiceDescription contains all of the information necessary to create a * service. @@ -20,11 +18,17 @@ const models = require('./index'); class ServiceDescription { /** * Create a ServiceDescription. - * @member {string} [applicationName] - * @member {string} serviceName - * @member {string} serviceTypeName - * @member {array} [initializationData] - * @member {object} partitionDescription + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} serviceName The full name of the service with 'fabric:' + * URI scheme. + * @member {string} serviceTypeName Name of the service type as specified in + * the service manifest. + * @member {array} [initializationData] The initialization data as an array + * of bytes. Initialization data is passed to service instances or replicas + * when they are created. + * @member {object} partitionDescription The partition description as an + * object. * @member {string} [partitionDescription.partitionScheme] Polymorphic * Discriminator * @member {string} [placementConstraints] The placement constraints as a @@ -32,17 +36,19 @@ class ServiceDescription { * 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] The correlation scheme. + * @member {array} [serviceLoadMetrics] The service load metrics. + * @member {array} [servicePlacementPolicies] The service placement policies. + * @member {string} [defaultMoveCost] The move cost for the service. Possible + * values include: 'Zero', 'Low', 'Medium', 'High' * @member {boolean} [isDefaultMoveCostSpecified] Indicates if the * DefaultMoveCost property is specified. - * @member {string} [servicePackageActivationMode] Possible values include: + * @member {string} [servicePackageActivationMode] The activation mode of + * service package to be used for a service. Possible values include: * 'SharedProcess', 'ExclusiveProcess' * @member {string} [serviceDnsName] The DNS name of the service. It requires * the DNS system service to be enabled in Service Fabric cluster. + * @member {array} [scalingPolicies] Scaling policies for this service. * @member {string} serviceKind Polymorphic Discriminator */ constructor() { @@ -200,9 +206,25 @@ class ServiceDescription { name: 'String' } }, + scalingPolicies: { + required: false, + serializedName: 'ScalingPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ScalingPolicyDescriptionElementType', + type: { + name: 'Composite', + className: 'ScalingPolicyDescription' + } + } + } + }, serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/serviceEvent.js b/lib/services/serviceFabric/lib/models/serviceEvent.js new file mode 100644 index 0000000000..fb1a8d87c6 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceEvent.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents the base for all Service Events. + * + * @extends models['FabricEvent'] + */ +class ServiceEvent extends models['FabricEvent'] { + /** + * Create a ServiceEvent. + * @member {string} serviceId The identity of the service. This ID is an + * encoded representation of the service name. This is used in the REST APIs + * to identify the service resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceEvent + * + * @returns {object} metadata of ServiceEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceEvent', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceId: { + required: true, + serializedName: 'ServiceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceEvent; diff --git a/lib/services/serviceFabric/lib/models/serviceFromTemplateDescription.js b/lib/services/serviceFabric/lib/models/serviceFromTemplateDescription.js index 4253182be0..a77a801a11 100644 --- a/lib/services/serviceFabric/lib/models/serviceFromTemplateDescription.js +++ b/lib/services/serviceFabric/lib/models/serviceFromTemplateDescription.js @@ -14,16 +14,20 @@ * Defines description for creating a Service Fabric service from a template * defined in the application manifest. * - * */ class ServiceFromTemplateDescription { /** * Create a ServiceFromTemplateDescription. - * @member {string} applicationName - * @member {string} serviceName - * @member {string} serviceTypeName - * @member {array} [initializationData] - * @member {string} [servicePackageActivationMode] Possible values include: + * @member {string} applicationName The name of the application, including + * the 'fabric:' URI scheme. + * @member {string} serviceName The full name of the service with 'fabric:' + * URI scheme. + * @member {string} serviceTypeName Name of the service type as specified in + * the service manifest. + * @member {array} [initializationData] The initialization data for the newly + * created service instance. + * @member {string} [servicePackageActivationMode] The activation mode of + * service package to be used for a service. Possible values include: * 'SharedProcess', 'ExclusiveProcess' * @member {string} [serviceDnsName] The DNS name of the service. It requires * the DNS system service to be enabled in Service Fabric cluster. diff --git a/lib/services/serviceFabric/lib/models/serviceHealth.js b/lib/services/serviceFabric/lib/models/serviceHealth.js index 6d3d97efc7..7ec9e41e3c 100644 --- a/lib/services/serviceFabric/lib/models/serviceHealth.js +++ b/lib/services/serviceFabric/lib/models/serviceHealth.js @@ -20,7 +20,8 @@ const models = require('./index'); class ServiceHealth extends models['EntityHealth'] { /** * Create a ServiceHealth. - * @member {string} [name] + * @member {string} [name] The name of the service whose health information + * is described by this object. * @member {array} [partitionHealthStates] The list of partition health * states associated with the service. */ diff --git a/lib/services/serviceFabric/lib/models/serviceHealthEvaluation.js b/lib/services/serviceFabric/lib/models/serviceHealthEvaluation.js index 672e842914..770e61dff6 100644 --- a/lib/services/serviceFabric/lib/models/serviceHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/serviceHealthEvaluation.js @@ -23,8 +23,12 @@ const models = require('./index'); class ServiceHealthEvaluation extends models['HealthEvaluation'] { /** * Create a ServiceHealthEvaluation. - * @member {string} [serviceName] - * @member {array} [unhealthyEvaluations] + * @member {string} [serviceName] Name of the service whose health evaluation + * is described by this object. + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the service. The types of + * the unhealthy evaluations can be PartitionsHealthEvaluation or + * EventHealthEvaluation. */ constructor() { super(); @@ -42,6 +46,11 @@ class ServiceHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Service', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'ServiceHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -61,6 +70,7 @@ class ServiceHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/serviceHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/serviceHealthReportCreatedEvent.js new file mode 100644 index 0000000000..5347fb666c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceHealthReportCreatedEvent.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'); + +/** + * Service Health Report Created event. + * + * @extends models['ServiceEvent'] + */ +class ServiceHealthReportCreatedEvent extends models['ServiceEvent'] { + /** + * Create a ServiceHealthReportCreatedEvent. + * @member {number} instanceId Id of Service instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceHealthReportCreatedEvent + * + * @returns {object} metadata of ServiceHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceId: { + required: true, + serializedName: 'ServiceId', + type: { + name: 'String' + } + }, + instanceId: { + required: true, + serializedName: 'InstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ServiceHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/serviceHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/serviceHealthReportExpiredEvent.js new file mode 100644 index 0000000000..469953a18a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceHealthReportExpiredEvent.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'); + +/** + * Service Health Report Expired event. + * + * @extends models['ServiceEvent'] + */ +class ServiceHealthReportExpiredEvent extends models['ServiceEvent'] { + /** + * Create a ServiceHealthReportExpiredEvent. + * @member {number} instanceId Id of Service instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceHealthReportExpiredEvent + * + * @returns {object} metadata of ServiceHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serviceId: { + required: true, + serializedName: 'ServiceId', + type: { + name: 'String' + } + }, + instanceId: { + required: true, + serializedName: 'InstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ServiceHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/serviceHealthState.js b/lib/services/serviceFabric/lib/models/serviceHealthState.js index effe86efd2..1e1ac6ac88 100644 --- a/lib/services/serviceFabric/lib/models/serviceHealthState.js +++ b/lib/services/serviceFabric/lib/models/serviceHealthState.js @@ -21,7 +21,8 @@ const models = require('./index'); class ServiceHealthState extends models['EntityHealthState'] { /** * Create a ServiceHealthState. - * @member {string} [serviceName] + * @member {string} [serviceName] Name of the service whose health state is + * represented by this object. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/serviceHealthStateChunk.js b/lib/services/serviceFabric/lib/models/serviceHealthStateChunk.js index 54a3d5df3b..7040b8ecb5 100644 --- a/lib/services/serviceFabric/lib/models/serviceHealthStateChunk.js +++ b/lib/services/serviceFabric/lib/models/serviceHealthStateChunk.js @@ -17,14 +17,16 @@ const models = require('./index'); * name, its aggregated health state and any partitions that respect the * filters in the cluster health chunk query description. * - * * @extends models['EntityHealthStateChunk'] */ class ServiceHealthStateChunk extends models['EntityHealthStateChunk'] { /** * Create a ServiceHealthStateChunk. - * @member {string} [serviceName] - * @member {object} [partitionHealthStateChunks] + * @member {string} [serviceName] The name of the service whose health state + * chunk is provided in this object. + * @member {object} [partitionHealthStateChunks] The list of partition health + * state chunks belonging to the service that respect the filters in the + * cluster health chunk query description. * @member {array} [partitionHealthStateChunks.items] The list of partition * health state chunks that respect the input filters in the chunk query. */ diff --git a/lib/services/serviceFabric/lib/models/serviceHealthStateChunkList.js b/lib/services/serviceFabric/lib/models/serviceHealthStateChunkList.js index 37c057ffc4..5281ee06e8 100644 --- a/lib/services/serviceFabric/lib/models/serviceHealthStateChunkList.js +++ b/lib/services/serviceFabric/lib/models/serviceHealthStateChunkList.js @@ -10,13 +10,10 @@ 'use strict'; -const models = require('./index'); - /** * The list of service health state chunks that respect the input filters in * the chunk query. Returned by get cluster health state chunks query. * - * */ class ServiceHealthStateChunkList { /** diff --git a/lib/services/serviceFabric/lib/models/serviceHealthStateFilter.js b/lib/services/serviceFabric/lib/models/serviceHealthStateFilter.js index d63cc36cd3..488928f950 100644 --- a/lib/services/serviceFabric/lib/models/serviceHealthStateFilter.js +++ b/lib/services/serviceFabric/lib/models/serviceHealthStateFilter.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Defines matching criteria to determine whether a service should be included * as a child of an application in the cluster health chunk. @@ -20,7 +18,6 @@ const models = require('./index'); * One filter can match zero, one or multiple services, depending on its * properties. * - * */ class ServiceHealthStateFilter { /** @@ -44,7 +41,7 @@ class ServiceHealthStateFilter { * If not specified, default value is None, unless the service name is * specified. If the filter has default value and service name is specified, * the matching service is returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6, it matches services with * HealthState value of OK (2) and Warning (4). @@ -59,8 +56,7 @@ class ServiceHealthStateFilter { * - Error - Filter that matches input with HealthState value Error. The * value is 8. * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * . Default value: 0 . + * 65535. Default value: 0 . * @member {array} [partitionFilters] Defines a list of filters that specify * which partitions to be included in the returned cluster health chunk as * children of the service. The partitions are returned only if the parent @@ -71,7 +67,7 @@ class ServiceHealthStateFilter { * The service filter may specify multiple partition filters. * For example, it can specify a filter to return all partitions with health * state Error and another filter to always include a partition identified by - * its partition id. + * its partition ID. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/serviceInfo.js b/lib/services/serviceFabric/lib/models/serviceInfo.js index 62c159c9ef..565d710821 100644 --- a/lib/services/serviceFabric/lib/models/serviceInfo.js +++ b/lib/services/serviceFabric/lib/models/serviceInfo.js @@ -17,14 +17,24 @@ class ServiceInfo { /** * Create a ServiceInfo. - * @member {string} [id] - * @member {string} [name] - * @member {string} [typeName] + * @member {string} [id] The identity of the service. This ID is an encoded + * representation of the service name. This is used in the REST APIs to + * identify the service resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + * @member {string} [name] The full name of the service with 'fabric:' URI + * scheme. + * @member {string} [typeName] Name of the service type as specified in the + * service manifest. * @member {string} [manifestVersion] The version of the service manifest. - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [serviceStatus] Possible values include: 'Unknown', - * 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed' + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [serviceStatus] The status of the application. Possible + * values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', + * 'Failed' * @member {boolean} [isServiceGroup] Whether the service is in a service * group. * @member {string} serviceKind Polymorphic Discriminator @@ -103,6 +113,7 @@ class ServiceInfo { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/serviceLoadMetricDescription.js b/lib/services/serviceFabric/lib/models/serviceLoadMetricDescription.js index 2c561a1273..0d59541e6f 100644 --- a/lib/services/serviceFabric/lib/models/serviceLoadMetricDescription.js +++ b/lib/services/serviceFabric/lib/models/serviceLoadMetricDescription.js @@ -19,10 +19,11 @@ class ServiceLoadMetricDescription { * Create a ServiceLoadMetricDescription. * @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' + * 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. diff --git a/lib/services/serviceFabric/lib/models/serviceNameInfo.js b/lib/services/serviceFabric/lib/models/serviceNameInfo.js index 0c48575f86..2ef0a389bf 100644 --- a/lib/services/serviceFabric/lib/models/serviceNameInfo.js +++ b/lib/services/serviceFabric/lib/models/serviceNameInfo.js @@ -17,8 +17,15 @@ class ServiceNameInfo { /** * Create a ServiceNameInfo. - * @member {string} [id] - * @member {string} [name] + * @member {string} [id] The identity of the service. This ID is an encoded + * representation of the service name. This is used in the REST APIs to + * identify the service resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + * @member {string} [name] The full name of the service with 'fabric:' URI + * scheme. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/servicePartitionInfo.js b/lib/services/serviceFabric/lib/models/servicePartitionInfo.js index c2ca2b1765..f89806ff99 100644 --- a/lib/services/serviceFabric/lib/models/servicePartitionInfo.js +++ b/lib/services/serviceFabric/lib/models/servicePartitionInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a partition of a Service Fabric service. * @@ -19,12 +17,19 @@ const models = require('./index'); class ServicePartitionInfo { /** * Create a ServicePartitionInfo. - * @member {string} [healthState] Possible values include: 'Invalid', 'Ok', - * 'Warning', 'Error', 'Unknown' - * @member {string} [partitionStatus] Possible values include: 'Invalid', - * 'Ready', 'NotReady', 'InQuorumLoss', 'Reconfiguring', 'Deleting' - * @member {object} [partitionInformation] - * @member {uuid} [partitionInformation.id] + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [partitionStatus] The status of the service fabric + * service partition. Possible values include: 'Invalid', 'Ready', + * 'NotReady', 'InQuorumLoss', 'Reconfiguring', 'Deleting' + * @member {object} [partitionInformation] Information about the partition + * identity, partitioning scheme and keys supported by it. + * @member {uuid} [partitionInformation.id] An internal ID used by Service + * Fabric to uniquely identify a partition. This is a randomly generated GUID + * when the service was created. The partition ID is unique and does not + * change for the lifetime of the service. If the same service was deleted + * and recreated the IDs of its partitions would be different. * @member {string} [partitionInformation.servicePartitionKind] Polymorphic * Discriminator * @member {string} serviceKind Polymorphic Discriminator @@ -81,6 +86,7 @@ class ServicePartitionInfo { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/servicePlacementInvalidDomainPolicyDescription.js b/lib/services/serviceFabric/lib/models/servicePlacementInvalidDomainPolicyDescription.js index d3b3d3f5f6..f24b4ce43b 100644 --- a/lib/services/serviceFabric/lib/models/servicePlacementInvalidDomainPolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/servicePlacementInvalidDomainPolicyDescription.js @@ -41,11 +41,17 @@ class ServicePlacementInvalidDomainPolicyDescription extends models['ServicePlac serializedName: 'InvalidDomain', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', className: 'ServicePlacementInvalidDomainPolicyDescription', modelProperties: { type: { required: true, serializedName: 'Type', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/servicePlacementNonPartiallyPlaceServicePolicyDescription.js b/lib/services/serviceFabric/lib/models/servicePlacementNonPartiallyPlaceServicePolicyDescription.js index 401c83359a..912f92e9a8 100644 --- a/lib/services/serviceFabric/lib/models/servicePlacementNonPartiallyPlaceServicePolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/servicePlacementNonPartiallyPlaceServicePolicyDescription.js @@ -17,7 +17,6 @@ const models = require('./index'); * where all replicas must be able to be placed in order for any replicas to be * created. * - * * @extends models['ServicePlacementPolicyDescription'] */ class ServicePlacementNonPartiallyPlaceServicePolicyDescription extends models['ServicePlacementPolicyDescription'] { @@ -40,11 +39,17 @@ class ServicePlacementNonPartiallyPlaceServicePolicyDescription extends models[' serializedName: 'NonPartiallyPlaceService', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', className: 'ServicePlacementNonPartiallyPlaceServicePolicyDescription', modelProperties: { type: { required: true, serializedName: 'Type', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/servicePlacementPolicyDescription.js b/lib/services/serviceFabric/lib/models/servicePlacementPolicyDescription.js index f4fba2ebeb..9ba27f8952 100644 --- a/lib/services/serviceFabric/lib/models/servicePlacementPolicyDescription.js +++ b/lib/services/serviceFabric/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/serviceFabric/lib/models/servicePlacementPreferPrimaryDomainPolicyDescription.js b/lib/services/serviceFabric/lib/models/servicePlacementPreferPrimaryDomainPolicyDescription.js index 60a5d5e65d..828b316944 100644 --- a/lib/services/serviceFabric/lib/models/servicePlacementPreferPrimaryDomainPolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/servicePlacementPreferPrimaryDomainPolicyDescription.js @@ -25,7 +25,6 @@ const models = require('./index'); * it is possible that the Primary replica may not end up located in this * domain due to failures, capacity limits, or other constraints. * - * * @extends models['ServicePlacementPolicyDescription'] */ class ServicePlacementPreferPrimaryDomainPolicyDescription extends models['ServicePlacementPolicyDescription'] { @@ -47,14 +46,20 @@ class ServicePlacementPreferPrimaryDomainPolicyDescription extends models['Servi mapper() { return { required: false, - serializedName: 'PreferPrimaryDomain', + serializedName: 'PreferredPrimaryDomain', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', className: 'ServicePlacementPreferPrimaryDomainPolicyDescription', modelProperties: { type: { required: true, serializedName: 'Type', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/servicePlacementRequireDomainDistributionPolicyDescription.js b/lib/services/serviceFabric/lib/models/servicePlacementRequireDomainDistributionPolicyDescription.js index 83207e2aed..6ebb133e44 100644 --- a/lib/services/serviceFabric/lib/models/servicePlacementRequireDomainDistributionPolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/servicePlacementRequireDomainDistributionPolicyDescription.js @@ -26,7 +26,6 @@ const models = require('./index'); * the remaining datacenters. If this is not desirable then this policy should * be set. * - * * @extends models['ServicePlacementPolicyDescription'] */ class ServicePlacementRequireDomainDistributionPolicyDescription extends models['ServicePlacementPolicyDescription'] { @@ -48,14 +47,20 @@ class ServicePlacementRequireDomainDistributionPolicyDescription extends models[ mapper() { return { required: false, - serializedName: 'RequireDomainDistribution', + serializedName: 'RequiredDomainDistribution', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', className: 'ServicePlacementRequireDomainDistributionPolicyDescription', modelProperties: { type: { required: true, serializedName: 'Type', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/servicePlacementRequiredDomainPolicyDescription.js b/lib/services/serviceFabric/lib/models/servicePlacementRequiredDomainPolicyDescription.js index bd83d6007c..2231ac5048 100644 --- a/lib/services/serviceFabric/lib/models/servicePlacementRequiredDomainPolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/servicePlacementRequiredDomainPolicyDescription.js @@ -38,14 +38,20 @@ class ServicePlacementRequiredDomainPolicyDescription extends models['ServicePla mapper() { return { required: false, - serializedName: 'RequireDomain', + serializedName: 'RequiredDomain', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', className: 'ServicePlacementRequiredDomainPolicyDescription', modelProperties: { type: { required: true, serializedName: 'Type', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/serviceReplicaProperties.js b/lib/services/serviceFabric/lib/models/serviceReplicaProperties.js new file mode 100644 index 0000000000..95eee1521a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceReplicaProperties.js @@ -0,0 +1,103 @@ +/* + * 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 properties of a service replica. + * + */ +class ServiceReplicaProperties { + /** + * Create a ServiceReplicaProperties. + * @member {string} osType The Operating system type required by the code in + * service. Possible values include: 'Linux', 'Windows' + * @member {array} codePackages Describes the set of code packages that forms + * the service. A code package describes the container and the properties for + * running it. All the code packages are started together on the same host + * and share the same context (network, process etc.). + * @member {array} [networkRefs] The names of the private networks that this + * service needs to be part of. + * @member {object} [diagnostics] Reference to sinks in + * DiagnosticsDescription. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.sinkRefs] List of sinks to be used if + * enabled. References the list of sinks in DiagnosticsDescription. + */ + constructor() { + } + + /** + * Defines the metadata of ServiceReplicaProperties + * + * @returns {object} metadata of ServiceReplicaProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceReplicaProperties', + type: { + name: 'Composite', + className: 'ServiceReplicaProperties', + modelProperties: { + osType: { + required: true, + serializedName: 'osType', + type: { + name: 'String' + } + }, + codePackages: { + required: true, + serializedName: 'codePackages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerCodePackagePropertiesElementType', + type: { + name: 'Composite', + className: 'ContainerCodePackageProperties' + } + } + } + }, + networkRefs: { + required: false, + serializedName: 'networkRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkRefElementType', + type: { + name: 'Composite', + className: 'NetworkRef' + } + } + } + }, + diagnostics: { + required: false, + serializedName: 'diagnostics', + type: { + name: 'Composite', + className: 'DiagnosticsRef' + } + } + } + } + }; + } +} + +module.exports = ServiceReplicaProperties; diff --git a/lib/services/serviceFabric/lib/models/serviceResourceDescription.js b/lib/services/serviceFabric/lib/models/serviceResourceDescription.js new file mode 100644 index 0000000000..c27548f4a6 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceResourceDescription.js @@ -0,0 +1,149 @@ +/* + * 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 a service fabric service resource. + * + */ +class ServiceResourceDescription { + /** + * Create a ServiceResourceDescription. + * @member {string} osType The Operating system type required by the code in + * service. Possible values include: 'Linux', 'Windows' + * @member {array} codePackages Describes the set of code packages that forms + * the service. A code package describes the container and the properties for + * running it. All the code packages are started together on the same host + * and share the same context (network, process etc.). + * @member {array} [networkRefs] The names of the private networks that this + * service needs to be part of. + * @member {object} [diagnostics] Reference to sinks in + * DiagnosticsDescription. + * @member {boolean} [diagnostics.enabled] Status of whether or not sinks are + * enabled. + * @member {array} [diagnostics.sinkRefs] List of sinks to be used if + * enabled. References the list of sinks in DiagnosticsDescription. + * @member {string} [description] User readable description of the service. + * @member {number} [replicaCount] The number of replicas of the service to + * create. Defaults to 1 if not specified. + * @member {string} [healthState] The health state of a Service Fabric entity + * such as Cluster, Node, Application, Service, Partition, Replica etc. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @member {string} [status] Represents the status of the service. Possible + * values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', + * 'Failed' + * @member {string} name Service resource name. + */ + constructor() { + } + + /** + * Defines the metadata of ServiceResourceDescription + * + * @returns {object} metadata of ServiceResourceDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceResourceDescription', + type: { + name: 'Composite', + className: 'ServiceResourceDescription', + modelProperties: { + osType: { + required: true, + serializedName: 'properties.osType', + type: { + name: 'String' + } + }, + codePackages: { + required: true, + serializedName: 'properties.codePackages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerCodePackagePropertiesElementType', + type: { + name: 'Composite', + className: 'ContainerCodePackageProperties' + } + } + } + }, + networkRefs: { + required: false, + serializedName: 'properties.networkRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkRefElementType', + type: { + name: 'Composite', + className: 'NetworkRef' + } + } + } + }, + diagnostics: { + required: false, + serializedName: 'properties.diagnostics', + type: { + name: 'Composite', + className: 'DiagnosticsRef' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + replicaCount: { + required: false, + serializedName: 'properties.replicaCount', + type: { + name: 'Number' + } + }, + healthState: { + required: false, + serializedName: 'properties.healthState', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceResourceDescription; diff --git a/lib/services/serviceFabric/lib/models/serviceResourceReplicaDescription.js b/lib/services/serviceFabric/lib/models/serviceResourceReplicaDescription.js new file mode 100644 index 0000000000..2bf9d4e8ae --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceResourceReplicaDescription.js @@ -0,0 +1,101 @@ +/* + * 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 replica of a service resource. + * + * @extends models['ServiceReplicaProperties'] + */ +class ServiceResourceReplicaDescription extends models['ServiceReplicaProperties'] { + /** + * Create a ServiceResourceReplicaDescription. + * @member {string} replicaName Name of the replica. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceResourceReplicaDescription + * + * @returns {object} metadata of ServiceResourceReplicaDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceResourceReplicaDescription', + type: { + name: 'Composite', + className: 'ServiceResourceReplicaDescription', + modelProperties: { + osType: { + required: true, + serializedName: 'osType', + type: { + name: 'String' + } + }, + codePackages: { + required: true, + serializedName: 'codePackages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerCodePackagePropertiesElementType', + type: { + name: 'Composite', + className: 'ContainerCodePackageProperties' + } + } + } + }, + networkRefs: { + required: false, + serializedName: 'networkRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkRefElementType', + type: { + name: 'Composite', + className: 'NetworkRef' + } + } + } + }, + diagnostics: { + required: false, + serializedName: 'diagnostics', + type: { + name: 'Composite', + className: 'DiagnosticsRef' + } + }, + replicaName: { + required: true, + serializedName: 'replicaName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceResourceReplicaDescription; diff --git a/lib/services/serviceFabric/lib/models/serviceTypeDescription.js b/lib/services/serviceFabric/lib/models/serviceTypeDescription.js index ca8b02bc13..eda10f6f14 100644 --- a/lib/services/serviceFabric/lib/models/serviceTypeDescription.js +++ b/lib/services/serviceFabric/lib/models/serviceTypeDescription.js @@ -10,12 +10,9 @@ 'use strict'; -const models = require('./index'); - /** * Describes a service type defined in the service manifest of a provisioned - * application type. The properties the the ones defined in the service - * manifest. + * application type. The properties the ones defined in the service manifest. * */ class ServiceTypeDescription { @@ -24,11 +21,15 @@ class ServiceTypeDescription { * @member {boolean} [isStateful] Indicates whether the service type is a * stateful service type or a stateless service type. This property is true * if the service type is a stateful service type, false otherwise. - * @member {string} [serviceTypeName] + * @member {string} [serviceTypeName] Name of the service type as specified + * in the service manifest. * @member {string} [placementConstraints] The placement constraint to be * used when instantiating this service in a Service Fabric cluster. - * @member {array} [servicePlacementPolicies] - * @member {array} [extensions] + * @member {array} [loadMetrics] The service load metrics is given as an + * array of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] List of service placement + * policy descriptions. + * @member {array} [extensions] List of service type extensions. * @member {string} kind Polymorphic Discriminator */ constructor() { @@ -74,6 +75,21 @@ class ServiceTypeDescription { name: 'String' } }, + loadMetrics: { + required: false, + serializedName: 'LoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, servicePlacementPolicies: { required: false, serializedName: 'ServicePlacementPolicies', @@ -112,6 +128,7 @@ class ServiceTypeDescription { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicy.js b/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicy.js index d648a4398a..081566f2f2 100644 --- a/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicy.js +++ b/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicy.js @@ -14,7 +14,6 @@ * Represents the health policy used to evaluate the health of services * belonging to a service type. * - * */ class ServiceTypeHealthPolicy { /** @@ -30,8 +29,7 @@ class ServiceTypeHealthPolicy { * 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 . + * 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. @@ -43,8 +41,7 @@ class ServiceTypeHealthPolicy { * 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 . + * 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. @@ -57,8 +54,7 @@ class ServiceTypeHealthPolicy { * 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. - * . Default value: 0 . + * services. Default percentage is zero. Default value: 0 . */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicyMapItem.js b/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicyMapItem.js index eb750c74f5..1c90c808b3 100644 --- a/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicyMapItem.js +++ b/lib/services/serviceFabric/lib/models/serviceTypeHealthPolicyMapItem.js @@ -10,19 +10,17 @@ 'use strict'; -const models = require('./index'); - /** * Defines an item in ServiceTypeHealthPolicyMap. * - * */ class ServiceTypeHealthPolicyMapItem { /** * Create a ServiceTypeHealthPolicyMapItem. * @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 {object} value The value of the service type health policy map + * item. This is the ServiceTypeHealthPolicy for this service type. * @member {number} [value.maxPercentUnhealthyPartitionsPerService] The * maximum allowed percentage of unhealthy partitions per service. Allowed * values are Byte values from zero to 100 diff --git a/lib/services/serviceFabric/lib/models/serviceTypeInfo.js b/lib/services/serviceFabric/lib/models/serviceTypeInfo.js index 65573ed30e..867f80bb34 100644 --- a/lib/services/serviceFabric/lib/models/serviceTypeInfo.js +++ b/lib/services/serviceFabric/lib/models/serviceTypeInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a service type that is defined in a service manifest of a * provisioned application type. @@ -20,19 +18,27 @@ const models = require('./index'); class ServiceTypeInfo { /** * Create a ServiceTypeInfo. - * @member {object} [serviceTypeDescription] + * @member {object} [serviceTypeDescription] Describes a service type defined + * in the service manifest of a provisioned application type. The properties + * the ones defined in the service manifest. * @member {boolean} [serviceTypeDescription.isStateful] Indicates whether * the service type is a stateful service type or a stateless service type. * This property is true if the service type is a stateful service type, * false otherwise. - * @member {string} [serviceTypeDescription.serviceTypeName] + * @member {string} [serviceTypeDescription.serviceTypeName] Name of the + * service type as specified in the service manifest. * @member {string} [serviceTypeDescription.placementConstraints] The * placement constraint to be used when instantiating this service in a * Service Fabric cluster. - * @member {array} [serviceTypeDescription.servicePlacementPolicies] - * @member {array} [serviceTypeDescription.extensions] + * @member {array} [serviceTypeDescription.loadMetrics] The service load + * metrics is given as an array of ServiceLoadMetricDescription objects. + * @member {array} [serviceTypeDescription.servicePlacementPolicies] List of + * service placement policy descriptions. + * @member {array} [serviceTypeDescription.extensions] List of service type + * extensions. * @member {string} [serviceTypeDescription.kind] Polymorphic Discriminator - * @member {string} [serviceManifestName] + * @member {string} [serviceManifestName] The name of the service manifest in + * which this service type is defined. * @member {string} [serviceManifestVersion] The version of the service * manifest in which this service type is defined. * @member {boolean} [isServiceGroup] Indicates whether the service is a diff --git a/lib/services/serviceFabric/lib/models/serviceUpdateDescription.js b/lib/services/serviceFabric/lib/models/serviceUpdateDescription.js index 337c081a16..ddda9e9132 100644 --- a/lib/services/serviceFabric/lib/models/serviceUpdateDescription.js +++ b/lib/services/serviceFabric/lib/models/serviceUpdateDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A ServiceUpdateDescription contains all of the information necessary to * update a service. @@ -51,16 +49,19 @@ class ServiceUpdateDescription { * 256. * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The * value is 512. + * - ScalingPolicy - Indicates the ScalingPolicies property is set. The value + * is 1024. * @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} [loadMetrics] - * @member {array} [servicePlacementPolicies] - * @member {string} [defaultMoveCost] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' + * @member {array} [correlationScheme] The correlation scheme. + * @member {array} [loadMetrics] The service load metrics. + * @member {array} [servicePlacementPolicies] The service placement policies. + * @member {string} [defaultMoveCost] The move cost for the service. Possible + * values include: 'Zero', 'Low', 'Medium', 'High' + * @member {array} [scalingPolicies] Scaling policies for this service. * @member {string} serviceKind Polymorphic Discriminator */ constructor() { @@ -156,9 +157,25 @@ class ServiceUpdateDescription { name: 'String' } }, + scalingPolicies: { + required: false, + serializedName: 'ScalingPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ScalingPolicyDescriptionElementType', + type: { + name: 'Composite', + className: 'ScalingPolicyDescription' + } + } + } + }, serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/servicesHealthEvaluation.js b/lib/services/serviceFabric/lib/models/servicesHealthEvaluation.js index a5ba50c817..e4fb653537 100644 --- a/lib/services/serviceFabric/lib/models/servicesHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/servicesHealthEvaluation.js @@ -30,7 +30,9 @@ class ServicesHealthEvaluation extends models['HealthEvaluation'] { * of unhealthy services from the ServiceTypeHealthPolicy. * @member {number} [totalCount] Total number of services of the current * service type in the application from the health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * ServiceHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -48,6 +50,11 @@ class ServicesHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'Services', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'ServicesHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -67,6 +74,7 @@ class ServicesHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/setting.js b/lib/services/serviceFabric/lib/models/setting.js new file mode 100644 index 0000000000..08c2599bd0 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/setting.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'; + +/** + * Describes a setting for the container. + * + */ +class Setting { + /** + * Create a Setting. + * @member {string} [name] The name of the setting. + * @member {string} [value] The value of the setting. + */ + constructor() { + } + + /** + * Defines the metadata of Setting + * + * @returns {object} metadata of Setting + * + */ + mapper() { + return { + required: false, + serializedName: 'Setting', + type: { + name: 'Composite', + className: 'Setting', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Setting; diff --git a/lib/services/serviceFabric/lib/models/singletonPartitionInformation.js b/lib/services/serviceFabric/lib/models/singletonPartitionInformation.js index 26ad6662b0..a82a990aaf 100644 --- a/lib/services/serviceFabric/lib/models/singletonPartitionInformation.js +++ b/lib/services/serviceFabric/lib/models/singletonPartitionInformation.js @@ -13,9 +13,9 @@ const models = require('./index'); /** - * Information about a partition that is singleton. The services with - * singletone partitioning scheme are effectively non-partitioned. They only - * have one partition. + * Information about a partition that is singleton. The services with singleton + * partitioning scheme are effectively non-partitioned. They only have one + * partition. * * @extends models['PartitionInformation'] */ @@ -39,6 +39,11 @@ class SingletonPartitionInformation extends models['PartitionInformation'] { serializedName: 'Singleton', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServicePartitionKind', + clientName: 'servicePartitionKind' + }, + uberParent: 'PartitionInformation', className: 'SingletonPartitionInformation', modelProperties: { id: { @@ -51,6 +56,7 @@ class SingletonPartitionInformation extends models['PartitionInformation'] { servicePartitionKind: { required: true, serializedName: 'ServicePartitionKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/singletonPartitionSchemeDescription.js b/lib/services/serviceFabric/lib/models/singletonPartitionSchemeDescription.js index fe7bf2ef28..0a78a78081 100644 --- a/lib/services/serviceFabric/lib/models/singletonPartitionSchemeDescription.js +++ b/lib/services/serviceFabric/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/serviceFabric/lib/models/startClusterUpgradeDescription.js b/lib/services/serviceFabric/lib/models/startClusterUpgradeDescription.js index c8ee891a77..c6393af68e 100644 --- a/lib/services/serviceFabric/lib/models/startClusterUpgradeDescription.js +++ b/lib/services/serviceFabric/lib/models/startClusterUpgradeDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the parameters for starting a cluster upgrade. * @@ -21,23 +19,62 @@ class StartClusterUpgradeDescription { * Create a StartClusterUpgradeDescription. * @member {string} [codeVersion] The cluster code version. * @member {string} [configVersion] The cluster configuration version. - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling'. Default value: 'Rolling' . - * @member {string} [rollingUpgradeMode] Possible values include: 'Invalid', + * @member {string} [upgradeKind] The kind of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling'. Default + * value: 'Rolling' . + * @member {string} [rollingUpgradeMode] The mode used to monitor health + * during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. Default value: * 'UnmonitoredAuto' . - * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] - * @member {boolean} [forceRestart] - * @member {object} [monitoringPolicy] - * @member {string} [monitoringPolicy.failureAction] Possible values include: - * 'Invalid', 'Rollback', 'Manual' + * @member {number} [upgradeReplicaSetCheckTimeoutInSeconds] 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} [monitoringPolicy] Describes the parameters for + * monitoring an upgrade in Monitored mode. + * @member {string} [monitoringPolicy.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} - * [monitoringPolicy.healthCheckStableDurationInMilliseconds] + * [monitoringPolicy.healthCheckStableDurationInMilliseconds] 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} [monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeTimeoutInMilliseconds] - * @member {string} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * @member {object} [clusterHealthPolicy] + * 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} [monitoringPolicy.upgradeTimeoutInMilliseconds] 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} [monitoringPolicy.upgradeDomainTimeoutInMilliseconds] 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} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The @@ -72,10 +109,34 @@ class StartClusterUpgradeDescription { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * @member {boolean} [enableDeltaHealthEvaluation] When true, enables delta * health evaluation rather than absolute health evaluation after completion * of each upgrade domain. - * @member {object} [clusterUpgradeHealthPolicy] + * @member {object} [clusterUpgradeHealthPolicy] Defines a health policy used + * to evaluate the health of the cluster during a cluster upgrade. * @member {number} * [clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] The maximum * allowed percentage of nodes health degradation allowed during cluster @@ -93,8 +154,12 @@ class StartClusterUpgradeDescription { * 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. The default value is 15%. - * @member {object} [applicationHealthPolicyMap] + * @member {object} [applicationHealthPolicyMap] Defines the application + * health policy map used to evaluate the health of an application or one of + * its children entities. * @member {array} [applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/startedChaosEvent.js b/lib/services/serviceFabric/lib/models/startedChaosEvent.js index 4db567c20e..a4595e8349 100644 --- a/lib/services/serviceFabric/lib/models/startedChaosEvent.js +++ b/lib/services/serviceFabric/lib/models/startedChaosEvent.js @@ -20,7 +20,8 @@ const models = require('./index'); class StartedChaosEvent extends models['ChaosEvent'] { /** * Create a StartedChaosEvent. - * @member {object} [chaosParameters] + * @member {object} [chaosParameters] Defines all the parameters to configure + * a Chaos run. * @member {string} [chaosParameters.timeToRunInSeconds] Total time (in * seconds) for which Chaos will run before automatically stopping. The * maximum allowed value is 4,294,967,295 (System.UInt32.MaxValue). @@ -35,8 +36,8 @@ class StartedChaosEvent extends models['ChaosEvent'] { * is the maximum number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated * by a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise * caution while moving up. * @member {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or @@ -50,7 +51,12 @@ class StartedChaosEvent extends models['ChaosEvent'] { * @member {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] * Time-separation (in seconds) between two consecutive iterations of Chaos. * The larger the value, the lower the fault injection rate. - * @member {object} [chaosParameters.clusterHealthPolicy] + * @member {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected + * exception happens during fault execution--to provide the cluster with some + * time to recuperate--Chaos will wait for 30 minutes before the next + * health-check. * @member {boolean} * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. @@ -88,8 +94,77 @@ class StartedChaosEvent extends models['ChaosEvent'] { * applications. Default percentage is zero. * @member {array} * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {object} [chaosParameters.context] - * @member {object} [chaosParameters.context.map] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used + * to record information about + * the Chaos run. There cannot be more than 100 such pairs and each string + * (key or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * @member {object} [chaosParameters.context.map] Describes a map that + * contains a collection of ChaosContextMapItem's. + * @member {object} [chaosParameters.chaosTargetFilter] List of cluster + * entities to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types + * or only to certain application instances. If ChaosTargetFilter is not + * used, Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * @member {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] + * A list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the + * nodes of these node types. + * If a nodetype (say NodeTypeX) does not appear in the + * NodeTypeInclusionList, then node level faults (like NodeRestart) will + * never be enabled for the nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * @member {array} + * [chaosParameters.chaosTargetFilter.applicationInclusionList] A list of + * application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas + * of these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement + * constraints and applicationX is absent from ApplicationInclusionList and + * nodeTypeY is absent from NodeTypeInclusionList, then applicationX will + * never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. */ constructor() { super(); @@ -107,6 +182,11 @@ class StartedChaosEvent extends models['ChaosEvent'] { serializedName: 'Started', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ChaosEvent', className: 'StartedChaosEvent', modelProperties: { timeStampUtc: { @@ -119,6 +199,7 @@ class StartedChaosEvent extends models['ChaosEvent'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportCreatedEvent.js new file mode 100644 index 0000000000..c935d5aa3a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportCreatedEvent.js @@ -0,0 +1,168 @@ +/* + * 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'); + +/** + * Stateful Replica Health Report Created event. + * + * @extends models['ReplicaEvent'] + */ +class StatefulReplicaHealthReportCreatedEvent extends models['ReplicaEvent'] { + /** + * Create a StatefulReplicaHealthReportCreatedEvent. + * @member {number} replicaInstanceId Id of Replica instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatefulReplicaHealthReportCreatedEvent + * + * @returns {object} metadata of StatefulReplicaHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'StatefulReplicaHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'StatefulReplicaHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + }, + replicaInstanceId: { + required: true, + serializedName: 'ReplicaInstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = StatefulReplicaHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportExpiredEvent.js new file mode 100644 index 0000000000..924b50773b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportExpiredEvent.js @@ -0,0 +1,168 @@ +/* + * 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'); + +/** + * Stateful Replica Health Report Expired event. + * + * @extends models['ReplicaEvent'] + */ +class StatefulReplicaHealthReportExpiredEvent extends models['ReplicaEvent'] { + /** + * Create a StatefulReplicaHealthReportExpiredEvent. + * @member {number} replicaInstanceId Id of Replica instance. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatefulReplicaHealthReportExpiredEvent + * + * @returns {object} metadata of StatefulReplicaHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'StatefulReplicaHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'StatefulReplicaHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + }, + replicaInstanceId: { + required: true, + serializedName: 'ReplicaInstanceId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = StatefulReplicaHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/statefulServiceDescription.js b/lib/services/serviceFabric/lib/models/statefulServiceDescription.js index 74ecc7c3bd..145d04182f 100644 --- a/lib/services/serviceFabric/lib/models/statefulServiceDescription.js +++ b/lib/services/serviceFabric/lib/models/statefulServiceDescription.js @@ -67,6 +67,11 @@ class StatefulServiceDescription extends models['ServiceDescription'] { serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceDescription', className: 'StatefulServiceDescription', modelProperties: { applicationName: { @@ -202,9 +207,25 @@ class StatefulServiceDescription extends models['ServiceDescription'] { name: 'String' } }, + scalingPolicies: { + required: false, + serializedName: 'ScalingPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ScalingPolicyDescriptionElementType', + type: { + name: 'Composite', + className: 'ScalingPolicyDescription' + } + } + } + }, serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulServiceInfo.js b/lib/services/serviceFabric/lib/models/statefulServiceInfo.js index 0fc3f12655..d401e974f7 100644 --- a/lib/services/serviceFabric/lib/models/statefulServiceInfo.js +++ b/lib/services/serviceFabric/lib/models/statefulServiceInfo.js @@ -39,6 +39,11 @@ class StatefulServiceInfo extends models['ServiceInfo'] { serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceInfo', className: 'StatefulServiceInfo', modelProperties: { id: { @@ -93,6 +98,7 @@ class StatefulServiceInfo extends models['ServiceInfo'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js b/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js index 00ae32b202..90938bc300 100644 --- a/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js +++ b/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js @@ -28,7 +28,11 @@ class StatefulServicePartitionInfo extends models['ServicePartitionInfo'] { * this partition was in quorum loss. If the partition is currently in quorum * loss, it returns the duration since it has been in that state. This field * is using ISO8601 format for specifying the duration. - * @member {object} [currentConfigurationEpoch] + * @member {object} [currentConfigurationEpoch] An Epoch is a configuration + * number for the partition as a whole. When the configuration of the replica + * set changes, for example when the Primary replica changes, the operations + * that are replicated from the new Primary replica are said to be a new + * Epoch from the ones which were sent by the old Primary replica. * @member {string} [currentConfigurationEpoch.configurationVersion] The * current configuration number of this Epoch. The configuration number is an * increasing value that is updated whenever the configuration of this @@ -55,6 +59,11 @@ class StatefulServicePartitionInfo extends models['ServicePartitionInfo'] { serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServicePartitionInfo', className: 'StatefulServicePartitionInfo', modelProperties: { healthState: { @@ -87,6 +96,7 @@ class StatefulServicePartitionInfo extends models['ServicePartitionInfo'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealth.js b/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealth.js index 9b83415194..c3bcb44329 100644 --- a/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealth.js +++ b/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealth.js @@ -17,13 +17,18 @@ const models = require('./index'); * Contains the replica aggregated health state, the health events and the * unhealthy evaluations. * - * * @extends models['ReplicaHealth'] */ class StatefulServiceReplicaHealth extends models['ReplicaHealth'] { /** * Create a StatefulServiceReplicaHealth. - * @member {string} [replicaId] + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId + * is used by Service Fabric to uniquely identify a replica of a partition. + * It is unique within a partition and does not change for the lifetime of + * the replica. If a replica gets dropped and another replica gets created on + * the same node for the same partition, it will get a different value for + * the id. Sometimes the id of a stateless service instance is also referred + * as a replica id. */ constructor() { super(); @@ -41,6 +46,11 @@ class StatefulServiceReplicaHealth extends models['ReplicaHealth'] { serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'EntityHealth', className: 'StatefulServiceReplicaHealth', modelProperties: { aggregatedHealthState: { @@ -98,6 +108,7 @@ class StatefulServiceReplicaHealth extends models['ReplicaHealth'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealthState.js b/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealthState.js index 73d1bd29c7..aa27b4af1e 100644 --- a/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealthState.js +++ b/lib/services/serviceFabric/lib/models/statefulServiceReplicaHealthState.js @@ -14,14 +14,20 @@ const models = require('./index'); /** * Represents the health state of the stateful service replica, which contains - * the replica id and the aggregated health state. + * the replica ID and the aggregated health state. * * @extends models['ReplicaHealthState'] */ class StatefulServiceReplicaHealthState extends models['ReplicaHealthState'] { /** * Create a StatefulServiceReplicaHealthState. - * @member {string} [replicaId] + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId + * is used by Service Fabric to uniquely identify a replica of a partition. + * It is unique within a partition and does not change for the lifetime of + * the replica. If a replica gets dropped and another replica gets created on + * the same node for the same partition, it will get a different value for + * the id. Sometimes the id of a stateless service instance is also referred + * as a replica id. */ constructor() { super(); @@ -39,6 +45,11 @@ class StatefulServiceReplicaHealthState extends models['ReplicaHealthState'] { serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'EntityHealthState', className: 'StatefulServiceReplicaHealthState', modelProperties: { aggregatedHealthState: { @@ -58,6 +69,7 @@ class StatefulServiceReplicaHealthState extends models['ReplicaHealthState'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulServiceReplicaInfo.js b/lib/services/serviceFabric/lib/models/statefulServiceReplicaInfo.js index 484ce9381e..2b09d5f3cf 100644 --- a/lib/services/serviceFabric/lib/models/statefulServiceReplicaInfo.js +++ b/lib/services/serviceFabric/lib/models/statefulServiceReplicaInfo.js @@ -22,9 +22,16 @@ const models = require('./index'); class StatefulServiceReplicaInfo extends models['ReplicaInfo'] { /** * Create a StatefulServiceReplicaInfo. - * @member {string} [replicaRole] Possible values include: 'Unknown', 'None', - * 'Primary', 'IdleSecondary', 'ActiveSecondary' - * @member {string} [replicaId] + * @member {string} [replicaRole] The role of a replica of a stateful + * service. Possible values include: 'Unknown', 'None', 'Primary', + * 'IdleSecondary', 'ActiveSecondary' + * @member {string} [replicaId] Id of a stateful service replica. ReplicaId + * is used by Service Fabric to uniquely identify a replica of a partition. + * It is unique within a partition and does not change for the lifetime of + * the replica. If a replica gets dropped and another replica gets created on + * the same node for the same partition, it will get a different value for + * the id. Sometimes the id of a stateless service instance is also referred + * as a replica id. */ constructor() { super(); @@ -42,6 +49,11 @@ class StatefulServiceReplicaInfo extends models['ReplicaInfo'] { serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ReplicaInfo', className: 'StatefulServiceReplicaInfo', modelProperties: { replicaStatus: { @@ -82,6 +94,7 @@ class StatefulServiceReplicaInfo extends models['ReplicaInfo'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulServiceTypeDescription.js b/lib/services/serviceFabric/lib/models/statefulServiceTypeDescription.js index 344ceb7ee9..a7790210eb 100644 --- a/lib/services/serviceFabric/lib/models/statefulServiceTypeDescription.js +++ b/lib/services/serviceFabric/lib/models/statefulServiceTypeDescription.js @@ -41,6 +41,11 @@ class StatefulServiceTypeDescription extends models['ServiceTypeDescription'] { serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ServiceTypeDescription', className: 'StatefulServiceTypeDescription', modelProperties: { isStateful: { @@ -64,6 +69,21 @@ class StatefulServiceTypeDescription extends models['ServiceTypeDescription'] { name: 'String' } }, + loadMetrics: { + required: false, + serializedName: 'LoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, servicePlacementPolicies: { required: false, serializedName: 'ServicePlacementPolicies', @@ -102,6 +122,7 @@ class StatefulServiceTypeDescription extends models['ServiceTypeDescription'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statefulServiceUpdateDescription.js b/lib/services/serviceFabric/lib/models/statefulServiceUpdateDescription.js index 8fff473ae9..df7c70df5c 100644 --- a/lib/services/serviceFabric/lib/models/statefulServiceUpdateDescription.js +++ b/lib/services/serviceFabric/lib/models/statefulServiceUpdateDescription.js @@ -48,6 +48,11 @@ class StatefulServiceUpdateDescription extends models['ServiceUpdateDescription' serializedName: 'Stateful', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceUpdateDescription', className: 'StatefulServiceUpdateDescription', modelProperties: { flags: { @@ -121,9 +126,25 @@ class StatefulServiceUpdateDescription extends models['ServiceUpdateDescription' name: 'String' } }, + scalingPolicies: { + required: false, + serializedName: 'ScalingPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ScalingPolicyDescriptionElementType', + type: { + name: 'Composite', + className: 'ScalingPolicyDescription' + } + } + } + }, serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportCreatedEvent.js b/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportCreatedEvent.js new file mode 100644 index 0000000000..0c59c03bde --- /dev/null +++ b/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportCreatedEvent.js @@ -0,0 +1,160 @@ +/* + * 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'); + +/** + * Stateless Replica Health Report Created event. + * + * @extends models['ReplicaEvent'] + */ +class StatelessReplicaHealthReportCreatedEvent extends models['ReplicaEvent'] { + /** + * Create a StatelessReplicaHealthReportCreatedEvent. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatelessReplicaHealthReportCreatedEvent + * + * @returns {object} metadata of StatelessReplicaHealthReportCreatedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'StatelessReplicaHealthReportCreated', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'StatelessReplicaHealthReportCreatedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = StatelessReplicaHealthReportCreatedEvent; diff --git a/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportExpiredEvent.js new file mode 100644 index 0000000000..6b9232a954 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportExpiredEvent.js @@ -0,0 +1,160 @@ +/* + * 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'); + +/** + * Stateless Replica Health Report Expired event. + * + * @extends models['ReplicaEvent'] + */ +class StatelessReplicaHealthReportExpiredEvent extends models['ReplicaEvent'] { + /** + * Create a StatelessReplicaHealthReportExpiredEvent. + * @member {string} sourceId Id of report source. + * @member {string} property Describes the property. + * @member {string} healthState Describes the property health state. + * @member {number} timeToLiveMs Time to live in milli-seconds. + * @member {number} sequenceNumber Sequence number of report. + * @member {string} description Description of report. + * @member {boolean} removeWhenExpired Indicates the removal when it expires. + * @member {date} sourceUtcTimestamp Source time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatelessReplicaHealthReportExpiredEvent + * + * @returns {object} metadata of StatelessReplicaHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'StatelessReplicaHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'StatelessReplicaHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + timeStamp: { + required: true, + serializedName: 'TimeStamp', + type: { + name: 'DateTime' + } + }, + hasCorrelatedEvents: { + required: false, + serializedName: 'HasCorrelatedEvents', + type: { + name: 'Boolean' + } + }, + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + partitionId: { + required: true, + serializedName: 'PartitionId', + type: { + name: 'String' + } + }, + replicaId: { + required: true, + serializedName: 'ReplicaId', + type: { + name: 'Number' + } + }, + sourceId: { + required: true, + serializedName: 'SourceId', + type: { + name: 'String' + } + }, + property: { + required: true, + serializedName: 'Property', + type: { + name: 'String' + } + }, + healthState: { + required: true, + serializedName: 'HealthState', + type: { + name: 'String' + } + }, + timeToLiveMs: { + required: true, + serializedName: 'TimeToLiveMs', + type: { + name: 'Number' + } + }, + sequenceNumber: { + required: true, + serializedName: 'SequenceNumber', + type: { + name: 'Number' + } + }, + description: { + required: true, + serializedName: 'Description', + type: { + name: 'String' + } + }, + removeWhenExpired: { + required: true, + serializedName: 'RemoveWhenExpired', + type: { + name: 'Boolean' + } + }, + sourceUtcTimestamp: { + required: true, + serializedName: 'SourceUtcTimestamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = StatelessReplicaHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/statelessServiceDescription.js b/lib/services/serviceFabric/lib/models/statelessServiceDescription.js index d19c102376..896acf7119 100644 --- a/lib/services/serviceFabric/lib/models/statelessServiceDescription.js +++ b/lib/services/serviceFabric/lib/models/statelessServiceDescription.js @@ -38,6 +38,11 @@ class StatelessServiceDescription extends models['ServiceDescription'] { serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceDescription', className: 'StatelessServiceDescription', modelProperties: { applicationName: { @@ -173,9 +178,25 @@ class StatelessServiceDescription extends models['ServiceDescription'] { name: 'String' } }, + scalingPolicies: { + required: false, + serializedName: 'ScalingPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ScalingPolicyDescriptionElementType', + type: { + name: 'Composite', + className: 'ScalingPolicyDescription' + } + } + } + }, serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessServiceInfo.js b/lib/services/serviceFabric/lib/models/statelessServiceInfo.js index fb3ee7dba9..33d5bb6429 100644 --- a/lib/services/serviceFabric/lib/models/statelessServiceInfo.js +++ b/lib/services/serviceFabric/lib/models/statelessServiceInfo.js @@ -37,6 +37,11 @@ class StatelessServiceInfo extends models['ServiceInfo'] { serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceInfo', className: 'StatelessServiceInfo', modelProperties: { id: { @@ -91,6 +96,7 @@ class StatelessServiceInfo extends models['ServiceInfo'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealth.js b/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealth.js index 1ad1eba3db..d3db4de300 100644 --- a/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealth.js +++ b/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealth.js @@ -13,17 +13,21 @@ const models = require('./index'); /** - * Represents the health of the statelss service instance. + * Represents the health of the stateless service instance. * Contains the instance aggregated health state, the health events and the * unhealthy evaluations. * - * * @extends models['ReplicaHealth'] */ class StatelessServiceInstanceHealth extends models['ReplicaHealth'] { /** * Create a StatelessServiceInstanceHealth. - * @member {string} [instanceId] + * @member {string} [instanceId] Id of a stateless service instance. + * InstanceId is used by Service Fabric to uniquely identify an instance of a + * partition of a stateless service. It is unique within a partition and does + * not change for the lifetime of the instance. If the instance has failed + * over on the same or different node, it will get a different value for the + * InstanceId. */ constructor() { super(); @@ -41,6 +45,11 @@ class StatelessServiceInstanceHealth extends models['ReplicaHealth'] { serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'EntityHealth', className: 'StatelessServiceInstanceHealth', modelProperties: { aggregatedHealthState: { @@ -98,6 +107,7 @@ class StatelessServiceInstanceHealth extends models['ReplicaHealth'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealthState.js b/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealthState.js index 6e962cf108..70bc066e97 100644 --- a/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealthState.js +++ b/lib/services/serviceFabric/lib/models/statelessServiceInstanceHealthState.js @@ -14,14 +14,15 @@ const models = require('./index'); /** * Represents the health state of the stateless service instance, which - * contains the instance id and the aggregated health state. + * contains the instance ID and the aggregated health state. * * @extends models['ReplicaHealthState'] */ class StatelessServiceInstanceHealthState extends models['ReplicaHealthState'] { /** * Create a StatelessServiceInstanceHealthState. - * @member {string} [replicaId] + * @member {string} [replicaId] Id of the stateless service instance on the + * wire this field is called ReplicaId. */ constructor() { super(); @@ -39,6 +40,11 @@ class StatelessServiceInstanceHealthState extends models['ReplicaHealthState'] { serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'EntityHealthState', className: 'StatelessServiceInstanceHealthState', modelProperties: { aggregatedHealthState: { @@ -58,6 +64,7 @@ class StatelessServiceInstanceHealthState extends models['ReplicaHealthState'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessServiceInstanceInfo.js b/lib/services/serviceFabric/lib/models/statelessServiceInstanceInfo.js index edace5e426..e69e1aa4f4 100644 --- a/lib/services/serviceFabric/lib/models/statelessServiceInstanceInfo.js +++ b/lib/services/serviceFabric/lib/models/statelessServiceInstanceInfo.js @@ -22,7 +22,12 @@ const models = require('./index'); class StatelessServiceInstanceInfo extends models['ReplicaInfo'] { /** * Create a StatelessServiceInstanceInfo. - * @member {string} [instanceId] + * @member {string} [instanceId] Id of a stateless service instance. + * InstanceId is used by Service Fabric to uniquely identify an instance of a + * partition of a stateless service. It is unique within a partition and does + * not change for the lifetime of the instance. If the instance has failed + * over on the same or different node, it will get a different value for the + * InstanceId. */ constructor() { super(); @@ -40,6 +45,11 @@ class StatelessServiceInstanceInfo extends models['ReplicaInfo'] { serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ReplicaInfo', className: 'StatelessServiceInstanceInfo', modelProperties: { replicaStatus: { @@ -80,6 +90,7 @@ class StatelessServiceInstanceInfo extends models['ReplicaInfo'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessServicePartitionInfo.js b/lib/services/serviceFabric/lib/models/statelessServicePartitionInfo.js index d68d1152e8..40991cc99e 100644 --- a/lib/services/serviceFabric/lib/models/statelessServicePartitionInfo.js +++ b/lib/services/serviceFabric/lib/models/statelessServicePartitionInfo.js @@ -38,6 +38,11 @@ class StatelessServicePartitionInfo extends models['ServicePartitionInfo'] { serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServicePartitionInfo', className: 'StatelessServicePartitionInfo', modelProperties: { healthState: { @@ -70,6 +75,7 @@ class StatelessServicePartitionInfo extends models['ServicePartitionInfo'] { serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessServiceTypeDescription.js b/lib/services/serviceFabric/lib/models/statelessServiceTypeDescription.js index ea1a6470c8..035c44f18c 100644 --- a/lib/services/serviceFabric/lib/models/statelessServiceTypeDescription.js +++ b/lib/services/serviceFabric/lib/models/statelessServiceTypeDescription.js @@ -42,6 +42,11 @@ class StatelessServiceTypeDescription extends models['ServiceTypeDescription'] { serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ServiceTypeDescription', className: 'StatelessServiceTypeDescription', modelProperties: { isStateful: { @@ -65,6 +70,21 @@ class StatelessServiceTypeDescription extends models['ServiceTypeDescription'] { name: 'String' } }, + loadMetrics: { + required: false, + serializedName: 'LoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, servicePlacementPolicies: { required: false, serializedName: 'ServicePlacementPolicies', @@ -103,6 +123,7 @@ class StatelessServiceTypeDescription extends models['ServiceTypeDescription'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/statelessServiceUpdateDescription.js b/lib/services/serviceFabric/lib/models/statelessServiceUpdateDescription.js index d9c7e59b56..64f81cd0c0 100644 --- a/lib/services/serviceFabric/lib/models/statelessServiceUpdateDescription.js +++ b/lib/services/serviceFabric/lib/models/statelessServiceUpdateDescription.js @@ -38,6 +38,11 @@ class StatelessServiceUpdateDescription extends models['ServiceUpdateDescription serializedName: 'Stateless', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ServiceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceUpdateDescription', className: 'StatelessServiceUpdateDescription', modelProperties: { flags: { @@ -111,9 +116,25 @@ class StatelessServiceUpdateDescription extends models['ServiceUpdateDescription name: 'String' } }, + scalingPolicies: { + required: false, + serializedName: 'ScalingPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ScalingPolicyDescriptionElementType', + type: { + name: 'Composite', + className: 'ScalingPolicyDescription' + } + } + } + }, serviceKind: { required: true, serializedName: 'ServiceKind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/stoppedChaosEvent.js b/lib/services/serviceFabric/lib/models/stoppedChaosEvent.js index a2ab2b4f6c..82543c6094 100644 --- a/lib/services/serviceFabric/lib/models/stoppedChaosEvent.js +++ b/lib/services/serviceFabric/lib/models/stoppedChaosEvent.js @@ -21,7 +21,9 @@ const models = require('./index'); class StoppedChaosEvent extends models['ChaosEvent'] { /** * Create a StoppedChaosEvent. - * @member {string} [reason] + * @member {string} [reason] Describes why Chaos stopped. Chaos can stop + * because of StopChaos API call or the timeToRun provided in ChaosParameters + * is over. */ constructor() { super(); @@ -39,6 +41,11 @@ class StoppedChaosEvent extends models['ChaosEvent'] { serializedName: 'Stopped', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ChaosEvent', className: 'StoppedChaosEvent', modelProperties: { timeStampUtc: { @@ -51,6 +58,7 @@ class StoppedChaosEvent extends models['ChaosEvent'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/stringPropertyValue.js b/lib/services/serviceFabric/lib/models/stringPropertyValue.js new file mode 100644 index 0000000000..7bcaab42ab --- /dev/null +++ b/lib/services/serviceFabric/lib/models/stringPropertyValue.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Service Fabric property value of type String. + * + * @extends models['PropertyValue'] + */ +class StringPropertyValue extends models['PropertyValue'] { + /** + * Create a StringPropertyValue. + * @member {string} data The data of the property value. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StringPropertyValue + * + * @returns {object} metadata of StringPropertyValue + * + */ + mapper() { + return { + required: false, + serializedName: 'String', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyValue', + className: 'StringPropertyValue', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + data: { + required: true, + serializedName: 'Data', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = StringPropertyValue; diff --git a/lib/services/serviceFabric/lib/models/successfulPropertyBatchInfo.js b/lib/services/serviceFabric/lib/models/successfulPropertyBatchInfo.js new file mode 100644 index 0000000000..5231d571ab --- /dev/null +++ b/lib/services/serviceFabric/lib/models/successfulPropertyBatchInfo.js @@ -0,0 +1,82 @@ +/* + * 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'); + +/** + * Derived from PropertyBatchInfo. Represents the property batch succeeding. + * Contains the results of any "Get" operations in the batch. + * + * @extends models['PropertyBatchInfo'] + */ +class SuccessfulPropertyBatchInfo extends models['PropertyBatchInfo'] { + /** + * Create a SuccessfulPropertyBatchInfo. + * @member {object} [properties] A map containing the properties that were + * requested through any "Get" property batch operations. The key represents + * the index of the "Get" operation in the original request, in string form. + * The value is the property. If a property is not found, it will not be in + * the map. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SuccessfulPropertyBatchInfo + * + * @returns {object} metadata of SuccessfulPropertyBatchInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'Successful', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'PropertyBatchInfo', + className: 'SuccessfulPropertyBatchInfo', + modelProperties: { + kind: { + required: true, + serializedName: 'Kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'Properties', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'PropertyInfoElementType', + type: { + name: 'Composite', + className: 'PropertyInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = SuccessfulPropertyBatchInfo; diff --git a/lib/services/serviceFabric/lib/models/systemApplicationHealthEvaluation.js b/lib/services/serviceFabric/lib/models/systemApplicationHealthEvaluation.js index cbde8086d9..f2d0dedbc0 100644 --- a/lib/services/serviceFabric/lib/models/systemApplicationHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/systemApplicationHealthEvaluation.js @@ -23,7 +23,11 @@ const models = require('./index'); class SystemApplicationHealthEvaluation extends models['HealthEvaluation'] { /** * Create a SystemApplicationHealthEvaluation. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the current aggregated health state of the system application. The + * types of the unhealthy evaluations can be + * DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or + * EventHealthEvaluation. */ constructor() { super(); @@ -41,6 +45,11 @@ class SystemApplicationHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'SystemApplication', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'SystemApplicationHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -60,6 +69,7 @@ class SystemApplicationHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/testErrorChaosEvent.js b/lib/services/serviceFabric/lib/models/testErrorChaosEvent.js index a6e06f6dec..9942bd7828 100644 --- a/lib/services/serviceFabric/lib/models/testErrorChaosEvent.js +++ b/lib/services/serviceFabric/lib/models/testErrorChaosEvent.js @@ -16,16 +16,18 @@ const models = require('./index'); * Describes a Chaos event that gets generated when an unexpected event occurs * in the Chaos engine. * For example, due to the cluster snapshot being inconsistent, while faulting - * a faultable entity, Chaos found that the entity was alreay faulted -- which - * would be an unexpected event. - * + * an entity, Chaos found that the entity was already faulted -- which would be + * an unexpected event. * * @extends models['ChaosEvent'] */ class TestErrorChaosEvent extends models['ChaosEvent'] { /** * Create a TestErrorChaosEvent. - * @member {string} [reason] + * @member {string} [reason] Describes why TestErrorChaosEvent was generated. + * For example, Chaos tries to fault a partition but finds that the partition + * is no longer fault tolerant, then a TestErrorEvent gets generated with the + * reason stating that the partition is not fault tolerant. */ constructor() { super(); @@ -43,6 +45,11 @@ class TestErrorChaosEvent extends models['ChaosEvent'] { serializedName: 'TestError', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ChaosEvent', className: 'TestErrorChaosEvent', modelProperties: { timeStampUtc: { @@ -55,6 +62,7 @@ class TestErrorChaosEvent extends models['ChaosEvent'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/timeBasedBackupScheduleDescription.js b/lib/services/serviceFabric/lib/models/timeBasedBackupScheduleDescription.js new file mode 100644 index 0000000000..8866833dbb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/timeBasedBackupScheduleDescription.js @@ -0,0 +1,105 @@ +/* + * 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 the time based backup schedule. + * + * @extends models['BackupScheduleDescription'] + */ +class TimeBasedBackupScheduleDescription extends models['BackupScheduleDescription'] { + /** + * Create a TimeBasedBackupScheduleDescription. + * @member {string} scheduleFrequencyType Describes the frequency with which + * to run the time based backup schedule. Possible values include: 'Invalid', + * 'Daily', 'Weekly' + * @member {array} [runDays] List of days of a week when to trigger the + * periodic backup. This is valid only when the backup schedule frequency + * type is weekly. + * @member {array} runTimes Represents the list of exact time during the day + * in ISO8601 format. Like '19:00:00' will represent '7PM' during the day. + * Date specified along with time will be ignored. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TimeBasedBackupScheduleDescription + * + * @returns {object} metadata of TimeBasedBackupScheduleDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'TimeBased', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'ScheduleKind', + clientName: 'scheduleKind' + }, + uberParent: 'BackupScheduleDescription', + className: 'TimeBasedBackupScheduleDescription', + modelProperties: { + scheduleKind: { + required: true, + serializedName: 'ScheduleKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + scheduleFrequencyType: { + required: true, + serializedName: 'ScheduleFrequencyType', + type: { + name: 'String' + } + }, + runDays: { + required: false, + serializedName: 'RunDays', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DayOfWeekElementType', + type: { + name: 'String' + } + } + } + }, + runTimes: { + required: true, + serializedName: 'RunTimes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DateElementType', + type: { + name: 'DateTime' + } + } + } + } + } + } + }; + } +} + +module.exports = TimeBasedBackupScheduleDescription; diff --git a/lib/services/serviceFabric/lib/models/timeOfDay.js b/lib/services/serviceFabric/lib/models/timeOfDay.js new file mode 100644 index 0000000000..b5bd41e0b6 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/timeOfDay.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines an hour and minute of the day specified in 24 hour time. + * + */ +class TimeOfDay { + /** + * Create a TimeOfDay. + * @member {number} [hour] Represents the hour of the day. Value must be + * between 0 and 23 inclusive. + * @member {number} [minute] Represents the minute of the hour. Value must be + * between 0 to 59 inclusive. + */ + constructor() { + } + + /** + * Defines the metadata of TimeOfDay + * + * @returns {object} metadata of TimeOfDay + * + */ + mapper() { + return { + required: false, + serializedName: 'TimeOfDay', + type: { + name: 'Composite', + className: 'TimeOfDay', + modelProperties: { + hour: { + required: false, + serializedName: 'Hour', + constraints: { + InclusiveMaximum: 23, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + minute: { + required: false, + serializedName: 'Minute', + constraints: { + InclusiveMaximum: 59, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = TimeOfDay; diff --git a/lib/services/serviceFabric/lib/models/timeRange.js b/lib/services/serviceFabric/lib/models/timeRange.js new file mode 100644 index 0000000000..c6e83ff35e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/timeRange.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines a time range in a 24 hour day specified by a start and end time. + * + */ +class TimeRange { + /** + * Create a TimeRange. + * @member {object} [startTime] Defines an hour and minute of the day + * specified in 24 hour time. + * @member {number} [startTime.hour] Represents the hour of the day. Value + * must be between 0 and 23 inclusive. + * @member {number} [startTime.minute] Represents the minute of the hour. + * Value must be between 0 to 59 inclusive. + * @member {object} [endTime] Defines an hour and minute of the day specified + * in 24 hour time. + * @member {number} [endTime.hour] Represents the hour of the day. Value must + * be between 0 and 23 inclusive. + * @member {number} [endTime.minute] Represents the minute of the hour. Value + * must be between 0 to 59 inclusive. + */ + constructor() { + } + + /** + * Defines the metadata of TimeRange + * + * @returns {object} metadata of TimeRange + * + */ + mapper() { + return { + required: false, + serializedName: 'TimeRange', + type: { + name: 'Composite', + className: 'TimeRange', + modelProperties: { + startTime: { + required: false, + serializedName: 'StartTime', + type: { + name: 'Composite', + className: 'TimeOfDay' + } + }, + endTime: { + required: false, + serializedName: 'EndTime', + type: { + name: 'Composite', + className: 'TimeOfDay' + } + } + } + } + }; + } +} + +module.exports = TimeRange; diff --git a/lib/services/serviceFabric/lib/models/uniformInt64RangePartitionSchemeDescription.js b/lib/services/serviceFabric/lib/models/uniformInt64RangePartitionSchemeDescription.js index 68a8b65bd2..aa85b0616e 100644 --- a/lib/services/serviceFabric/lib/models/uniformInt64RangePartitionSchemeDescription.js +++ b/lib/services/serviceFabric/lib/models/uniformInt64RangePartitionSchemeDescription.js @@ -24,10 +24,10 @@ class UniformInt64RangePartitionSchemeDescription extends models['PartitionSchem * @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’ + * should be split between the partitions. * @member {string} highKey String indicating the upper bound of the * partition key range that - * should be split between the partition ‘Count’ + * should be split between the partitions. */ constructor() { super(); @@ -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/serviceFabric/lib/models/unprovisionApplicationTypeDescriptionInfo.js b/lib/services/serviceFabric/lib/models/unprovisionApplicationTypeDescriptionInfo.js new file mode 100644 index 0000000000..19ec8555eb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/unprovisionApplicationTypeDescriptionInfo.js @@ -0,0 +1,67 @@ +/* + * 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 operation to unregister or unprovision an application type and + * its version that was registered with the Service Fabric. + * + */ +class UnprovisionApplicationTypeDescriptionInfo { + /** + * Create a UnprovisionApplicationTypeDescriptionInfo. + * @member {string} applicationTypeVersion The version of the application + * type as defined in the application manifest. + * @member {boolean} [async] The flag indicating whether or not unprovision + * should occur asynchronously. When set to true, the unprovision operation + * returns when the request is accepted by the system, and the unprovision + * operation continues without any timeout limit. The default value is false. + * However, we recommend setting it to true for large application packages + * that were provisioned. + */ + constructor() { + } + + /** + * Defines the metadata of UnprovisionApplicationTypeDescriptionInfo + * + * @returns {object} metadata of UnprovisionApplicationTypeDescriptionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'UnprovisionApplicationTypeDescriptionInfo', + type: { + name: 'Composite', + className: 'UnprovisionApplicationTypeDescriptionInfo', + modelProperties: { + applicationTypeVersion: { + required: true, + serializedName: 'ApplicationTypeVersion', + type: { + name: 'String' + } + }, + async: { + required: false, + serializedName: 'Async', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = UnprovisionApplicationTypeDescriptionInfo; diff --git a/lib/services/serviceFabric/lib/models/updateClusterUpgradeDescription.js b/lib/services/serviceFabric/lib/models/updateClusterUpgradeDescription.js index 4fe2b4dc2d..a72f54b1b5 100644 --- a/lib/services/serviceFabric/lib/models/updateClusterUpgradeDescription.js +++ b/lib/services/serviceFabric/lib/models/updateClusterUpgradeDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Parameters for updating a cluster upgrade. * @@ -19,22 +17,61 @@ const models = require('./index'); class UpdateClusterUpgradeDescription { /** * Create a UpdateClusterUpgradeDescription. - * @member {string} [upgradeKind] Possible values include: 'Invalid', - * 'Rolling', 'Rolling_ForceRestart'. Default value: 'Rolling' . - * @member {object} [updateDescription] - * @member {string} [updateDescription.rollingUpgradeMode] Possible values - * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' - * @member {boolean} [updateDescription.forceRestart] + * @member {string} [upgradeKind] The type of upgrade out of the following + * possible values. Possible values include: 'Invalid', 'Rolling', + * 'Rolling_ForceRestart'. Default value: 'Rolling' . + * @member {object} [updateDescription] Describes the parameters for updating + * a rolling upgrade of application or cluster. + * @member {string} [updateDescription.rollingUpgradeMode] The mode used to + * monitor health during a rolling upgrade. The values are UnmonitoredAuto, + * UnmonitoredManual, and Monitored. Possible values include: 'Invalid', + * 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * @member {boolean} [updateDescription.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 {number} [updateDescription.replicaSetCheckTimeoutInMilliseconds] - * @member {string} [updateDescription.failureAction] Possible values - * include: 'Invalid', 'Rollback', 'Manual' + * 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 {string} [updateDescription.failureAction] The compensating action + * to perform when a Monitored upgrade encounters monitoring policy or health + * policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that + * the upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * @member {string} [updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} - * [updateDescription.healthCheckStableDurationInMilliseconds] + * [updateDescription.healthCheckStableDurationInMilliseconds] 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} [updateDescription.healthCheckRetryTimeoutInMilliseconds] - * @member {string} [updateDescription.upgradeTimeoutInMilliseconds] + * 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} [updateDescription.upgradeTimeoutInMilliseconds] 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} [updateDescription.upgradeDomainTimeoutInMilliseconds] - * @member {object} [clusterHealthPolicy] + * 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} [clusterHealthPolicy] Defines a health policy used to + * evaluate the health of the cluster or of a cluster node. * @member {boolean} [clusterHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. * @member {number} [clusterHealthPolicy.maxPercentUnhealthyNodes] The @@ -69,8 +106,34 @@ class UpdateClusterUpgradeDescription { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * @member {array} [clusterHealthPolicy.applicationTypeHealthPolicyMap] - * @member {boolean} [enableDeltaHealthEvaluation] - * @member {object} [clusterUpgradeHealthPolicy] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage + * used to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with + * MaxPercentUnhealthyApplications set to 20% to tolerate some failures out + * of the thousands of application instances. + * The application type health policy map is used only if the cluster + * manifest enables application type health evaluation using the + * configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * @member {boolean} [enableDeltaHealthEvaluation] When true, enables delta + * health evaluation rather than absolute health evaluation after completion + * of each upgrade domain. + * @member {object} [clusterUpgradeHealthPolicy] Defines a health policy used + * to evaluate the health of the cluster during a cluster upgrade. * @member {number} * [clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] The maximum * allowed percentage of nodes health degradation allowed during cluster @@ -88,8 +151,12 @@ class UpdateClusterUpgradeDescription { * 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. The default value is 15%. - * @member {object} [applicationHealthPolicyMap] + * @member {object} [applicationHealthPolicyMap] Defines the application + * health policy map used to evaluate the health of an application or one of + * its children entities. * @member {array} [applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/upgradeDomainDeltaNodesCheckHealthEvaluation.js b/lib/services/serviceFabric/lib/models/upgradeDomainDeltaNodesCheckHealthEvaluation.js index b92c1c56f2..1048f3ced2 100644 --- a/lib/services/serviceFabric/lib/models/upgradeDomainDeltaNodesCheckHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/upgradeDomainDeltaNodesCheckHealthEvaluation.js @@ -19,7 +19,6 @@ const models = require('./index'); * Can be returned during cluster upgrade when cluster aggregated health state * is Warning or Error. * - * * @extends models['HealthEvaluation'] */ class UpgradeDomainDeltaNodesCheckHealthEvaluation extends models['HealthEvaluation'] { @@ -37,7 +36,9 @@ class UpgradeDomainDeltaNodesCheckHealthEvaluation extends models['HealthEvaluat * ClusterUpgradeHealthPolicy. * @member {number} [totalCount] Total number of upgrade domain nodes in the * health store. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * NodeHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -55,6 +56,11 @@ class UpgradeDomainDeltaNodesCheckHealthEvaluation extends models['HealthEvaluat serializedName: 'UpgradeDomainDeltaNodesCheck', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'UpgradeDomainDeltaNodesCheckHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -74,6 +80,7 @@ class UpgradeDomainDeltaNodesCheckHealthEvaluation extends models['HealthEvaluat kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/upgradeDomainInfo.js b/lib/services/serviceFabric/lib/models/upgradeDomainInfo.js index 22993db001..585b70b9fa 100644 --- a/lib/services/serviceFabric/lib/models/upgradeDomainInfo.js +++ b/lib/services/serviceFabric/lib/models/upgradeDomainInfo.js @@ -17,9 +17,9 @@ class UpgradeDomainInfo { /** * Create a UpgradeDomainInfo. - * @member {string} [name] - * @member {string} [state] Possible values include: 'Invalid', 'Pending', - * 'InProgress', 'Completed' + * @member {string} [name] The name of the upgrade domain + * @member {string} [state] The state of the upgrade domain. Possible values + * include: 'Invalid', 'Pending', 'InProgress', 'Completed' */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/upgradeDomainNodesHealthEvaluation.js b/lib/services/serviceFabric/lib/models/upgradeDomainNodesHealthEvaluation.js index cf5d58fea8..7a3f853fd6 100644 --- a/lib/services/serviceFabric/lib/models/upgradeDomainNodesHealthEvaluation.js +++ b/lib/services/serviceFabric/lib/models/upgradeDomainNodesHealthEvaluation.js @@ -30,7 +30,9 @@ class UpgradeDomainNodesHealthEvaluation extends models['HealthEvaluation'] { * unhealthy nodes from the ClusterHealthPolicy. * @member {number} [totalCount] Total number of nodes in the current upgrade * domain. - * @member {array} [unhealthyEvaluations] + * @member {array} [unhealthyEvaluations] List of unhealthy evaluations that + * led to the aggregated health state. Includes all the unhealthy + * NodeHealthEvaluation that impacted the aggregated health. */ constructor() { super(); @@ -48,6 +50,11 @@ class UpgradeDomainNodesHealthEvaluation extends models['HealthEvaluation'] { serializedName: 'UpgradeDomainNodes', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'HealthEvaluation', className: 'UpgradeDomainNodesHealthEvaluation', modelProperties: { aggregatedHealthState: { @@ -67,6 +74,7 @@ class UpgradeDomainNodesHealthEvaluation extends models['HealthEvaluation'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/upgradeOrchestrationServiceState.js b/lib/services/serviceFabric/lib/models/upgradeOrchestrationServiceState.js new file mode 100644 index 0000000000..3f81f09f63 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/upgradeOrchestrationServiceState.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * Service state of Service Fabric Upgrade Orchestration Service. + * + */ +class UpgradeOrchestrationServiceState { + /** + * Create a UpgradeOrchestrationServiceState. + * @member {string} [serviceState] The state of Service Fabric Upgrade + * Orchestration Service. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOrchestrationServiceState + * + * @returns {object} metadata of UpgradeOrchestrationServiceState + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOrchestrationServiceState', + type: { + name: 'Composite', + className: 'UpgradeOrchestrationServiceState', + modelProperties: { + serviceState: { + required: false, + serializedName: 'ServiceState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpgradeOrchestrationServiceState; diff --git a/lib/services/serviceFabric/lib/models/upgradeOrchestrationServiceStateSummary.js b/lib/services/serviceFabric/lib/models/upgradeOrchestrationServiceStateSummary.js new file mode 100644 index 0000000000..f625b76d50 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/upgradeOrchestrationServiceStateSummary.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Service state summary of Service Fabric Upgrade Orchestration Service. + * + */ +class UpgradeOrchestrationServiceStateSummary { + /** + * Create a UpgradeOrchestrationServiceStateSummary. + * @member {string} [currentCodeVersion] The current code version of the + * cluster. + * @member {string} [currentManifestVersion] The current manifest version of + * the cluster. + * @member {string} [targetCodeVersion] The target code version of the + * cluster. + * @member {string} [targetManifestVersion] The target manifest version of + * the cluster. + * @member {string} [pendingUpgradeType] The type of the pending upgrade of + * the cluster. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOrchestrationServiceStateSummary + * + * @returns {object} metadata of UpgradeOrchestrationServiceStateSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOrchestrationServiceStateSummary', + type: { + name: 'Composite', + className: 'UpgradeOrchestrationServiceStateSummary', + modelProperties: { + currentCodeVersion: { + required: false, + serializedName: 'CurrentCodeVersion', + type: { + name: 'String' + } + }, + currentManifestVersion: { + required: false, + serializedName: 'CurrentManifestVersion', + type: { + name: 'String' + } + }, + targetCodeVersion: { + required: false, + serializedName: 'TargetCodeVersion', + type: { + name: 'String' + } + }, + targetManifestVersion: { + required: false, + serializedName: 'TargetManifestVersion', + type: { + name: 'String' + } + }, + pendingUpgradeType: { + required: false, + serializedName: 'PendingUpgradeType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpgradeOrchestrationServiceStateSummary; diff --git a/lib/services/serviceFabric/lib/models/uploadChunkRange.js b/lib/services/serviceFabric/lib/models/uploadChunkRange.js new file mode 100644 index 0000000000..863c4a0f1b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/uploadChunkRange.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'; + +/** + * Information about which portion of the file to upload. + * + */ +class UploadChunkRange { + /** + * Create a UploadChunkRange. + * @member {string} [startPosition] The start position of the portion of the + * file. It's represented by the number of bytes. + * @member {string} [endPosition] The end position of the portion of the + * file. It's represented by the number of bytes. + */ + constructor() { + } + + /** + * Defines the metadata of UploadChunkRange + * + * @returns {object} metadata of UploadChunkRange + * + */ + mapper() { + return { + required: false, + serializedName: 'UploadChunkRange', + type: { + name: 'Composite', + className: 'UploadChunkRange', + modelProperties: { + startPosition: { + required: false, + serializedName: 'StartPosition', + type: { + name: 'String' + } + }, + endPosition: { + required: false, + serializedName: 'EndPosition', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UploadChunkRange; diff --git a/lib/services/serviceFabric/lib/models/uploadSession.js b/lib/services/serviceFabric/lib/models/uploadSession.js new file mode 100644 index 0000000000..22d7365b85 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/uploadSession.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'; + +/** + * Information about a image store upload session + * + */ +class UploadSession { + /** + * Create a UploadSession. + * @member {array} [uploadSessions] When querying upload session by upload + * session ID, the result contains only one upload session. When querying + * upload session by image store relative path, the result might contain + * multiple upload sessions. + */ + constructor() { + } + + /** + * Defines the metadata of UploadSession + * + * @returns {object} metadata of UploadSession + * + */ + mapper() { + return { + required: false, + serializedName: 'UploadSession', + type: { + name: 'Composite', + className: 'UploadSession', + modelProperties: { + uploadSessions: { + required: false, + serializedName: 'UploadSessions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UploadSessionInfoElementType', + type: { + name: 'Composite', + className: 'UploadSessionInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = UploadSession; diff --git a/lib/services/serviceFabric/lib/models/uploadSessionInfo.js b/lib/services/serviceFabric/lib/models/uploadSessionInfo.js new file mode 100644 index 0000000000..3259cc24f5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/uploadSessionInfo.js @@ -0,0 +1,97 @@ +/* + * 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'; + +/** + * Information about an image store upload session. A session is associated + * with a relative path in the image store. + * + */ +class UploadSessionInfo { + /** + * Create a UploadSessionInfo. + * @member {string} [storeRelativePath] The remote location within image + * store. This path is relative to the image store root. + * @member {uuid} [sessionId] A unique ID of the upload session. A session ID + * can be reused only if the session was committed or removed. + * @member {date} [modifiedDate] The date and time when the upload session + * was last modified. + * @member {string} [fileSize] The size in bytes of the uploading file. + * @member {array} [expectedRanges] List of chunk ranges that image store has + * not received yet. + */ + constructor() { + } + + /** + * Defines the metadata of UploadSessionInfo + * + * @returns {object} metadata of UploadSessionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'UploadSessionInfo', + type: { + name: 'Composite', + className: 'UploadSessionInfo', + modelProperties: { + storeRelativePath: { + required: false, + serializedName: 'StoreRelativePath', + type: { + name: 'String' + } + }, + sessionId: { + required: false, + serializedName: 'SessionId', + type: { + name: 'String' + } + }, + modifiedDate: { + required: false, + serializedName: 'ModifiedDate', + type: { + name: 'DateTime' + } + }, + fileSize: { + required: false, + serializedName: 'FileSize', + type: { + name: 'String' + } + }, + expectedRanges: { + required: false, + serializedName: 'ExpectedRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UploadChunkRangeElementType', + type: { + name: 'Composite', + className: 'UploadChunkRange' + } + } + } + } + } + } + }; + } +} + +module.exports = UploadSessionInfo; diff --git a/lib/services/serviceFabric/lib/models/validationFailedChaosEvent.js b/lib/services/serviceFabric/lib/models/validationFailedChaosEvent.js index e0b3df9d91..7784a88774 100644 --- a/lib/services/serviceFabric/lib/models/validationFailedChaosEvent.js +++ b/lib/services/serviceFabric/lib/models/validationFailedChaosEvent.js @@ -20,7 +20,10 @@ const models = require('./index'); class ValidationFailedChaosEvent extends models['ChaosEvent'] { /** * Create a ValidationFailedChaosEvent. - * @member {string} [reason] + * @member {string} [reason] Describes why the ValidationFailedChaosEvent was + * generated. This may happen because more than MaxPercentUnhealthyNodes are + * unhealthy for more than MaxClusterStabilizationTimeout. This reason will + * be in the Reason property of the ValidationFailedChaosEvent as a string. */ constructor() { super(); @@ -38,6 +41,11 @@ class ValidationFailedChaosEvent extends models['ChaosEvent'] { serializedName: 'ValidationFailed', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ChaosEvent', className: 'ValidationFailedChaosEvent', modelProperties: { timeStampUtc: { @@ -50,6 +58,7 @@ class ValidationFailedChaosEvent extends models['ChaosEvent'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/volumeProviderParametersAzureFile.js b/lib/services/serviceFabric/lib/models/volumeProviderParametersAzureFile.js new file mode 100644 index 0000000000..fb692bc7be --- /dev/null +++ b/lib/services/serviceFabric/lib/models/volumeProviderParametersAzureFile.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * This type describes a volume provided by an Azure Files file share. + * + */ +class VolumeProviderParametersAzureFile { + /** + * Create a VolumeProviderParametersAzureFile. + * @member {string} accountName Name of the Azure storage account for the + * File Share. + * @member {string} [accountKey] Access key of the Azure storage account for + * the File Share. + * @member {string} shareName Name of the Azure Files file share that + * provides storage for the volume. + */ + constructor() { + } + + /** + * Defines the metadata of VolumeProviderParametersAzureFile + * + * @returns {object} metadata of VolumeProviderParametersAzureFile + * + */ + mapper() { + return { + required: false, + serializedName: 'VolumeProviderParametersAzureFile', + type: { + name: 'Composite', + className: 'VolumeProviderParametersAzureFile', + modelProperties: { + accountName: { + required: true, + serializedName: 'accountName', + type: { + name: 'String' + } + }, + accountKey: { + required: false, + serializedName: 'accountKey', + type: { + name: 'String' + } + }, + shareName: { + required: true, + serializedName: 'shareName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VolumeProviderParametersAzureFile; diff --git a/lib/services/serviceFabric/lib/models/volumeResourceDescription.js b/lib/services/serviceFabric/lib/models/volumeResourceDescription.js new file mode 100644 index 0000000000..cfa9343838 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/volumeResourceDescription.js @@ -0,0 +1,85 @@ +/* + * 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 a service fabric volume resource. + * + */ +class VolumeResourceDescription { + /** + * Create a VolumeResourceDescription. + * @member {string} [description] User readable description of the volume. + * @member {object} [azureFileParameters] This type describes a volume + * provided by an Azure Files file share. + * @member {string} [azureFileParameters.accountName] Name of the Azure + * storage account for the File Share. + * @member {string} [azureFileParameters.accountKey] Access key of the Azure + * storage account for the File Share. + * @member {string} [azureFileParameters.shareName] Name of the Azure Files + * file share that provides storage for the volume. + * @member {string} name Volume resource name. + */ + constructor() { + } + + /** + * Defines the metadata of VolumeResourceDescription + * + * @returns {object} metadata of VolumeResourceDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'VolumeResourceDescription', + type: { + name: 'Composite', + className: 'VolumeResourceDescription', + modelProperties: { + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + provider: { + required: true, + isConstant: true, + serializedName: 'properties.provider', + defaultValue: 'SFAzureFile', + type: { + name: 'String' + } + }, + azureFileParameters: { + required: false, + serializedName: 'properties.azureFileParameters', + type: { + name: 'Composite', + className: 'VolumeProviderParametersAzureFile' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VolumeResourceDescription; diff --git a/lib/services/serviceFabric/lib/models/waitForInbuildReplicaSafetyCheck.js b/lib/services/serviceFabric/lib/models/waitForInbuildReplicaSafetyCheck.js index 56f0be305b..995e70afa0 100644 --- a/lib/services/serviceFabric/lib/models/waitForInbuildReplicaSafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/waitForInbuildReplicaSafetyCheck.js @@ -14,9 +14,9 @@ const models = require('./index'); /** * Safety check that waits for the replica build operation to finish. This - * indiciates that there is a replica that is going through the copy or is + * indicates that there is a replica that is going through the copy or is * providing data for building another replica. Bring the node down will abort - * this copy operation which are typoically expensive involving data movements. + * this copy operation which are typically expensive involving data movements. * * @extends models['PartitionSafetyCheck'] */ @@ -40,11 +40,17 @@ class WaitForInbuildReplicaSafetyCheck extends models['PartitionSafetyCheck'] { serializedName: 'WaitForInbuildReplica', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'WaitForInbuildReplicaSafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/waitForPrimaryPlacementSafetyCheck.js b/lib/services/serviceFabric/lib/models/waitForPrimaryPlacementSafetyCheck.js index f5cdfab9a7..7124103e10 100644 --- a/lib/services/serviceFabric/lib/models/waitForPrimaryPlacementSafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/waitForPrimaryPlacementSafetyCheck.js @@ -38,11 +38,17 @@ class WaitForPrimaryPlacementSafetyCheck extends models['PartitionSafetyCheck'] serializedName: 'WaitForPrimaryPlacement', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'WaitForPrimaryPlacementSafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/waitForPrimarySwapSafetyCheck.js b/lib/services/serviceFabric/lib/models/waitForPrimarySwapSafetyCheck.js index 4d6fbe16de..4f2795e1f4 100644 --- a/lib/services/serviceFabric/lib/models/waitForPrimarySwapSafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/waitForPrimarySwapSafetyCheck.js @@ -39,11 +39,17 @@ class WaitForPrimarySwapSafetyCheck extends models['PartitionSafetyCheck'] { serializedName: 'WaitForPrimarySwap', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'WaitForPrimarySwapSafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/waitForReconfigurationSafetyCheck.js b/lib/services/serviceFabric/lib/models/waitForReconfigurationSafetyCheck.js index 1243b00ced..85f474ca39 100644 --- a/lib/services/serviceFabric/lib/models/waitForReconfigurationSafetyCheck.js +++ b/lib/services/serviceFabric/lib/models/waitForReconfigurationSafetyCheck.js @@ -38,11 +38,17 @@ class WaitForReconfigurationSafetyCheck extends models['PartitionSafetyCheck'] { serializedName: 'WaitForReconfiguration', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'SafetyCheck', className: 'WaitForReconfigurationSafetyCheck', modelProperties: { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/waitingChaosEvent.js b/lib/services/serviceFabric/lib/models/waitingChaosEvent.js index 2cae8f3607..9eec5e08a9 100644 --- a/lib/services/serviceFabric/lib/models/waitingChaosEvent.js +++ b/lib/services/serviceFabric/lib/models/waitingChaosEvent.js @@ -22,7 +22,8 @@ const models = require('./index'); class WaitingChaosEvent extends models['ChaosEvent'] { /** * Create a WaitingChaosEvent. - * @member {string} [reason] + * @member {string} [reason] Describes why the WaitingChaosEvent was + * generated, for example, due to a cluster upgrade. */ constructor() { super(); @@ -40,6 +41,11 @@ class WaitingChaosEvent extends models['ChaosEvent'] { serializedName: 'Waiting', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'ChaosEvent', className: 'WaitingChaosEvent', modelProperties: { timeStampUtc: { @@ -52,6 +58,7 @@ class WaitingChaosEvent extends models['ChaosEvent'] { kind: { required: true, serializedName: 'Kind', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/serviceFabricClient.d.ts b/lib/services/serviceFabric/lib/serviceFabricClient.d.ts index a186af8046..fcef1840e3 100644 --- a/lib/services/serviceFabric/lib/serviceFabricClient.d.ts +++ b/lib/services/serviceFabric/lib/serviceFabricClient.d.ts @@ -11,7 +11,7 @@ import { ServiceClient, ServiceClientOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; import * as models from "./models"; -declare class ServiceFabricClient extends ServiceClient { +export default class ServiceFabricClient extends ServiceClient { /** * @class * Initializes a new instance of the ServiceFabricClient class. @@ -37,25 +37,24 @@ declare class ServiceFabricClient extends ServiceClient { * * Get the Service Fabric cluster manifest. The cluster manifest contains * properties of the cluster that include different node types on the cluster, - * security configurations, fault and upgrade domain topologies etc. + * security configurations, fault, and upgrade domain topologies, etc. * * These properties are specified as part of the ClusterConfig.JSON file while - * deploying a stand alone cluster. However, most of the information in the + * deploying a stand-alone cluster. However, most of the information in the * cluster manifest * is generated internally by service fabric during cluster deployment in other - * deployment scenarios (for e.g when using azuer portal). + * deployment scenarios (e.g. when using Azure portal). * * The contents of the cluster manifest are for informational purposes only and * users are not expected to take a dependency on the format of the file * contents or its interpretation. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -73,25 +72,24 @@ declare class ServiceFabricClient extends ServiceClient { * * Get the Service Fabric cluster manifest. The cluster manifest contains * properties of the cluster that include different node types on the cluster, - * security configurations, fault and upgrade domain topologies etc. + * security configurations, fault, and upgrade domain topologies, etc. * * These properties are specified as part of the ClusterConfig.JSON file while - * deploying a stand alone cluster. However, most of the information in the + * deploying a stand-alone cluster. However, most of the information in the * cluster manifest * is generated internally by service fabric during cluster deployment in other - * deployment scenarios (for e.g when using azuer portal). + * deployment scenarios (e.g. when using Azure portal). * * The contents of the cluster manifest are for informational purposes only and * users are not expected to take a dependency on the format of the file * contents or its interpretation. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -126,14 +124,12 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the health of a Service Fabric cluster. * - * Gets the health of a Service Fabric cluster. * Use EventsHealthStateFilter to filter the collection of health events * reported on the cluster based on the health state. * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to * filter the collection of nodes and applications returned based on their * aggregated health state. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.nodesHealthStateFilter] Allows filtering of the @@ -143,7 +139,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. Only nodes that match the filter are returned. All * nodes are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of nodes with * HealthState value of OK (2) and Warning (4) are returned. @@ -159,7 +155,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.applicationsHealthStateFilter] Allows filtering of * the application health state objects returned in the result of cluster * health @@ -170,7 +165,7 @@ declare class ServiceFabricClient extends ServiceClient { * the filter are returned. * All applications are used to evaluate the aggregated health state. If not * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of applications * with HealthState value of OK (2) and Warning (4) are returned. @@ -186,17 +181,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.eventsHealthStateFilter] Allows filtering the * collection of HealthEvent objects returned based on health state. * The possible values for this parameter include integer value of one of the * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -210,14 +204,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {boolean} [options.includeSystemApplicationHealthStatistics] * Indicates whether the health statistics should include the fabric:/System * application health statistics. False by default. @@ -229,11 +221,10 @@ declare class ServiceFabricClient extends ServiceClient { * The health statistics must be included in the query result for this * parameter to be applied. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -249,14 +240,12 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the health of a Service Fabric cluster. * - * Gets the health of a Service Fabric cluster. * Use EventsHealthStateFilter to filter the collection of health events * reported on the cluster based on the health state. * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to * filter the collection of nodes and applications returned based on their * aggregated health state. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.nodesHealthStateFilter] Allows filtering of the @@ -266,7 +255,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. Only nodes that match the filter are returned. All * nodes are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of nodes with * HealthState value of OK (2) and Warning (4) are returned. @@ -282,7 +271,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.applicationsHealthStateFilter] Allows filtering of * the application health state objects returned in the result of cluster * health @@ -293,7 +281,7 @@ declare class ServiceFabricClient extends ServiceClient { * the filter are returned. * All applications are used to evaluate the aggregated health state. If not * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of applications * with HealthState value of OK (2) and Warning (4) are returned. @@ -309,17 +297,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.eventsHealthStateFilter] Allows filtering the * collection of HealthEvent objects returned based on health state. * The possible values for this parameter include integer value of one of the * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -333,14 +320,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {boolean} [options.includeSystemApplicationHealthStatistics] * Indicates whether the health statistics should include the fabric:/System * application health statistics. False by default. @@ -352,11 +337,10 @@ declare class ServiceFabricClient extends ServiceClient { * The health statistics must be included in the query result for this * parameter to be applied. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -392,7 +376,6 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the health of a Service Fabric cluster using the specified * policy. * - * Gets the health of a Service Fabric cluster. * Use EventsHealthStateFilter to filter the collection of health events * reported on the cluster based on the health state. * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to @@ -401,7 +384,6 @@ declare class ServiceFabricClient extends ServiceClient { * Use ClusterHealthPolicies to override the health policies used to evaluate * the health. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.nodesHealthStateFilter] Allows filtering of the @@ -411,7 +393,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. Only nodes that match the filter are returned. All * nodes are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of nodes with * HealthState value of OK (2) and Warning (4) are returned. @@ -427,7 +409,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.applicationsHealthStateFilter] Allows filtering of * the application health state objects returned in the result of cluster * health @@ -438,7 +419,7 @@ declare class ServiceFabricClient extends ServiceClient { * the filter are returned. * All applications are used to evaluate the aggregated health state. If not * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of applications * with HealthState value of OK (2) and Warning (4) are returned. @@ -454,17 +435,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.eventsHealthStateFilter] Allows filtering the * collection of HealthEvent objects returned based on health state. * The possible values for this parameter include integer value of one of the * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -478,14 +458,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {boolean} [options.includeSystemApplicationHealthStatistics] * Indicates whether the health statistics should include the fabric:/System * application health statistics. False by default. @@ -497,7 +475,6 @@ declare class ServiceFabricClient extends ServiceClient { * The health statistics must be included in the query result for this * parameter to be applied. * - * * @param {object} [options.clusterHealthPolicies] Describes the health * policies used to evaluate the cluster health. * If not present, the health evaluation uses the cluster health policy defined @@ -509,10 +486,20 @@ declare class ServiceFabricClient extends ServiceClient { * an application, the specified application health policy * is used to evaluate the application health. * - * * @param {array} [options.clusterHealthPolicies.applicationHealthPolicyMap] - * - * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] + * Defines a map that contains specific application health policies for + * different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * + * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [options.clusterHealthPolicies.clusterHealthPolicy.considerWarningAsError] @@ -535,7 +522,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthPolicies.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -553,14 +539,35 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [options.clusterHealthPolicies.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -577,7 +584,6 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the health of a Service Fabric cluster using the specified * policy. * - * Gets the health of a Service Fabric cluster. * Use EventsHealthStateFilter to filter the collection of health events * reported on the cluster based on the health state. * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to @@ -586,7 +592,6 @@ declare class ServiceFabricClient extends ServiceClient { * Use ClusterHealthPolicies to override the health policies used to evaluate * the health. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.nodesHealthStateFilter] Allows filtering of the @@ -596,7 +601,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. Only nodes that match the filter are returned. All * nodes are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of nodes with * HealthState value of OK (2) and Warning (4) are returned. @@ -612,7 +617,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.applicationsHealthStateFilter] Allows filtering of * the application health state objects returned in the result of cluster * health @@ -623,7 +627,7 @@ declare class ServiceFabricClient extends ServiceClient { * the filter are returned. * All applications are used to evaluate the aggregated health state. If not * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of applications * with HealthState value of OK (2) and Warning (4) are returned. @@ -639,17 +643,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.eventsHealthStateFilter] Allows filtering the * collection of HealthEvent objects returned based on health state. * The possible values for this parameter include integer value of one of the * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -663,14 +666,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {boolean} [options.includeSystemApplicationHealthStatistics] * Indicates whether the health statistics should include the fabric:/System * application health statistics. False by default. @@ -682,7 +683,6 @@ declare class ServiceFabricClient extends ServiceClient { * The health statistics must be included in the query result for this * parameter to be applied. * - * * @param {object} [options.clusterHealthPolicies] Describes the health * policies used to evaluate the cluster health. * If not present, the health evaluation uses the cluster health policy defined @@ -694,10 +694,20 @@ declare class ServiceFabricClient extends ServiceClient { * an application, the specified application health policy * is used to evaluate the application health. * - * * @param {array} [options.clusterHealthPolicies.applicationHealthPolicyMap] - * - * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] + * Defines a map that contains specific application health policies for + * different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * + * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [options.clusterHealthPolicies.clusterHealthPolicy.considerWarningAsError] @@ -720,7 +730,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthPolicies.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -738,14 +747,35 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [options.clusterHealthPolicies.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -787,13 +817,12 @@ declare class ServiceFabricClient extends ServiceClient { * entities, use the POST URI and specify the cluster health chunk query * description. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -816,13 +845,12 @@ declare class ServiceFabricClient extends ServiceClient { * entities, use the POST URI and specify the cluster health chunk query * description. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -871,7 +899,6 @@ declare class ServiceFabricClient extends ServiceClient { * only services that are in Error or Warning, and all partitions and replicas * for one of these services. * - * * @param {object} [options] Optional Parameters. * * @param {object} [options.clusterHealthChunkQueryDescription] Describes the @@ -896,7 +923,6 @@ declare class ServiceFabricClient extends ServiceClient { * only services that are in Error or Warning, and all partitions and replicas * for one of these services. * - * * @param {array} [options.clusterHealthChunkQueryDescription.nodeFilters] * Defines a list of filters that specify which nodes to be included in the * returned cluster health chunk. @@ -908,7 +934,6 @@ declare class ServiceFabricClient extends ServiceClient { * Error and another filter to always include a node identified by its * NodeName. * - * * @param {array} * [options.clusterHealthChunkQueryDescription.applicationFilters] Defines a * list of filters that specify which applications to be included in the @@ -921,9 +946,10 @@ declare class ServiceFabricClient extends ServiceClient { * state Error and another filter to always include applications of a specified * application type. * - * * @param {object} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] Defines a + * health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.considerWarningAsError] @@ -946,7 +972,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -964,20 +989,45 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {object} * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1007,7 +1057,6 @@ declare class ServiceFabricClient extends ServiceClient { * only services that are in Error or Warning, and all partitions and replicas * for one of these services. * - * * @param {object} [options] Optional Parameters. * * @param {object} [options.clusterHealthChunkQueryDescription] Describes the @@ -1032,7 +1081,6 @@ declare class ServiceFabricClient extends ServiceClient { * only services that are in Error or Warning, and all partitions and replicas * for one of these services. * - * * @param {array} [options.clusterHealthChunkQueryDescription.nodeFilters] * Defines a list of filters that specify which nodes to be included in the * returned cluster health chunk. @@ -1044,7 +1092,6 @@ declare class ServiceFabricClient extends ServiceClient { * Error and another filter to always include a node identified by its * NodeName. * - * * @param {array} * [options.clusterHealthChunkQueryDescription.applicationFilters] Defines a * list of filters that specify which applications to be included in the @@ -1057,9 +1104,10 @@ declare class ServiceFabricClient extends ServiceClient { * state Error and another filter to always include applications of a specified * application type. * - * * @param {object} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] Defines a + * health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.considerWarningAsError] @@ -1082,7 +1130,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -1100,20 +1147,45 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {object} * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1161,14 +1233,12 @@ declare class ServiceFabricClient extends ServiceClient { * GetClusterHealth and check that the report appears in the HealthEvents * section. * - * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -1185,12 +1255,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -1202,7 +1273,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -1214,7 +1284,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -1222,10 +1291,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -1235,33 +1303,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1290,14 +1356,12 @@ declare class ServiceFabricClient extends ServiceClient { * GetClusterHealth and check that the report appears in the HealthEvents * section. * - * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -1314,12 +1378,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -1331,7 +1396,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -1343,7 +1407,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -1351,10 +1414,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -1364,33 +1426,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1434,9 +1494,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [options.codeVersion] The product version of Service Fabric. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1462,9 +1522,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [options.codeVersion] The product version of Service Fabric. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1509,9 +1569,9 @@ declare class ServiceFabricClient extends ServiceClient { * Fabric. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1538,9 +1598,9 @@ declare class ServiceFabricClient extends ServiceClient { * Fabric. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1575,14 +1635,14 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the progress of the current cluster upgrade. * * Gets the current progress of the ongoing cluster upgrade. If no upgrade is - * currently in progress, gets the last state of the previous cluster upgrade. + * currently in progress, get the last state of the previous cluster upgrade. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1599,14 +1659,14 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the progress of the current cluster upgrade. * * Gets the current progress of the ongoing cluster upgrade. If no upgrade is - * currently in progress, gets the last state of the previous cluster upgrade. + * currently in progress, get the last state of the previous cluster upgrade. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1642,11 +1702,9 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Get the Service Fabric standalone cluster configuration. * - * Get the Service Fabric standalone cluster configuration. The cluster - * configuration contains properties of the cluster that include different node - * types on the cluster, - * security configurations, fault and upgrade domain topologies etc. - * + * The cluster configuration contains properties of the cluster that include + * different node types on the cluster, + * security configurations, fault, and upgrade domain topologies, etc. * * @param {string} configurationApiVersion The API version of the Standalone * cluster json configuration. @@ -1654,9 +1712,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1672,11 +1730,9 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Get the Service Fabric standalone cluster configuration. * - * Get the Service Fabric standalone cluster configuration. The cluster - * configuration contains properties of the cluster that include different node - * types on the cluster, - * security configurations, fault and upgrade domain topologies etc. - * + * The cluster configuration contains properties of the cluster that include + * different node types on the cluster, + * security configurations, fault, and upgrade domain topologies, etc. * * @param {string} configurationApiVersion The API version of the Standalone * cluster json configuration. @@ -1684,9 +1740,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1722,16 +1778,15 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Get the cluster configuration upgrade status of a Service Fabric * standalone cluster. * - * Get the cluster configuration upgrade status of a Service Fabric standalone - * cluster. - * + * Get the cluster configuration upgrade status details of a Service Fabric + * standalone cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1748,16 +1803,15 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Get the cluster configuration upgrade status of a Service Fabric * standalone cluster. * - * Get the cluster configuration upgrade status of a Service Fabric standalone - * cluster. - * + * Get the cluster configuration upgrade status details of a Service Fabric + * standalone cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1790,6 +1844,158 @@ declare class ServiceFabricClient extends ServiceClient { getClusterConfigurationUpgradeStatus(options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Get the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Get the service state of Service Fabric Upgrade Orchestration Service. This + * API is internally used for support purposes. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getUpgradeOrchestrationServiceStateWithHttpOperationResponse(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Get the service state of Service Fabric Upgrade Orchestration Service. This + * API is internally used for support purposes. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {UpgradeOrchestrationServiceState} - 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. + * + * {UpgradeOrchestrationServiceState} [result] - The deserialized result object if an error did not occur. + * See {@link UpgradeOrchestrationServiceState} 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. + */ + getUpgradeOrchestrationServiceState(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getUpgradeOrchestrationServiceState(callback: ServiceCallback): void; + getUpgradeOrchestrationServiceState(options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Update the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Update the service state of Service Fabric Upgrade Orchestration Service. + * This API is internally used for support purposes. + * + * @param {object} upgradeOrchestrationServiceState Service state of Service + * Fabric Upgrade Orchestration Service. + * + * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of + * Service Fabric Upgrade Orchestration Service. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + setUpgradeOrchestrationServiceStateWithHttpOperationResponse(upgradeOrchestrationServiceState: models.UpgradeOrchestrationServiceState, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Update the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Update the service state of Service Fabric Upgrade Orchestration Service. + * This API is internally used for support purposes. + * + * @param {object} upgradeOrchestrationServiceState Service state of Service + * Fabric Upgrade Orchestration Service. + * + * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of + * Service Fabric Upgrade Orchestration Service. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {UpgradeOrchestrationServiceStateSummary} - 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. + * + * {UpgradeOrchestrationServiceStateSummary} [result] - The deserialized result object if an error did not occur. + * See {@link UpgradeOrchestrationServiceStateSummary} 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. + */ + setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState: models.UpgradeOrchestrationServiceState, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState: models.UpgradeOrchestrationServiceState, callback: ServiceCallback): void; + setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState: models.UpgradeOrchestrationServiceState, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Provision the code or configuration packages of a Service Fabric * cluster. @@ -1809,9 +2015,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1843,9 +2049,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1880,7 +2086,7 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Unprovision the code or configuration packages of a Service Fabric * cluster. * - * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. * * @param {object} unprovisionFabricDescription Describes the parameters for * unprovisioning a cluster. @@ -1894,9 +2100,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1913,7 +2119,7 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Unprovision the code or configuration packages of a Service Fabric * cluster. * - * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. * * @param {object} unprovisionFabricDescription Describes the parameters for * unprovisioning a cluster. @@ -1927,9 +2133,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1963,14 +2169,14 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Rollback the upgrade of a Service Fabric cluster. * - * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1986,14 +2192,14 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Rollback the upgrade of a Service Fabric cluster. * - * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2027,7 +2233,8 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Make the cluster upgrade move on to the next upgrade domain. * - * Make the cluster upgrade move on to the next upgrade domain. + * Make the cluster code or configuration upgrade move on to the next upgrade + * domain if appropriate. * * @param {object} resumeClusterUpgradeDescription Describes the parameters for * resuming a cluster upgrade. @@ -2038,9 +2245,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2056,7 +2263,8 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Make the cluster upgrade move on to the next upgrade domain. * - * Make the cluster upgrade move on to the next upgrade domain. + * Make the cluster code or configuration upgrade move on to the next upgrade + * domain if appropriate. * * @param {object} resumeClusterUpgradeDescription Describes the parameters for * resuming a cluster upgrade. @@ -2067,9 +2275,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2117,40 +2325,80 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [startClusterUpgradeDescription.configVersion] The cluster * configuration version. * - * @param {string} [startClusterUpgradeDescription.upgradeKind] Possible values - * include: 'Invalid', 'Rolling' + * @param {string} [startClusterUpgradeDescription.upgradeKind] The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} - * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [startClusterUpgradeDescription.forceRestart] + * @param {boolean} [startClusterUpgradeDescription.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} [startClusterUpgradeDescription.monitoringPolicy] + * @param {object} [startClusterUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [startClusterUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [startClusterUpgradeDescription.clusterHealthPolicy] + * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] @@ -2173,7 +2421,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [startClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -2191,9 +2438,30 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [startClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, @@ -2201,6 +2469,8 @@ declare class ServiceFabricClient extends ServiceClient { * completion of each upgrade domain. * * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. * * @param {number} * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] @@ -2222,16 +2492,20 @@ declare class ServiceFabricClient extends ServiceClient { * tolerated limits. The default value is 15%. * * @param {object} [startClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2261,40 +2535,80 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [startClusterUpgradeDescription.configVersion] The cluster * configuration version. * - * @param {string} [startClusterUpgradeDescription.upgradeKind] Possible values - * include: 'Invalid', 'Rolling' + * @param {string} [startClusterUpgradeDescription.upgradeKind] The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} - * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [startClusterUpgradeDescription.forceRestart] + * @param {boolean} [startClusterUpgradeDescription.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} [startClusterUpgradeDescription.monitoringPolicy] + * @param {object} [startClusterUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [startClusterUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [startClusterUpgradeDescription.clusterHealthPolicy] + * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] @@ -2317,7 +2631,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [startClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -2335,9 +2648,30 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [startClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, @@ -2345,6 +2679,8 @@ declare class ServiceFabricClient extends ServiceClient { * completion of each upgrade domain. * * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. * * @param {number} * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] @@ -2366,16 +2702,20 @@ declare class ServiceFabricClient extends ServiceClient { * tolerated limits. The default value is 15%. * * @param {object} [startClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2461,12 +2801,22 @@ declare class ServiceFabricClient extends ServiceClient { * The maximum allowed percentage of upgrade domain delta health degradation * during the upgrade. Allowed values are integer values from zero to 100. * + * @param {object} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies] Defines + * the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2534,12 +2884,22 @@ declare class ServiceFabricClient extends ServiceClient { * The maximum allowed percentage of upgrade domain delta health degradation * during the upgrade. Allowed values are integer values from zero to 100. * + * @param {object} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies] Defines + * the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2573,47 +2933,88 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. * - * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. * * @param {object} updateClusterUpgradeDescription Parameters for updating a * cluster upgrade. * - * @param {string} [updateClusterUpgradeDescription.upgradeKind] Possible - * values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart' + * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling', 'Rolling_ForceRestart' * * @param {object} [updateClusterUpgradeDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. * * @param {string} - * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {boolean} - * [updateClusterUpgradeDescription.updateDescription.forceRestart] + * [updateClusterUpgradeDescription.updateDescription.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 {number} * [updateClusterUpgradeDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} - * [updateClusterUpgradeDescription.updateDescription.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [updateClusterUpgradeDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [updateClusterUpgradeDescription.clusterHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. * * @param {boolean} * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] @@ -2636,7 +3037,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [updateClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -2654,14 +3054,39 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} - * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] + * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * enables delta health evaluation rather than absolute health evaluation after + * completion of each upgrade domain. * * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. * * @param {number} * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] @@ -2683,16 +3108,20 @@ declare class ServiceFabricClient extends ServiceClient { * tolerated limits. The default value is 15%. * * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2708,47 +3137,88 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. * - * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. * * @param {object} updateClusterUpgradeDescription Parameters for updating a * cluster upgrade. * - * @param {string} [updateClusterUpgradeDescription.upgradeKind] Possible - * values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart' + * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling', 'Rolling_ForceRestart' * * @param {object} [updateClusterUpgradeDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. * * @param {string} - * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {boolean} - * [updateClusterUpgradeDescription.updateDescription.forceRestart] + * [updateClusterUpgradeDescription.updateDescription.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 {number} * [updateClusterUpgradeDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} - * [updateClusterUpgradeDescription.updateDescription.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [updateClusterUpgradeDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [updateClusterUpgradeDescription.clusterHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. * * @param {boolean} * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] @@ -2771,7 +3241,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [updateClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -2789,14 +3258,39 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} - * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] + * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * enables delta health evaluation rather than absolute health evaluation after + * completion of each upgrade domain. * * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. * * @param {number} * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] @@ -2818,16 +3312,20 @@ declare class ServiceFabricClient extends ServiceClient { * tolerated limits. The default value is 15%. * * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2868,13 +3366,12 @@ declare class ServiceFabricClient extends ServiceClient { * needed to set up an Azure Active Directory secured connection with a Service * Fabric cluster. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2897,13 +3394,12 @@ declare class ServiceFabricClient extends ServiceClient { * needed to set up an Azure Active Directory secured connection with a Service * Fabric cluster. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2938,48 +3434,37 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the list of nodes in the Service Fabric cluster. * - * The Nodes endpoint returns information about the nodes in the Service Fabric - * Cluster. The respons include the name, status, id, health, uptime and other - * details about the node. + * The response includes the name, status, ID, health, uptime, and other + * details about the nodes. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {string} [options.nodeStatusFilter] Allows filtering the nodes based * on the NodeStatus. Only the nodes that are matching the specified filter * value will be returned. The filter value can be one of the following. - * - * - default - This filter value will match all of the nodes excepts the ones - * with with status as Unknown or Removed. - * - all - This filter value will match all of the nodes. - * - up - This filter value will match nodes that are Up. - * - down - This filter value will match nodes that are Down. - * - enabling - This filter value will match nodes that are in the process of - * being enabled with status as Enabling. - * - disabling - This filter value will match nodes that are in the process of - * being disabled with status as Disabling. - * - disabled - This filter value will match nodes that are Disabled. - * - unknown - This filter value will match nodes whose status is Unknown. A - * node would be in Unknown state if Service Fabric does not have authoritative - * information about that node. This can happen if the system learns about a - * node at runtime. - * - removed - This filter value will match nodes whose status is Removed. - * These are the nodes that are removed from the cluster using the - * RemoveNodeState API. - * . Possible values include: 'default', 'all', 'up', 'down', 'enabling', + * Possible values include: 'default', 'all', 'up', 'down', 'enabling', * 'disabling', 'disabled', 'unknown', 'removed' * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2990,53 +3475,42 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - getNodeInfoListWithHttpOperationResponse(options?: { continuationToken? : string, nodeStatusFilter? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getNodeInfoListWithHttpOperationResponse(options?: { continuationToken? : string, nodeStatusFilter? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the list of nodes in the Service Fabric cluster. * - * The Nodes endpoint returns information about the nodes in the Service Fabric - * Cluster. The respons include the name, status, id, health, uptime and other - * details about the node. + * The response includes the name, status, ID, health, uptime, and other + * details about the nodes. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {string} [options.nodeStatusFilter] Allows filtering the nodes based * on the NodeStatus. Only the nodes that are matching the specified filter * value will be returned. The filter value can be one of the following. - * - * - default - This filter value will match all of the nodes excepts the ones - * with with status as Unknown or Removed. - * - all - This filter value will match all of the nodes. - * - up - This filter value will match nodes that are Up. - * - down - This filter value will match nodes that are Down. - * - enabling - This filter value will match nodes that are in the process of - * being enabled with status as Enabling. - * - disabling - This filter value will match nodes that are in the process of - * being disabled with status as Disabling. - * - disabled - This filter value will match nodes that are Disabled. - * - unknown - This filter value will match nodes whose status is Unknown. A - * node would be in Unknown state if Service Fabric does not have authoritative - * information about that node. This can happen if the system learns about a - * node at runtime. - * - removed - This filter value will match nodes whose status is Removed. - * These are the nodes that are removed from the cluster using the - * RemoveNodeState API. - * . Possible values include: 'default', 'all', 'up', 'down', 'enabling', + * Possible values include: 'default', 'all', 'up', 'down', 'enabling', * 'disabling', 'disabled', 'unknown', 'removed' * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3063,26 +3537,26 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getNodeInfoList(options?: { continuationToken? : string, nodeStatusFilter? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getNodeInfoList(options?: { continuationToken? : string, nodeStatusFilter? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; getNodeInfoList(callback: ServiceCallback): void; - getNodeInfoList(options: { continuationToken? : string, nodeStatusFilter? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNodeInfoList(options: { continuationToken? : string, nodeStatusFilter? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the list of nodes in the Service Fabric cluster. + * @summary Gets the information about a specific node in the Service Fabric + * cluster. * - * Gets the information about a specific node in the Service Fabric Cluster.The - * respons include the name, status, id, health, uptime and other details about - * the node. + * The response includes the name, status, ID, health, uptime, and other + * details about the node. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3096,20 +3570,20 @@ declare class ServiceFabricClient extends ServiceClient { getNodeInfoWithHttpOperationResponse(nodeName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the list of nodes in the Service Fabric cluster. + * @summary Gets the information about a specific node in the Service Fabric + * cluster. * - * Gets the information about a specific node in the Service Fabric Cluster.The - * respons include the name, status, id, health, uptime and other details about - * the node. + * The response includes the name, status, ID, health, uptime, and other + * details about the node. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3159,10 +3633,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -3176,11 +3650,10 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3211,10 +3684,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -3228,11 +3701,10 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3284,10 +3756,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -3301,7 +3773,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.clusterHealthPolicy] Describes the health policies * used to evaluate the health of a cluster or node. If not present, the health * evaluation uses the health policy from cluster manifest or the default @@ -3326,7 +3797,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthPolicy.maxPercentUnhealthyApplications] The maximum * allowed percentage of unhealthy applications before reporting an error. For @@ -3344,13 +3814,34 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} [options.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3383,10 +3874,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -3400,7 +3891,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.clusterHealthPolicy] Describes the health policies * used to evaluate the health of a cluster or node. If not present, the health * evaluation uses the health policy from cluster manifest or the default @@ -3425,7 +3915,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthPolicy.maxPercentUnhealthyApplications] The maximum * allowed percentage of unhealthy applications before reporting an error. For @@ -3443,13 +3932,34 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} [options.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3496,16 +4006,14 @@ declare class ServiceFabricClient extends ServiceClient { * To see whether the report was applied in the health store, run GetNodeHealth * and check that the report appears in the HealthEvents section. * - * * @param {string} nodeName The name of the node. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -3522,12 +4030,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -3539,7 +4048,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -3551,7 +4059,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -3559,10 +4066,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -3572,33 +4078,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3626,16 +4130,14 @@ declare class ServiceFabricClient extends ServiceClient { * To see whether the report was applied in the health store, run GetNodeHealth * and check that the report appears in the HealthEvents section. * - * * @param {string} nodeName The name of the node. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -3652,12 +4154,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -3669,7 +4172,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -3681,7 +4183,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -3689,10 +4190,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -3702,33 +4202,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3762,16 +4260,17 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the load information of a Service Fabric node. * - * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics + * that have load or capacity defined. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3787,16 +4286,17 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the load information of a Service Fabric node. * - * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics + * that have load or capacity defined. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3834,13 +4334,13 @@ declare class ServiceFabricClient extends ServiceClient { * * Deactivate a Service Fabric cluster node with the specified deactivation * intent. Once the deactivation is in progress, the deactivation intent can be - * increased, but not decreased (for example, a node which is was deactivated - * with the Pause intent can be deactivated further with Restart, but not the - * other way around. Nodes may be reactivated using the Activate a node - * operation any time after they are deactivated. If the deactivation is not - * complete this will cancel the deactivation. A node which goes down and comes - * back up while deactivated will still need to be reactivated before services - * will be placed on that node. + * increased, but not decreased (for example, a node that is deactivated with + * the Pause intent can be deactivated further with Restart, but not the other + * way around. Nodes may be reactivated using the Activate a node operation any + * time after they are deactivated. If the deactivation is not complete, this + * will cancel the deactivation. A node that goes down and comes back up while + * deactivated will still need to be reactivated before services will be placed + * on that node. * * @param {string} nodeName The name of the node. * @@ -3849,20 +4349,14 @@ declare class ServiceFabricClient extends ServiceClient { * * @param {string} [deactivationIntentDescription.deactivationIntent] Describes * the intent or reason for deactivating the node. The possible values are - * following. - * - Pause - Indicates that the node should be paused. The value is 1. - * - Restart - Indicates that the intent is for the node to be restarted after - * a short period of time. The value is 2. - * - RemoveData - Indicates the intent is for the node to remove data. The - * value is 3. - * . Possible values include: 'Pause', 'Restart', 'RemoveData' + * following. Possible values include: 'Pause', 'Restart', 'RemoveData' * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3881,13 +4375,13 @@ declare class ServiceFabricClient extends ServiceClient { * * Deactivate a Service Fabric cluster node with the specified deactivation * intent. Once the deactivation is in progress, the deactivation intent can be - * increased, but not decreased (for example, a node which is was deactivated - * with the Pause intent can be deactivated further with Restart, but not the - * other way around. Nodes may be reactivated using the Activate a node - * operation any time after they are deactivated. If the deactivation is not - * complete this will cancel the deactivation. A node which goes down and comes - * back up while deactivated will still need to be reactivated before services - * will be placed on that node. + * increased, but not decreased (for example, a node that is deactivated with + * the Pause intent can be deactivated further with Restart, but not the other + * way around. Nodes may be reactivated using the Activate a node operation any + * time after they are deactivated. If the deactivation is not complete, this + * will cancel the deactivation. A node that goes down and comes back up while + * deactivated will still need to be reactivated before services will be placed + * on that node. * * @param {string} nodeName The name of the node. * @@ -3896,20 +4390,14 @@ declare class ServiceFabricClient extends ServiceClient { * * @param {string} [deactivationIntentDescription.deactivationIntent] Describes * the intent or reason for deactivating the node. The possible values are - * following. - * - Pause - Indicates that the node should be paused. The value is 1. - * - Restart - Indicates that the intent is for the node to be restarted after - * a short period of time. The value is 2. - * - RemoveData - Indicates the intent is for the node to remove data. The - * value is 3. - * . Possible values include: 'Pause', 'Restart', 'RemoveData' + * following. Possible values include: 'Pause', 'Restart', 'RemoveData' * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3941,10 +4429,10 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Activate a Service Fabric cluster node which is currently + * @summary Activate a Service Fabric cluster node that is currently * deactivated. * - * Activates a Service Fabric cluster node which is currently deactivated. Once + * Activates a Service Fabric cluster node that is currently deactivated. Once * activated, the node will again become a viable target for placing new * replicas, and any deactivated replicas remaining on the node will be * reactivated. @@ -3954,9 +4442,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3970,10 +4458,10 @@ declare class ServiceFabricClient extends ServiceClient { enableNodeWithHttpOperationResponse(nodeName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Activate a Service Fabric cluster node which is currently + * @summary Activate a Service Fabric cluster node that is currently * deactivated. * - * Activates a Service Fabric cluster node which is currently deactivated. Once + * Activates a Service Fabric cluster node that is currently deactivated. Once * activated, the node will again become a viable target for placing new * replicas, and any deactivated replicas remaining on the node will be * reactivated. @@ -3983,9 +4471,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4020,24 +4508,23 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Notifies Service Fabric that the persisted state on a node has been * permanently removed or lost. * - * Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. This implies that it is not possible to - * recover the persisted state of that node. This generally happens if a hard - * disk has been wiped clean, or if a hard disk crashes. The node has to be - * down for this operation to be successful. This operation lets Service Fabric - * know that the replicas on that node no longer exist, and that Service Fabric - * should stop waiting for those replicas to come back up. Do not run this - * cmdlet if the state on the node has not been removed and the node can comes - * back up with its state intact. + * This implies that it is not possible to recover the persisted state of that + * node. This generally happens if a hard disk has been wiped clean, or if a + * hard disk crashes. The node has to be down for this operation to be + * successful. This operation lets Service Fabric know that the replicas on + * that node no longer exist, and that Service Fabric should stop waiting for + * those replicas to come back up. Do not run this cmdlet if the state on the + * node has not been removed and the node can come back up with its state + * intact. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4054,24 +4541,23 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Notifies Service Fabric that the persisted state on a node has been * permanently removed or lost. * - * Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. This implies that it is not possible to - * recover the persisted state of that node. This generally happens if a hard - * disk has been wiped clean, or if a hard disk crashes. The node has to be - * down for this operation to be successful. This operation lets Service Fabric - * know that the replicas on that node no longer exist, and that Service Fabric - * should stop waiting for those replicas to come back up. Do not run this - * cmdlet if the state on the node has not been removed and the node can comes - * back up with its state intact. + * This implies that it is not possible to recover the persisted state of that + * node. This generally happens if a hard disk has been wiped clean, or if a + * hard disk crashes. The node has to be down for this operation to be + * successful. This operation lets Service Fabric know that the replicas on + * that node no longer exist, and that Service Fabric should stop waiting for + * those replicas to come back up. Do not run this cmdlet if the state on the + * node has not been removed and the node can come back up with its state + * intact. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4112,21 +4598,21 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} restartNodeDescription The instance of the node to be * restarted and a flag indicating the need to take dump of the fabric process. * - * @param {string} restartNodeDescription.nodeInstanceId The instance id of the - * target node. If instance id is specified the node is restarted only if it + * @param {string} restartNodeDescription.nodeInstanceId The instance ID of the + * target node. If instance ID is specified the node is restarted only if it * matches with the current instance of the node. A default value of "0" would - * match any instance id. The instance id can be obtained using get node query. + * match any instance ID. The instance ID can be obtained using get node query. * * @param {string} [restartNodeDescription.createFabricDump] Specify True to - * create a dump of the fabric node process. This is case sensitive. Possible + * create a dump of the fabric node process. This is case-sensitive. Possible * values include: 'False', 'True' * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4149,21 +4635,21 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} restartNodeDescription The instance of the node to be * restarted and a flag indicating the need to take dump of the fabric process. * - * @param {string} restartNodeDescription.nodeInstanceId The instance id of the - * target node. If instance id is specified the node is restarted only if it + * @param {string} restartNodeDescription.nodeInstanceId The instance ID of the + * target node. If instance ID is specified the node is restarted only if it * matches with the current instance of the node. A default value of "0" would - * match any instance id. The instance id can be obtained using get node query. + * match any instance ID. The instance ID can be obtained using get node query. * * @param {string} [restartNodeDescription.createFabricDump] Specify True to - * create a dump of the fabric node process. This is case sensitive. Possible + * create a dump of the fabric node process. This is case-sensitive. Possible * values include: 'False', 'True' * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4200,22 +4686,23 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the information about the application types that are provisioned or * in the process of being provisioned in the Service Fabric cluster. Each * version of an application type is returned as one application type. The - * response includes the name, version, status and other details about the + * response includes the name, version, status, and other details about the * application type. This is a paged query, meaning that if not all of the * application types fit in a page, one page of results is returned as well as - * a continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * a continuation token, which can be used to get the next page. For example, + * if there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. * * @param {object} [options] Optional Parameters. * * @param {number} [options.applicationTypeDefinitionKindFilter] Used to filter - * on ApplicationTypeDefinitionKind for application type query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationTypeDefinitionKind value. The value is 0. + * on ApplicationTypeDefinitionKind which is the mechanism used to define a + * Service Fabric application type. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. * - All - Filter that matches input with any ApplicationTypeDefinitionKind * value. The value is 65535. * - ServiceFabricApplicationPackage - Filter that matches input with @@ -4224,16 +4711,15 @@ declare class ServiceFabricClient extends ServiceClient { * - Compose - Filter that matches input with ApplicationTypeDefinitionKind * value Compose. The value is 2. * - * * @param {boolean} [options.excludeApplicationParameters] The flag that * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -4241,13 +4727,13 @@ declare class ServiceFabricClient extends ServiceClient { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4266,22 +4752,23 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the information about the application types that are provisioned or * in the process of being provisioned in the Service Fabric cluster. Each * version of an application type is returned as one application type. The - * response includes the name, version, status and other details about the + * response includes the name, version, status, and other details about the * application type. This is a paged query, meaning that if not all of the * application types fit in a page, one page of results is returned as well as - * a continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * a continuation token, which can be used to get the next page. For example, + * if there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. * * @param {object} [options] Optional Parameters. * * @param {number} [options.applicationTypeDefinitionKindFilter] Used to filter - * on ApplicationTypeDefinitionKind for application type query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationTypeDefinitionKind value. The value is 0. + * on ApplicationTypeDefinitionKind which is the mechanism used to define a + * Service Fabric application type. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. * - All - Filter that matches input with any ApplicationTypeDefinitionKind * value. The value is 65535. * - ServiceFabricApplicationPackage - Filter that matches input with @@ -4290,16 +4777,15 @@ declare class ServiceFabricClient extends ServiceClient { * - Compose - Filter that matches input with ApplicationTypeDefinitionKind * value Compose. The value is 2. * - * * @param {boolean} [options.excludeApplicationParameters] The flag that * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -4307,13 +4793,13 @@ declare class ServiceFabricClient extends ServiceClient { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4356,29 +4842,32 @@ declare class ServiceFabricClient extends ServiceClient { * as the parameter, and which comply with the given query parameters. All * versions of the application type matching the application type name are * returned, with each version returned as one application type. The response - * includes the name, version, status and other details about the application + * includes the name, version, status, and other details about the application * type. This is a paged query, meaning that if not all of the application * types fit in a page, one page of results is returned as well as a - * continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * continuation token, which can be used to get the next page. For example, if + * there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. * * @param {string} applicationTypeName The name of the application type. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.applicationTypeVersion] The version of the + * application type. + * * @param {boolean} [options.excludeApplicationParameters] The flag that * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -4386,13 +4875,13 @@ declare class ServiceFabricClient extends ServiceClient { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4403,7 +4892,7 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - getApplicationTypeInfoListByNameWithHttpOperationResponse(applicationTypeName: string, options?: { excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getApplicationTypeInfoListByNameWithHttpOperationResponse(applicationTypeName: string, options?: { applicationTypeVersion? : string, excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the list of application types in the Service Fabric cluster @@ -4415,29 +4904,32 @@ declare class ServiceFabricClient extends ServiceClient { * as the parameter, and which comply with the given query parameters. All * versions of the application type matching the application type name are * returned, with each version returned as one application type. The response - * includes the name, version, status and other details about the application + * includes the name, version, status, and other details about the application * type. This is a paged query, meaning that if not all of the application * types fit in a page, one page of results is returned as well as a - * continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * continuation token, which can be used to get the next page. For example, if + * there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. * * @param {string} applicationTypeName The name of the application type. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.applicationTypeVersion] The version of the + * application type. + * * @param {boolean} [options.excludeApplicationParameters] The flag that * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -4445,13 +4937,13 @@ declare class ServiceFabricClient extends ServiceClient { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4479,31 +4971,44 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getApplicationTypeInfoListByName(applicationTypeName: string, options?: { excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getApplicationTypeInfoListByName(applicationTypeName: string, options?: { applicationTypeVersion? : string, excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; getApplicationTypeInfoListByName(applicationTypeName: string, callback: ServiceCallback): void; - getApplicationTypeInfoListByName(applicationTypeName: string, options: { excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getApplicationTypeInfoListByName(applicationTypeName: string, options: { applicationTypeVersion? : string, excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * @summary Provisions or registers a Service Fabric application type with the - * cluster. + * cluster using the '.sfpkg' package in the external store or using the + * application package in the image store. + * + * Provisions a Service Fabric application type with the cluster. The provision + * is required before any new applications can be instantiated. + * The provision operation can be performed either on the application package + * specified by the relativePathInImageStore, or by using the URI of the + * external '.sfpkg'. * - * Provisions or registers a Service Fabric application type with the cluster. - * This is required before any new applications can be instantiated. + * @param {object} provisionApplicationTypeDescriptionBaseRequiredBodyParam The + * base type of provision application type description which supports either + * image store-based provision or external store-based provision. * - * @param {object} applicationTypeImageStorePath The relative path for the - * application package in the image store specified during the prior copy - * operation. + * @param {boolean} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.async Indicates + * whether or not provisioning should occur asynchronously. When set to true, + * the provision operation returns when the request is accepted by the system, + * and the provision operation continues without any timeout limit. The default + * value is false. For large application packages, we recommend setting the + * value to true. * - * @param {string} applicationTypeImageStorePath.applicationTypeBuildPath The - * relative image store path to the application package. + * @param {string} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic + * Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4514,28 +5019,41 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - provisionApplicationTypeWithHttpOperationResponse(applicationTypeImageStorePath: models.ApplicationTypeImageStorePath, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + provisionApplicationTypeWithHttpOperationResponse(provisionApplicationTypeDescriptionBaseRequiredBodyParam: models.ProvisionApplicationTypeDescriptionBase, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Provisions or registers a Service Fabric application type with the - * cluster. + * cluster using the '.sfpkg' package in the external store or using the + * application package in the image store. * - * Provisions or registers a Service Fabric application type with the cluster. - * This is required before any new applications can be instantiated. + * Provisions a Service Fabric application type with the cluster. The provision + * is required before any new applications can be instantiated. + * The provision operation can be performed either on the application package + * specified by the relativePathInImageStore, or by using the URI of the + * external '.sfpkg'. * - * @param {object} applicationTypeImageStorePath The relative path for the - * application package in the image store specified during the prior copy - * operation. + * @param {object} provisionApplicationTypeDescriptionBaseRequiredBodyParam The + * base type of provision application type description which supports either + * image store-based provision or external store-based provision. * - * @param {string} applicationTypeImageStorePath.applicationTypeBuildPath The - * relative image store path to the application package. + * @param {boolean} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.async Indicates + * whether or not provisioning should occur asynchronously. When set to true, + * the provision operation returns when the request is accepted by the system, + * and the provision operation continues without any timeout limit. The default + * value is false. For large application packages, we recommend setting the + * value to true. + * + * @param {string} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic + * Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4561,34 +5079,43 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - provisionApplicationType(applicationTypeImageStorePath: models.ApplicationTypeImageStorePath, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - provisionApplicationType(applicationTypeImageStorePath: models.ApplicationTypeImageStorePath, callback: ServiceCallback): void; - provisionApplicationType(applicationTypeImageStorePath: models.ApplicationTypeImageStorePath, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam: models.ProvisionApplicationTypeDescriptionBase, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam: models.ProvisionApplicationTypeDescriptionBase, callback: ServiceCallback): void; + provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam: models.ProvisionApplicationTypeDescriptionBase, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * @summary Removes or unregisters a Service Fabric application type from the * cluster. * - * Removes or unregisters a Service Fabric application type from the cluster. - * This operation can only be performed if all application instance of the - * application type has been deleted. Once the application type is - * unregistered, no new application instance can be created for this particular - * application type. + * This operation can only be performed if all application instances of the + * application type have been deleted. Once the application type is + * unregistered, no new application instances can be created for this + * particular application type. * * @param {string} applicationTypeName The name of the application type. * - * @param {object} applicationTypeImageStoreVersion The version of the - * application type in the image store. + * @param {object} unprovisionApplicationTypeDescriptionInfo The relative path + * for the application package in the image store specified during the prior + * copy operation. + * + * @param {string} + * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version + * of the application type as defined in the application manifest. * - * @param {string} applicationTypeImageStoreVersion.applicationTypeVersion + * @param {boolean} [unprovisionApplicationTypeDescriptionInfo.async] The flag + * indicating whether or not unprovision should occur asynchronously. When set + * to true, the unprovision operation returns when the request is accepted by + * the system, and the unprovision operation continues without any timeout + * limit. The default value is false. However, we recommend setting it to true + * for large application packages that were provisioned. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4599,31 +5126,40 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - unprovisionApplicationTypeWithHttpOperationResponse(applicationTypeName: string, applicationTypeImageStoreVersion: models.ApplicationTypeImageStoreVersion, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + unprovisionApplicationTypeWithHttpOperationResponse(applicationTypeName: string, unprovisionApplicationTypeDescriptionInfo: models.UnprovisionApplicationTypeDescriptionInfo, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Removes or unregisters a Service Fabric application type from the * cluster. * - * Removes or unregisters a Service Fabric application type from the cluster. - * This operation can only be performed if all application instance of the - * application type has been deleted. Once the application type is - * unregistered, no new application instance can be created for this particular - * application type. + * This operation can only be performed if all application instances of the + * application type have been deleted. Once the application type is + * unregistered, no new application instances can be created for this + * particular application type. * * @param {string} applicationTypeName The name of the application type. * - * @param {object} applicationTypeImageStoreVersion The version of the - * application type in the image store. + * @param {object} unprovisionApplicationTypeDescriptionInfo The relative path + * for the application package in the image store specified during the prior + * copy operation. * - * @param {string} applicationTypeImageStoreVersion.applicationTypeVersion + * @param {string} + * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version + * of the application type as defined in the application manifest. + * + * @param {boolean} [unprovisionApplicationTypeDescriptionInfo.async] The flag + * indicating whether or not unprovision should occur asynchronously. When set + * to true, the unprovision operation returns when the request is accepted by + * the system, and the unprovision operation continues without any timeout + * limit. The default value is false. However, we recommend setting it to true + * for large application packages that were provisioned. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4649,9 +5185,9 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - unprovisionApplicationType(applicationTypeName: string, applicationTypeImageStoreVersion: models.ApplicationTypeImageStoreVersion, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - unprovisionApplicationType(applicationTypeName: string, applicationTypeImageStoreVersion: models.ApplicationTypeImageStoreVersion, callback: ServiceCallback): void; - unprovisionApplicationType(applicationTypeName: string, applicationTypeImageStoreVersion: models.ApplicationTypeImageStoreVersion, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + unprovisionApplicationType(applicationTypeName: string, unprovisionApplicationTypeDescriptionInfo: models.UnprovisionApplicationTypeDescriptionInfo, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + unprovisionApplicationType(applicationTypeName: string, unprovisionApplicationTypeDescriptionInfo: models.UnprovisionApplicationTypeDescriptionInfo, callback: ServiceCallback): void; + unprovisionApplicationType(applicationTypeName: string, unprovisionApplicationTypeDescriptionInfo: models.UnprovisionApplicationTypeDescriptionInfo, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4660,9 +5196,7 @@ declare class ServiceFabricClient extends ServiceClient { * * Gets the list containing the information about service types that are * supported by a provisioned application type in a Service Fabric cluster. The - * response includes the name of the service type, the name and version of the - * service manifest the type is defined in, kind (stateless or stateless) of - * the service type and other information about it. + * provided application type must exist. Otherwise, a 404 status is returned. * * @param {string} applicationTypeName The name of the application type. * @@ -4671,9 +5205,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4692,9 +5226,7 @@ declare class ServiceFabricClient extends ServiceClient { * * Gets the list containing the information about service types that are * supported by a provisioned application type in a Service Fabric cluster. The - * response includes the name of the service type, the name and version of the - * service manifest the type is defined in, kind (stateless or stateless) of - * the service type and other information about it. + * provided application type must exist. Otherwise, a 404 status is returned. * * @param {string} applicationTypeName The name of the application type. * @@ -4703,9 +5235,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4736,6 +5268,95 @@ declare class ServiceFabricClient extends ServiceClient { getServiceTypeInfoList(applicationTypeName: string, applicationTypeVersion: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Gets the information about a specific service type that is + * supported by a provisioned application type in a Service Fabric cluster. + * + * Gets the information about a specific service type that is supported by a + * provisioned application type in a Service Fabric cluster. The provided + * application type must exist. Otherwise, a 404 status is returned. A 204 + * response is returned if the specificed service type is not found in the + * cluster. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getServiceTypeInfoByNameWithHttpOperationResponse(applicationTypeName: string, applicationTypeVersion: string, serviceTypeName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the information about a specific service type that is + * supported by a provisioned application type in a Service Fabric cluster. + * + * Gets the information about a specific service type that is supported by a + * provisioned application type in a Service Fabric cluster. The provided + * application type must exist. Otherwise, a 404 status is returned. A 204 + * response is returned if the specificed service type is not found in the + * cluster. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ServiceTypeInfo} - 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. + * + * {ServiceTypeInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceTypeInfo} 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. + */ + getServiceTypeInfoByName(applicationTypeName: string, applicationTypeVersion: string, serviceTypeName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getServiceTypeInfoByName(applicationTypeName: string, applicationTypeVersion: string, serviceTypeName: string, callback: ServiceCallback): void; + getServiceTypeInfoByName(applicationTypeName: string, applicationTypeVersion: string, serviceTypeName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets the manifest describing a service type. * @@ -4752,9 +5373,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4783,9 +5404,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4824,15 +5445,16 @@ declare class ServiceFabricClient extends ServiceClient { * Gets the list containing the information about service types from the * applications deployed on a node in a Service Fabric cluster. The response * includes the name of the service type, its registration status, the code - * package that registered it and activation id of the service package. + * package that registered it and activation ID of the service package. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -4843,9 +5465,9 @@ declare class ServiceFabricClient extends ServiceClient { * types that are defined in this service manifest. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4865,15 +5487,16 @@ declare class ServiceFabricClient extends ServiceClient { * Gets the list containing the information about service types from the * applications deployed on a node in a Service Fabric cluster. The response * includes the name of the service type, its registration status, the code - * package that registered it and activation id of the service package. + * package that registered it and activation ID of the service package. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -4884,9 +5507,9 @@ declare class ServiceFabricClient extends ServiceClient { * types that are defined in this service manifest. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4924,17 +5547,18 @@ declare class ServiceFabricClient extends ServiceClient { * Gets the list containing the information about a specific service type from * the applications deployed on a node in a Service Fabric cluster. The * response includes the name of the service type, its registration status, the - * code package that registered it and activation id of the service package. + * code package that registered it and activation ID of the service package. * Each entry represents one activation of a service type, differentiated by - * the activation id. + * the activation ID. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} serviceTypeName Specifies the name of a Service Fabric @@ -4948,9 +5572,9 @@ declare class ServiceFabricClient extends ServiceClient { * types that are defined in this service manifest. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4970,17 +5594,18 @@ declare class ServiceFabricClient extends ServiceClient { * Gets the list containing the information about a specific service type from * the applications deployed on a node in a Service Fabric cluster. The * response includes the name of the service type, its registration status, the - * code package that registered it and activation id of the service package. + * code package that registered it and activation ID of the service package. * Each entry represents one activation of a service type, differentiated by - * the activation id. + * the activation ID. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} serviceTypeName Specifies the name of a Service Fabric @@ -4994,9 +5619,9 @@ declare class ServiceFabricClient extends ServiceClient { * types that are defined in this service manifest. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5035,15 +5660,27 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} applicationDescription Description for creating an * application. * - * @param {string} applicationDescription.name + * @param {string} applicationDescription.name The name of the application, + * including the 'fabric:' URI scheme. * - * @param {string} applicationDescription.typeName + * @param {string} applicationDescription.typeName The application type name as + * defined in the application manifest. * - * @param {string} applicationDescription.typeVersion + * @param {string} applicationDescription.typeVersion The version of the + * application type as defined in the application manifest. * - * @param {array} [applicationDescription.parameterList] + * @param {array} [applicationDescription.parameterList] List of application + * parameters with overridden values from their default values specified in the + * application manifest. * - * @param {object} [applicationDescription.applicationCapacity] + * @param {object} [applicationDescription.applicationCapacity] Describes + * capacity information for services of this application. This description can + * be used for describing the following. + * - Reserving the capacity for the services on the nodes + * - Limiting the total number of nodes that services of this application can + * run on + * - Limiting the custom capacity metrics to limit the total consumption of + * this metric by the services of this application * * @param {number} [applicationDescription.applicationCapacity.minimumNodes] * The minimum number of nodes where Service Fabric will reserve capacity for @@ -5060,14 +5697,15 @@ declare class ServiceFabricClient extends ServiceClient { * node. * * @param {array} - * [applicationDescription.applicationCapacity.applicationMetrics] + * [applicationDescription.applicationCapacity.applicationMetrics] List of + * application capacity metric description. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5088,15 +5726,27 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} applicationDescription Description for creating an * application. * - * @param {string} applicationDescription.name + * @param {string} applicationDescription.name The name of the application, + * including the 'fabric:' URI scheme. * - * @param {string} applicationDescription.typeName + * @param {string} applicationDescription.typeName The application type name as + * defined in the application manifest. * - * @param {string} applicationDescription.typeVersion + * @param {string} applicationDescription.typeVersion The version of the + * application type as defined in the application manifest. * - * @param {array} [applicationDescription.parameterList] + * @param {array} [applicationDescription.parameterList] List of application + * parameters with overridden values from their default values specified in the + * application manifest. * - * @param {object} [applicationDescription.applicationCapacity] + * @param {object} [applicationDescription.applicationCapacity] Describes + * capacity information for services of this application. This description can + * be used for describing the following. + * - Reserving the capacity for the services on the nodes + * - Limiting the total number of nodes that services of this application can + * run on + * - Limiting the custom capacity metrics to limit the total consumption of + * this metric by the services of this application * * @param {number} [applicationDescription.applicationCapacity.minimumNodes] * The minimum number of nodes where Service Fabric will reserve capacity for @@ -5113,14 +5763,15 @@ declare class ServiceFabricClient extends ServiceClient { * node. * * @param {array} - * [applicationDescription.applicationCapacity.applicationMetrics] + * [applicationDescription.applicationCapacity.applicationMetrics] List of + * application capacity metric description. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5154,20 +5805,20 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Deletes an existing Service Fabric application. * - * Deletes an existing Service Fabric application. An application must be - * created before it can be deleted. Deleting an application will delete all - * services that are part of that application. By default Service Fabric will - * try to close service replicas in a graceful manner and then delete the - * service. However if service is having issues closing the replica gracefully, - * the delete operation may take a long time or get stuck. Use the optional - * ForceRemove flag to skip the graceful close sequence and forcefully delete - * the application and all of the its services. + * An application must be created before it can be deleted. Deleting an + * application will delete all services that are part of that application. By + * default, Service Fabric will try to close service replicas in a graceful + * manner and then delete the service. However, if a service is having issues + * closing the replica gracefully, the delete operation may take a long time or + * get stuck. Use the optional ForceRemove flag to skip the graceful close + * sequence and forcefully delete the application and all of its services. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -5179,9 +5830,9 @@ declare class ServiceFabricClient extends ServiceClient { * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5197,20 +5848,20 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Deletes an existing Service Fabric application. * - * Deletes an existing Service Fabric application. An application must be - * created before it can be deleted. Deleting an application will delete all - * services that are part of that application. By default Service Fabric will - * try to close service replicas in a graceful manner and then delete the - * service. However if service is having issues closing the replica gracefully, - * the delete operation may take a long time or get stuck. Use the optional - * ForceRemove flag to skip the graceful close sequence and forcefully delete - * the application and all of the its services. + * An application must be created before it can be deleted. Deleting an + * application will delete all services that are part of that application. By + * default, Service Fabric will try to close service replicas in a graceful + * manner and then delete the service. However, if a service is having issues + * closing the replica gracefully, the delete operation may take a long time or + * get stuck. Use the optional ForceRemove flag to skip the graceful close + * sequence and forcefully delete the application and all of its services. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -5222,9 +5873,9 @@ declare class ServiceFabricClient extends ServiceClient { * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5261,22 +5912,24 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the load information about the application that was created or in * the process of being created in the Service Fabric cluster and whose name * matches the one specified as the parameter. The response includes the name, - * minimum nodes, maximum nodes, the number of nodes the app is occupying - * currently, and application load metric information about the application. + * minimum nodes, maximum nodes, the number of nodes the application is + * occupying currently, and application load metric information about the + * application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5295,22 +5948,24 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the load information about the application that was created or in * the process of being created in the Service Fabric cluster and whose name * matches the one specified as the parameter. The response includes the name, - * minimum nodes, maximum nodes, the number of nodes the app is occupying - * currently, and application load metric information about the application. + * minimum nodes, maximum nodes, the number of nodes the application is + * occupying currently, and application load metric information about the + * application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5344,21 +5999,23 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the list of applications created in the Service Fabric cluster - * that match filters specified as the parameter. + * that match the specified filters. * * Gets the information about the applications that were created or in the - * process of being created in the Service Fabric cluster and match filters - * specified as the parameter. The response includes the name, type, status, - * parameters and other details about the application. If the applications do - * not fit in a page, one page of results is returned as well as a continuation - * token which can be used to get the next page. + * process of being created in the Service Fabric cluster and match the + * specified filters. The response includes the name, type, status, parameters, + * and other details about the application. If the applications do not fit in a + * page, one page of results is returned as well as a continuation token, which + * can be used to get the next page. Filters ApplicationTypeName and + * ApplicationDefinitionKindFilter cannot be specified at the same time. * * @param {object} [options] Optional Parameters. * * @param {number} [options.applicationDefinitionKindFilter] Used to filter on - * ApplicationDefinitionKind for application query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationDefinitionKind value. The value is 0. + * ApplicationDefinitionKind, which is the mechanism used to define a Service + * Fabric application. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. * - All - Filter that matches input with any ApplicationDefinitionKind value. * The value is 65535. * - ServiceFabricApplicationDescription - Filter that matches input with @@ -5367,7 +6024,6 @@ declare class ServiceFabricClient extends ServiceClient { * - Compose - Filter that matches input with ApplicationDefinitionKind value * Compose. The value is 2. * - * * @param {string} [options.applicationTypeName] The application type name used * to filter the applications to query for. This value should not contain the * application type version. @@ -5376,17 +6032,25 @@ declare class ServiceFabricClient extends ServiceClient { * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5397,25 +6061,27 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - getApplicationInfoListWithHttpOperationResponse(options?: { applicationDefinitionKindFilter? : number, applicationTypeName? : string, excludeApplicationParameters? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getApplicationInfoListWithHttpOperationResponse(options?: { applicationDefinitionKindFilter? : number, applicationTypeName? : string, excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the list of applications created in the Service Fabric cluster - * that match filters specified as the parameter. + * that match the specified filters. * * Gets the information about the applications that were created or in the - * process of being created in the Service Fabric cluster and match filters - * specified as the parameter. The response includes the name, type, status, - * parameters and other details about the application. If the applications do - * not fit in a page, one page of results is returned as well as a continuation - * token which can be used to get the next page. + * process of being created in the Service Fabric cluster and match the + * specified filters. The response includes the name, type, status, parameters, + * and other details about the application. If the applications do not fit in a + * page, one page of results is returned as well as a continuation token, which + * can be used to get the next page. Filters ApplicationTypeName and + * ApplicationDefinitionKindFilter cannot be specified at the same time. * * @param {object} [options] Optional Parameters. * * @param {number} [options.applicationDefinitionKindFilter] Used to filter on - * ApplicationDefinitionKind for application query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationDefinitionKind value. The value is 0. + * ApplicationDefinitionKind, which is the mechanism used to define a Service + * Fabric application. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. * - All - Filter that matches input with any ApplicationDefinitionKind value. * The value is 65535. * - ServiceFabricApplicationDescription - Filter that matches input with @@ -5424,7 +6090,6 @@ declare class ServiceFabricClient extends ServiceClient { * - Compose - Filter that matches input with ApplicationDefinitionKind value * Compose. The value is 2. * - * * @param {string} [options.applicationTypeName] The application type name used * to filter the applications to query for. This value should not contain the * application type version. @@ -5433,17 +6098,25 @@ declare class ServiceFabricClient extends ServiceClient { * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5471,9 +6144,9 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getApplicationInfoList(options?: { applicationDefinitionKindFilter? : number, applicationTypeName? : string, excludeApplicationParameters? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getApplicationInfoList(options?: { applicationDefinitionKindFilter? : number, applicationTypeName? : string, excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; getApplicationInfoList(callback: ServiceCallback): void; - getApplicationInfoList(options: { applicationDefinitionKindFilter? : number, applicationTypeName? : string, excludeApplicationParameters? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getApplicationInfoList(options: { applicationDefinitionKindFilter? : number, applicationTypeName? : string, excludeApplicationParameters? : boolean, continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5482,13 +6155,14 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the information about the application that was created or in the * process of being created in the Service Fabric cluster and whose name * matches the one specified as the parameter. The response includes the name, - * type, status, parameters and other details about the application. + * type, status, parameters, and other details about the application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -5497,9 +6171,9 @@ declare class ServiceFabricClient extends ServiceClient { * specifies whether application parameters will be excluded from the result. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5518,13 +6192,14 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the information about the application that was created or in the * process of being created in the Service Fabric cluster and whose name * matches the one specified as the parameter. The response includes the name, - * type, status, parameters and other details about the application. + * type, status, parameters, and other details about the application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -5533,9 +6208,9 @@ declare class ServiceFabricClient extends ServiceClient { * specifies whether application parameters will be excluded from the result. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5572,13 +6247,14 @@ declare class ServiceFabricClient extends ServiceClient { * * Returns the heath state of the service fabric application. The response * reports either Ok, Error or Warning health state. If the entity is not found - * in the helath store, it will return Error. + * in the health store, it will return Error. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -5589,10 +6265,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -5606,17 +6282,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedApplicationsHealthStateFilter] Allows * filtering of the deployed applications health state objects returned in the * result of application health query based on their health state. * The possible values for this parameter include integer value of one of the * following health states. Only deployed applications that match the filter - * will be returned.\ + * will be returned. * All deployed applications are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of deployed * applications with HealthState value of OK (2) and Warning (4) are returned. * @@ -5631,7 +6306,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.servicesHealthStateFilter] Allows filtering of the * services health state objects returned in the result of services health * query based on their health state. @@ -5639,8 +6313,8 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only services that match the filter are returned. All services are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of services with HealthState value of OK (2) and Warning * (4) will be returned. @@ -5656,18 +6330,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5685,13 +6357,14 @@ declare class ServiceFabricClient extends ServiceClient { * * Returns the heath state of the service fabric application. The response * reports either Ok, Error or Warning health state. If the entity is not found - * in the helath store, it will return Error. + * in the health store, it will return Error. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -5702,10 +6375,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -5719,17 +6392,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedApplicationsHealthStateFilter] Allows * filtering of the deployed applications health state objects returned in the * result of application health query based on their health state. * The possible values for this parameter include integer value of one of the * following health states. Only deployed applications that match the filter - * will be returned.\ + * will be returned. * All deployed applications are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of deployed * applications with HealthState value of OK (2) and Warning (4) are returned. * @@ -5744,7 +6416,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.servicesHealthStateFilter] Allows filtering of the * services health state objects returned in the result of services health * query based on their health state. @@ -5752,8 +6423,8 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only services that match the filter are returned. All services are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of services with HealthState value of OK (2) and Warning * (4) will be returned. @@ -5769,18 +6440,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5824,8 +6493,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -5836,10 +6506,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -5853,17 +6523,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedApplicationsHealthStateFilter] Allows * filtering of the deployed applications health state objects returned in the * result of application health query based on their health state. * The possible values for this parameter include integer value of one of the * following health states. Only deployed applications that match the filter - * will be returned.\ + * will be returned. * All deployed applications are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of deployed * applications with HealthState value of OK (2) and Warning (4) are returned. * @@ -5878,7 +6547,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.servicesHealthStateFilter] Allows filtering of the * services health state objects returned in the result of services health * query based on their health state. @@ -5886,8 +6554,8 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only services that match the filter are returned. All services are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of services with HealthState value of OK (2) and Warning * (4) will be returned. @@ -5903,21 +6571,18 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -5934,9 +6599,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -5952,7 +6617,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -5967,7 +6631,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -5983,13 +6646,14 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6014,8 +6678,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -6026,10 +6691,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -6043,17 +6708,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedApplicationsHealthStateFilter] Allows * filtering of the deployed applications health state objects returned in the * result of application health query based on their health state. * The possible values for this parameter include integer value of one of the * following health states. Only deployed applications that match the filter - * will be returned.\ + * will be returned. * All deployed applications are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of deployed * applications with HealthState value of OK (2) and Warning (4) are returned. * @@ -6068,7 +6732,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.servicesHealthStateFilter] Allows filtering of the * services health state objects returned in the result of services health * query based on their health state. @@ -6076,8 +6739,8 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only services that match the filter are returned. All services are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of services with HealthState value of OK (2) and Warning * (4) will be returned. @@ -6093,21 +6756,18 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -6124,9 +6784,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -6142,7 +6802,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -6157,7 +6816,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -6173,13 +6831,14 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6226,21 +6885,20 @@ declare class ServiceFabricClient extends ServiceClient { * To see whether the report was applied in the health store, get application * health and check that the report appears in the HealthEvents section. * - * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -6257,12 +6915,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -6274,7 +6933,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -6286,7 +6944,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -6294,10 +6951,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -6307,33 +6963,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6361,21 +7015,20 @@ declare class ServiceFabricClient extends ServiceClient { * To see whether the report was applied in the health store, get application * health and check that the report appears in the HealthEvents section. * - * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -6392,12 +7045,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -6409,7 +7063,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -6421,7 +7074,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -6429,10 +7081,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -6442,33 +7093,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6508,53 +7157,99 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} applicationUpgradeDescription Parameters for an application * upgrade. * - * @param {string} applicationUpgradeDescription.name + * @param {string} applicationUpgradeDescription.name The name of the target + * application, including the 'fabric:' URI scheme. * * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion + * The target application type version (found in the application manifest) for + * the application upgrade. * - * @param {array} applicationUpgradeDescription.parameters + * @param {array} applicationUpgradeDescription.parameters List of application + * parameters with overridden values from their default values specified in the + * application manifest. * - * @param {string} applicationUpgradeDescription.upgradeKind Possible values - * include: 'Invalid', 'Rolling' + * @param {string} applicationUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} - * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [applicationUpgradeDescription.forceRestart] + * @param {boolean} [applicationUpgradeDescription.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} [applicationUpgradeDescription.monitoringPolicy] + * @param {object} [applicationUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [applicationUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [applicationUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [applicationUpgradeDescription.applicationHealthPolicy] + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. * * @param {boolean} * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] @@ -6573,9 +7268,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -6591,7 +7286,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -6606,7 +7300,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -6622,16 +7315,17 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6653,53 +7347,99 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} applicationUpgradeDescription Parameters for an application * upgrade. * - * @param {string} applicationUpgradeDescription.name + * @param {string} applicationUpgradeDescription.name The name of the target + * application, including the 'fabric:' URI scheme. * * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion + * The target application type version (found in the application manifest) for + * the application upgrade. * - * @param {array} applicationUpgradeDescription.parameters + * @param {array} applicationUpgradeDescription.parameters List of application + * parameters with overridden values from their default values specified in the + * application manifest. * - * @param {string} applicationUpgradeDescription.upgradeKind Possible values - * include: 'Invalid', 'Rolling' + * @param {string} applicationUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} - * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [applicationUpgradeDescription.forceRestart] + * @param {boolean} [applicationUpgradeDescription.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} [applicationUpgradeDescription.monitoringPolicy] + * @param {object} [applicationUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [applicationUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [applicationUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [applicationUpgradeDescription.applicationHealthPolicy] + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. * * @param {boolean} * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] @@ -6718,9 +7458,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -6736,7 +7476,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -6751,7 +7490,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -6767,16 +7505,17 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6816,16 +7555,17 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6847,16 +7587,17 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6901,20 +7642,25 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} applicationUpgradeUpdateDescription Parameters for updating * an existing application upgrade. * - * @param {string} applicationUpgradeUpdateDescription.name + * @param {string} applicationUpgradeUpdateDescription.name The name of the + * application, including the 'fabric:' URI scheme. * - * @param {string} applicationUpgradeUpdateDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' + * @param {string} applicationUpgradeUpdateDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * * @param {object} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy] + * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * * @param {boolean} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] @@ -6933,9 +7679,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -6951,7 +7697,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -6966,7 +7711,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -6982,48 +7726,88 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [applicationUpgradeUpdateDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. * * @param {string} - * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {boolean} - * [applicationUpgradeUpdateDescription.updateDescription.forceRestart] + * [applicationUpgradeUpdateDescription.updateDescription.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 {number} * [applicationUpgradeUpdateDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} - * [applicationUpgradeUpdateDescription.updateDescription.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [applicationUpgradeUpdateDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7048,20 +7832,25 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} applicationUpgradeUpdateDescription Parameters for updating * an existing application upgrade. * - * @param {string} applicationUpgradeUpdateDescription.name + * @param {string} applicationUpgradeUpdateDescription.name The name of the + * application, including the 'fabric:' URI scheme. * - * @param {string} applicationUpgradeUpdateDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' + * @param {string} applicationUpgradeUpdateDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * * @param {object} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy] + * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * * @param {boolean} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] @@ -7080,9 +7869,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -7098,7 +7887,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -7113,7 +7901,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -7129,48 +7916,88 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [applicationUpgradeUpdateDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. * * @param {string} - * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {boolean} - * [applicationUpgradeUpdateDescription.updateDescription.forceRestart] + * [applicationUpgradeUpdateDescription.updateDescription.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 {number} * [applicationUpgradeUpdateDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} - * [applicationUpgradeUpdateDescription.updateDescription.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [applicationUpgradeUpdateDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7212,8 +8039,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} resumeApplicationUpgradeDescription Describes the parameters @@ -7225,9 +8053,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7251,8 +8079,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} resumeApplicationUpgradeDescription Describes the parameters @@ -7264,9 +8093,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7302,24 +8131,25 @@ declare class ServiceFabricClient extends ServiceClient { * application in the Service Fabric cluster. * * Starts rolling back the current application upgrade to the previous version. - * This API can only be used to rollback the current in-progress upgrade that + * This API can only be used to roll back the current in-progress upgrade that * is rolling forward to new version. If the application is not currently being - * upgraded use StartApplicationUpgrade API to upgrade it to desired version + * upgraded use StartApplicationUpgrade API to upgrade it to desired version, * including rolling back to a previous version. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7337,24 +8167,25 @@ declare class ServiceFabricClient extends ServiceClient { * application in the Service Fabric cluster. * * Starts rolling back the current application upgrade to the previous version. - * This API can only be used to rollback the current in-progress upgrade that + * This API can only be used to roll back the current in-progress upgrade that * is rolling forward to new version. If the application is not currently being - * upgraded use StartApplicationUpgrade API to upgrade it to desired version + * upgraded use StartApplicationUpgrade API to upgrade it to desired version, * including rolling back to a previous version. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7388,41 +8219,101 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the list of applications deployed on a Service Fabric node. * - * Gets the list of applications deployed on a Service Fabric node. + * Gets the list of applications deployed on a Service Fabric node. The results + * do not include information about deployed system applications unless + * explicitly queried for by ID. Results encompass deployed applications in + * active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getDeployedApplicationInfoListWithHttpOperationResponse(nodeName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getDeployedApplicationInfoListWithHttpOperationResponse(nodeName: string, options?: { timeout? : number, includeHealthState? : boolean, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the list of applications deployed on a Service Fabric node. * - * Gets the list of applications deployed on a Service Fabric node. + * Gets the list of applications deployed on a Service Fabric node. The results + * do not include information about deployed system applications unless + * explicitly queried for by ID. Results encompass deployed applications in + * active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7434,7 +8325,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {PagedDeployedApplicationInfoList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7442,38 +8333,54 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {PagedDeployedApplicationInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedDeployedApplicationInfoList} 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. */ - getDeployedApplicationInfoList(nodeName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getDeployedApplicationInfoList(nodeName: string, callback: ServiceCallback): void; - getDeployedApplicationInfoList(nodeName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getDeployedApplicationInfoList(nodeName: string, options?: { timeout? : number, includeHealthState? : boolean, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeployedApplicationInfoList(nodeName: string, callback: ServiceCallback): void; + getDeployedApplicationInfoList(nodeName: string, options: { timeout? : number, includeHealthState? : boolean, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * @summary Gets the information about an application deployed on a Service * Fabric node. * - * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID + * provided is for system application. Results encompass deployed applications + * in active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7484,29 +8391,43 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - getDeployedApplicationInfoWithHttpOperationResponse(nodeName: string, applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getDeployedApplicationInfoWithHttpOperationResponse(nodeName: string, applicationId: string, options?: { timeout? : number, includeHealthState? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the information about an application deployed on a Service * Fabric node. * - * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID + * provided is for system application. Results encompass deployed applications + * in active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7534,9 +8455,9 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getDeployedApplicationInfo(nodeName: string, applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeployedApplicationInfo(nodeName: string, applicationId: string, options?: { timeout? : number, includeHealthState? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; getDeployedApplicationInfo(nodeName: string, applicationId: string, callback: ServiceCallback): void; - getDeployedApplicationInfo(nodeName: string, applicationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getDeployedApplicationInfo(nodeName: string, applicationId: string, options: { timeout? : number, includeHealthState? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -7554,8 +8475,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -7566,10 +8488,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -7583,7 +8505,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows * filtering of the deployed service package health state objects returned in * the result of deployed application health query based on their health state. @@ -7593,8 +8514,8 @@ declare class ServiceFabricClient extends ServiceClient { * deployed service packages are used to evaluate the aggregated health state * of the deployed application. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. * For example, if the provided value is 6 then health state of service * packages with HealthState value of OK (2) and Warning (4) are returned. * @@ -7609,18 +8530,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7648,8 +8567,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -7660,10 +8580,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -7677,7 +8597,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows * filtering of the deployed service package health state objects returned in * the result of deployed application health query based on their health state. @@ -7687,8 +8606,8 @@ declare class ServiceFabricClient extends ServiceClient { * deployed service packages are used to evaluate the aggregated health state * of the deployed application. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. * For example, if the provided value is 6 then health state of service * packages with HealthState value of OK (2) and Warning (4) are returned. * @@ -7703,18 +8622,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7762,14 +8679,14 @@ declare class ServiceFabricClient extends ServiceClient { * the ApplicationHealthPolicy. The rest of the fields are ignored while * evaluating the health of the deployed application. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -7780,10 +8697,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -7797,7 +8714,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows * filtering of the deployed service package health state objects returned in * the result of deployed application health query based on their health state. @@ -7807,8 +8723,8 @@ declare class ServiceFabricClient extends ServiceClient { * deployed service packages are used to evaluate the aggregated health state * of the deployed application. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. * For example, if the provided value is 6 then health state of service * packages with HealthState value of OK (2) and Warning (4) are returned. * @@ -7823,14 +8739,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -7847,9 +8761,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -7865,7 +8779,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -7880,7 +8793,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -7896,8 +8808,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -7905,11 +8818,10 @@ declare class ServiceFabricClient extends ServiceClient { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7937,14 +8849,14 @@ declare class ServiceFabricClient extends ServiceClient { * the ApplicationHealthPolicy. The rest of the fields are ignored while * evaluating the health of the deployed application. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -7955,10 +8867,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -7972,7 +8884,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows * filtering of the deployed service package health state objects returned in * the result of deployed application health query based on their health state. @@ -7982,8 +8893,8 @@ declare class ServiceFabricClient extends ServiceClient { * deployed service packages are used to evaluate the aggregated health state * of the deployed application. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. * For example, if the provided value is 6 then health state of service * packages with HealthState value of OK (2) and Warning (4) are returned. * @@ -7998,14 +8909,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -8022,9 +8931,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -8040,7 +8949,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -8055,7 +8963,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -8071,8 +8978,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -8080,11 +8988,10 @@ declare class ServiceFabricClient extends ServiceClient { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8134,23 +9041,22 @@ declare class ServiceFabricClient extends ServiceClient { * application health and check that the report appears in the HealthEvents * section. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -8167,12 +9073,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -8184,7 +9091,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -8196,7 +9102,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -8204,10 +9109,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -8217,33 +9121,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8273,23 +9175,22 @@ declare class ServiceFabricClient extends ServiceClient { * application health and check that the report appears in the HealthEvents * section. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -8306,12 +9207,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -8323,7 +9225,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -8335,7 +9236,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -8343,10 +9243,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -8356,33 +9255,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8416,8 +9313,7 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the manifest describing an application type. * - * Gets the manifest describing an application type. The response contains the - * application manifest XML as a string. + * The response contains the application manifest XML as a string. * * @param {string} applicationTypeName The name of the application type. * @@ -8426,9 +9322,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8444,8 +9340,7 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the manifest describing an application type. * - * Gets the manifest describing an application type. The response contains the - * application manifest XML as a string. + * The response contains the application manifest XML as a string. * * @param {string} applicationTypeName The name of the application type. * @@ -8454,9 +9349,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8491,16 +9386,17 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the information about all services belonging to the - * application specified by the application id. + * application specified by the application ID. * * Returns the information about all services belonging to the application - * specified by the application id. + * specified by the application ID. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -8509,17 +9405,17 @@ declare class ServiceFabricClient extends ServiceClient { * filter the services to query for. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8534,16 +9430,17 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the information about all services belonging to the - * application specified by the application id. + * application specified by the application ID. * * Returns the information about all services belonging to the application - * specified by the application id. + * specified by the application ID. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -8552,17 +9449,17 @@ declare class ServiceFabricClient extends ServiceClient { * filter the services to query for. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8595,32 +9492,34 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Gets the information about the specific service belonging to a + * @summary Gets the information about the specific service belonging to the * Service Fabric application. * - * Returns the information about specified service belonging to the specified - * Service Fabric application. + * Returns the information about the specified service belonging to the + * specified Service Fabric application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8634,32 +9533,34 @@ declare class ServiceFabricClient extends ServiceClient { getServiceInfoWithHttpOperationResponse(applicationId: string, serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the information about the specific service belonging to a + * @summary Gets the information about the specific service belonging to the * Service Fabric application. * - * Returns the information about specified service belonging to the specified - * Service Fabric application. + * Returns the information about the specified service belonging to the + * specified Service Fabric application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8694,22 +9595,24 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the name of the Service Fabric application for a service. * - * The GetApplicationName endpoint returns the name of the application for the - * specified service. + * Gets the name of the application for the specified service. A 404 + * FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the + * provided service ID does not exist. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8725,22 +9628,24 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the name of the Service Fabric application for a service. * - * The GetApplicationName endpoint returns the name of the application for the - * specified service. + * Gets the name of the application for the specified service. A 404 + * FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the + * provided service ID does not exist. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8773,29 +9678,40 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Creates the specified service. + * @summary Creates the specified Service Fabric service. * - * Creates the specified service. + * This api allows creating a new Service Fabric stateless or stateful service + * under a specified Service Fabric application. The description for creating + * the service includes partitioning information and optional properties for + * placement and load balancing. Some of the properties can later be modified + * using `UpdateService` API. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} serviceDescription The information necessary to create a * service. * - * @param {string} [serviceDescription.applicationName] + * @param {string} [serviceDescription.applicationName] The name of the + * application, including the 'fabric:' URI scheme. * - * @param {string} serviceDescription.serviceName + * @param {string} serviceDescription.serviceName The full name of the service + * with 'fabric:' URI scheme. * - * @param {string} serviceDescription.serviceTypeName + * @param {string} serviceDescription.serviceTypeName Name of the service type + * as specified in the service manifest. * - * @param {array} [serviceDescription.initializationData] + * @param {array} [serviceDescription.initializationData] The initialization + * data as an array of bytes. Initialization data is passed to service + * instances or replicas when they are created. * - * @param {object} serviceDescription.partitionDescription + * @param {object} serviceDescription.partitionDescription The partition + * description as an object. * * @param {string} serviceDescription.partitionDescription.partitionScheme * Polymorphic Discriminator @@ -8806,33 +9722,40 @@ declare class ServiceFabricClient extends ServiceClient { * based on the service requirements. For example, to place a service on nodes * where NodeType is blue specify the following: "NodeColor == blue)". * - * @param {array} [serviceDescription.correlationScheme] + * @param {array} [serviceDescription.correlationScheme] The correlation + * scheme. * - * @param {array} [serviceDescription.serviceLoadMetrics] + * @param {array} [serviceDescription.serviceLoadMetrics] The service load + * metrics. * - * @param {array} [serviceDescription.servicePlacementPolicies] + * @param {array} [serviceDescription.servicePlacementPolicies] The service + * placement policies. * - * @param {string} [serviceDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {string} [serviceDescription.defaultMoveCost] The move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * * @param {boolean} [serviceDescription.isDefaultMoveCostSpecified] Indicates * if the DefaultMoveCost property is specified. * - * @param {string} [serviceDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * @param {string} [serviceDescription.servicePackageActivationMode] The + * activation mode of service package to be used for a service. Possible values + * include: 'SharedProcess', 'ExclusiveProcess' * * @param {string} [serviceDescription.serviceDnsName] The DNS name of the * service. It requires the DNS system service to be enabled in Service Fabric * cluster. * + * @param {array} [serviceDescription.scalingPolicies] Scaling policies for + * this service. + * * @param {string} serviceDescription.serviceKind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8846,29 +9769,40 @@ declare class ServiceFabricClient extends ServiceClient { createServiceWithHttpOperationResponse(applicationId: string, serviceDescription: models.ServiceDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Creates the specified service. + * @summary Creates the specified Service Fabric service. * - * Creates the specified service. + * This api allows creating a new Service Fabric stateless or stateful service + * under a specified Service Fabric application. The description for creating + * the service includes partitioning information and optional properties for + * placement and load balancing. Some of the properties can later be modified + * using `UpdateService` API. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} serviceDescription The information necessary to create a * service. * - * @param {string} [serviceDescription.applicationName] + * @param {string} [serviceDescription.applicationName] The name of the + * application, including the 'fabric:' URI scheme. * - * @param {string} serviceDescription.serviceName + * @param {string} serviceDescription.serviceName The full name of the service + * with 'fabric:' URI scheme. * - * @param {string} serviceDescription.serviceTypeName + * @param {string} serviceDescription.serviceTypeName Name of the service type + * as specified in the service manifest. * - * @param {array} [serviceDescription.initializationData] + * @param {array} [serviceDescription.initializationData] The initialization + * data as an array of bytes. Initialization data is passed to service + * instances or replicas when they are created. * - * @param {object} serviceDescription.partitionDescription + * @param {object} serviceDescription.partitionDescription The partition + * description as an object. * * @param {string} serviceDescription.partitionDescription.partitionScheme * Polymorphic Discriminator @@ -8879,33 +9813,40 @@ declare class ServiceFabricClient extends ServiceClient { * based on the service requirements. For example, to place a service on nodes * where NodeType is blue specify the following: "NodeColor == blue)". * - * @param {array} [serviceDescription.correlationScheme] + * @param {array} [serviceDescription.correlationScheme] The correlation + * scheme. * - * @param {array} [serviceDescription.serviceLoadMetrics] + * @param {array} [serviceDescription.serviceLoadMetrics] The service load + * metrics. * - * @param {array} [serviceDescription.servicePlacementPolicies] + * @param {array} [serviceDescription.servicePlacementPolicies] The service + * placement policies. * - * @param {string} [serviceDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {string} [serviceDescription.defaultMoveCost] The move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * * @param {boolean} [serviceDescription.isDefaultMoveCostSpecified] Indicates * if the DefaultMoveCost property is specified. * - * @param {string} [serviceDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * @param {string} [serviceDescription.servicePackageActivationMode] The + * activation mode of service package to be used for a service. Possible values + * include: 'SharedProcess', 'ExclusiveProcess' * * @param {string} [serviceDescription.serviceDnsName] The DNS name of the * service. It requires the DNS system service to be enabled in Service Fabric * cluster. * + * @param {array} [serviceDescription.scalingPolicies] Scaling policies for + * this service. + * * @param {string} serviceDescription.serviceKind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8937,33 +9878,41 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Creates a Service Fabric service from the service template defined - * in the application manifest. + * @summary Creates a Service Fabric service from the service template. * * Creates a Service Fabric service from the service template defined in the - * application manifest. + * application manifest. A service template contains the properties that will + * be same for the service instance of the same type. The API allows overriding + * the properties that are usually different for different services of the same + * service type. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} serviceFromTemplateDescription Describes the service that * needs to be created from the template defined in the application manifest. * - * @param {string} serviceFromTemplateDescription.applicationName + * @param {string} serviceFromTemplateDescription.applicationName The name of + * the application, including the 'fabric:' URI scheme. * - * @param {string} serviceFromTemplateDescription.serviceName + * @param {string} serviceFromTemplateDescription.serviceName The full name of + * the service with 'fabric:' URI scheme. * - * @param {string} serviceFromTemplateDescription.serviceTypeName + * @param {string} serviceFromTemplateDescription.serviceTypeName Name of the + * service type as specified in the service manifest. * - * @param {array} [serviceFromTemplateDescription.initializationData] + * @param {array} [serviceFromTemplateDescription.initializationData] The + * initialization data for the newly created service instance. * * @param {string} - * [serviceFromTemplateDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * [serviceFromTemplateDescription.servicePackageActivationMode] The activation + * mode of service package to be used for a service. Possible values include: + * 'SharedProcess', 'ExclusiveProcess' * * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name * of the service. It requires the DNS system service to be enabled in Service @@ -8972,9 +9921,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8988,33 +9937,41 @@ declare class ServiceFabricClient extends ServiceClient { createServiceFromTemplateWithHttpOperationResponse(applicationId: string, serviceFromTemplateDescription: models.ServiceFromTemplateDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Creates a Service Fabric service from the service template defined - * in the application manifest. + * @summary Creates a Service Fabric service from the service template. * * Creates a Service Fabric service from the service template defined in the - * application manifest. + * application manifest. A service template contains the properties that will + * be same for the service instance of the same type. The API allows overriding + * the properties that are usually different for different services of the same + * service type. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} serviceFromTemplateDescription Describes the service that * needs to be created from the template defined in the application manifest. * - * @param {string} serviceFromTemplateDescription.applicationName + * @param {string} serviceFromTemplateDescription.applicationName The name of + * the application, including the 'fabric:' URI scheme. * - * @param {string} serviceFromTemplateDescription.serviceName + * @param {string} serviceFromTemplateDescription.serviceName The full name of + * the service with 'fabric:' URI scheme. * - * @param {string} serviceFromTemplateDescription.serviceTypeName + * @param {string} serviceFromTemplateDescription.serviceTypeName Name of the + * service type as specified in the service manifest. * - * @param {array} [serviceFromTemplateDescription.initializationData] + * @param {array} [serviceFromTemplateDescription.initializationData] The + * initialization data for the newly created service instance. * * @param {string} - * [serviceFromTemplateDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * [serviceFromTemplateDescription.servicePackageActivationMode] The activation + * mode of service package to be used for a service. Possible values include: + * 'SharedProcess', 'ExclusiveProcess' * * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name * of the service. It requires the DNS system service to be enabled in Service @@ -9023,9 +9980,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9059,17 +10016,18 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Deletes an existing Service Fabric service. * - * Deletes an existing Service Fabric service. A service must be created before - * it can be deleted. By default Service Fabric will try to close service - * replicas in a graceful manner and then delete the service. However if - * service is having issues closing the replica gracefully, the delete - * operation may take a long time or get stuck. Use the optional ForceRemove - * flag to skip the graceful close sequence and forcefully delete the service. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * A service must be created before it can be deleted. By default, Service + * Fabric will try to close service replicas in a graceful manner and then + * delete the service. However, if the service is having issues closing the + * replica gracefully, the delete operation may take a long time or get stuck. + * Use the optional ForceRemove flag to skip the graceful close sequence and + * forcefully delete the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9082,9 +10040,9 @@ declare class ServiceFabricClient extends ServiceClient { * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9100,17 +10058,18 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Deletes an existing Service Fabric service. * - * Deletes an existing Service Fabric service. A service must be created before - * it can be deleted. By default Service Fabric will try to close service - * replicas in a graceful manner and then delete the service. However if - * service is having issues closing the replica gracefully, the delete - * operation may take a long time or get stuck. Use the optional ForceRemove - * flag to skip the graceful close sequence and forcefully delete the service. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * A service must be created before it can be deleted. By default, Service + * Fabric will try to close service replicas in a graceful manner and then + * delete the service. However, if the service is having issues closing the + * replica gracefully, the delete operation may take a long time or get stuck. + * Use the optional ForceRemove flag to skip the graceful close sequence and + * forcefully delete the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9123,9 +10082,9 @@ declare class ServiceFabricClient extends ServiceClient { * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9157,14 +10116,24 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Updates the specified service using the given update description. + * @summary Updates a Service Fabric service using the specified update + * description. * - * Updates the specified service using the given update description. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * This API allows updating properties of a running Service Fabric service. The + * set of properties that can be updated are a subset of the properties that + * were specified at the time of creating the service. The current set of + * properties can be obtained using `GetServiceDescription` API. Note that + * updating the properties of a running service is different than upgrading + * your application using `StartApplicationUpgrade` API. The upgrade is a long + * running background operation that involves moving the application from one + * version to another, one upgrade domain at a time, whereas update applies the + * new properties immediately to the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9202,7 +10171,8 @@ declare class ServiceFabricClient extends ServiceClient { * 256. * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value * is 512. - * + * - ScalingPolicy - Indicates the ScalingPolicies property is set. The value + * is 1024. * * @param {string} [serviceUpdateDescription.placementConstraints] The * placement constraints as a string. Placement constraints are boolean @@ -9211,14 +10181,20 @@ declare class ServiceFabricClient extends ServiceClient { * service on nodes where NodeType is blue specify the following: "NodeColor == * blue)". * - * @param {array} [serviceUpdateDescription.correlationScheme] + * @param {array} [serviceUpdateDescription.correlationScheme] The correlation + * scheme. + * + * @param {array} [serviceUpdateDescription.loadMetrics] The service load + * metrics. * - * @param {array} [serviceUpdateDescription.loadMetrics] + * @param {array} [serviceUpdateDescription.servicePlacementPolicies] The + * service placement policies. * - * @param {array} [serviceUpdateDescription.servicePlacementPolicies] + * @param {string} [serviceUpdateDescription.defaultMoveCost] The move cost for + * the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * - * @param {string} [serviceUpdateDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {array} [serviceUpdateDescription.scalingPolicies] Scaling policies + * for this service. * * @param {string} serviceUpdateDescription.serviceKind Polymorphic * Discriminator @@ -9226,9 +10202,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9242,14 +10218,24 @@ declare class ServiceFabricClient extends ServiceClient { updateServiceWithHttpOperationResponse(serviceId: string, serviceUpdateDescription: models.ServiceUpdateDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Updates the specified service using the given update description. - * - * Updates the specified service using the given update description. + * @summary Updates a Service Fabric service using the specified update + * description. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * This API allows updating properties of a running Service Fabric service. The + * set of properties that can be updated are a subset of the properties that + * were specified at the time of creating the service. The current set of + * properties can be obtained using `GetServiceDescription` API. Note that + * updating the properties of a running service is different than upgrading + * your application using `StartApplicationUpgrade` API. The upgrade is a long + * running background operation that involves moving the application from one + * version to another, one upgrade domain at a time, whereas update applies the + * new properties immediately to the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9287,7 +10273,8 @@ declare class ServiceFabricClient extends ServiceClient { * 256. * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value * is 512. - * + * - ScalingPolicy - Indicates the ScalingPolicies property is set. The value + * is 1024. * * @param {string} [serviceUpdateDescription.placementConstraints] The * placement constraints as a string. Placement constraints are boolean @@ -9296,14 +10283,20 @@ declare class ServiceFabricClient extends ServiceClient { * service on nodes where NodeType is blue specify the following: "NodeColor == * blue)". * - * @param {array} [serviceUpdateDescription.correlationScheme] + * @param {array} [serviceUpdateDescription.correlationScheme] The correlation + * scheme. * - * @param {array} [serviceUpdateDescription.loadMetrics] + * @param {array} [serviceUpdateDescription.loadMetrics] The service load + * metrics. * - * @param {array} [serviceUpdateDescription.servicePlacementPolicies] + * @param {array} [serviceUpdateDescription.servicePlacementPolicies] The + * service placement policies. * - * @param {string} [serviceUpdateDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {string} [serviceUpdateDescription.defaultMoveCost] The move cost for + * the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {array} [serviceUpdateDescription.scalingPolicies] Scaling policies + * for this service. * * @param {string} serviceUpdateDescription.serviceKind Polymorphic * Discriminator @@ -9311,9 +10304,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9350,19 +10343,20 @@ declare class ServiceFabricClient extends ServiceClient { * Gets the description of an existing Service Fabric service. A service must * be created before its description can be obtained. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9381,19 +10375,20 @@ declare class ServiceFabricClient extends ServiceClient { * Gets the description of an existing Service Fabric service. A service must * be created before its description can be obtained. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9434,13 +10429,13 @@ declare class ServiceFabricClient extends ServiceClient { * Use PartitionsHealthStateFilter to filter the collection of partitions * returned. * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9452,10 +10447,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -9469,7 +10464,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.partitionsHealthStateFilter] Allows filtering of * the partitions health state objects returned in the result of service health * query based on their health state. @@ -9477,7 +10471,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only partitions that match the filter are returned. All partitions are used * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based + * If not specified, all entries are returned. The state values are flag-based * enumeration, so the value could be a combination of these value * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of partitions with HealthState value of OK (2) and @@ -9494,18 +10488,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9527,13 +10519,13 @@ declare class ServiceFabricClient extends ServiceClient { * Use PartitionsHealthStateFilter to filter the collection of partitions * returned. * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. + * request returns an error. * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9545,10 +10537,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -9562,7 +10554,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.partitionsHealthStateFilter] Allows filtering of * the partitions health state objects returned in the result of service health * query based on their health state. @@ -9570,7 +10561,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only partitions that match the filter are returned. All partitions are used * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based + * If not specified, all entries are returned. The state values are flag-based * enumeration, so the value could be a combination of these value * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of partitions with HealthState value of OK (2) and @@ -9587,18 +10578,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9645,13 +10634,13 @@ declare class ServiceFabricClient extends ServiceClient { * Use PartitionsHealthStateFilter to filter the collection of partitions * returned. * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9663,10 +10652,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -9680,7 +10669,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.partitionsHealthStateFilter] Allows filtering of * the partitions health state objects returned in the result of service health * query based on their health state. @@ -9688,7 +10676,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only partitions that match the filter are returned. All partitions are used * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based + * If not specified, all entries are returned. The state values are flag-based * enumeration, so the value could be a combination of these value * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of partitions with HealthState value of OK (2) and @@ -9705,14 +10693,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -9729,9 +10715,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -9747,7 +10733,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -9762,7 +10747,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -9778,8 +10762,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -9787,11 +10772,10 @@ declare class ServiceFabricClient extends ServiceClient { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9819,13 +10803,13 @@ declare class ServiceFabricClient extends ServiceClient { * Use PartitionsHealthStateFilter to filter the collection of partitions * returned. * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -9837,10 +10821,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -9854,7 +10838,6 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.partitionsHealthStateFilter] Allows filtering of * the partitions health state objects returned in the result of service health * query based on their health state. @@ -9862,7 +10845,7 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only partitions that match the filter are returned. All partitions are used * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based + * If not specified, all entries are returned. The state values are flag-based * enumeration, so the value could be a combination of these value * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of partitions with HealthState value of OK (2) and @@ -9879,14 +10862,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -9903,9 +10884,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -9921,7 +10902,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -9936,7 +10916,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -9952,8 +10931,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -9961,11 +10941,10 @@ declare class ServiceFabricClient extends ServiceClient { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10013,11 +10992,11 @@ declare class ServiceFabricClient extends ServiceClient { * GetServiceHealth and check that the report appears in the HealthEvents * section. * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -10025,9 +11004,8 @@ declare class ServiceFabricClient extends ServiceClient { * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -10044,12 +11022,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -10061,7 +11040,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -10073,7 +11051,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -10081,10 +11058,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -10094,33 +11070,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10149,11 +11123,11 @@ declare class ServiceFabricClient extends ServiceClient { * GetServiceHealth and check that the report appears in the HealthEvents * section. * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -10161,9 +11135,8 @@ declare class ServiceFabricClient extends ServiceClient { * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -10180,12 +11153,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -10197,7 +11171,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -10209,7 +11182,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -10217,10 +11189,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -10230,33 +11201,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10290,13 +11259,14 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Resolve a Service Fabric partition. * - * Resolve a Service Fabric service partition, to get the endpoints of the + * Resolve a Service Fabric service partition to get the endpoints of the * service replicas. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -10305,28 +11275,27 @@ declare class ServiceFabricClient extends ServiceClient { * @param {number} [options.partitionKeyType] Key type for the partition. This * parameter is required if the partition scheme for the service is Int64Range * or Named. The possible values are following. - * - None (1) - Indicates that the the PartitionKeyValue parameter is not + * - None (1) - Indicates that the PartitionKeyValue parameter is not * specified. This is valid for the partitions with partitioning scheme as * Singleton. This is the default value. The value is 1. - * - Int64Range (2) - Indicates that the the PartitionKeyValue parameter is an + * - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an * int64 partition key. This is valid for the partitions with partitioning * scheme as Int64Range. The value is 2. - * - Named (3) - Indicates that the the PartitionKeyValue parameter is a name - * of the partition. This is valid for the partitions with partitioning scheme - * as Named. The value is 3. - * + * - Named (3) - Indicates that the PartitionKeyValue parameter is a name of + * the partition. This is valid for the partitions with partitioning scheme as + * Named. The value is 3. * * @param {string} [options.partitionKeyValue] Partition key. This is required * if the partition scheme for the service is Int64Range or Named. * * @param {string} [options.previousRspVersion] The value in the Version field * of the response that was received previously. This is required if the user - * knows that the result that was got previously is stale. + * knows that the result that was gotten previously is stale. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10342,13 +11311,14 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Resolve a Service Fabric partition. * - * Resolve a Service Fabric service partition, to get the endpoints of the + * Resolve a Service Fabric service partition to get the endpoints of the * service replicas. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -10357,28 +11327,27 @@ declare class ServiceFabricClient extends ServiceClient { * @param {number} [options.partitionKeyType] Key type for the partition. This * parameter is required if the partition scheme for the service is Int64Range * or Named. The possible values are following. - * - None (1) - Indicates that the the PartitionKeyValue parameter is not + * - None (1) - Indicates that the PartitionKeyValue parameter is not * specified. This is valid for the partitions with partitioning scheme as * Singleton. This is the default value. The value is 1. - * - Int64Range (2) - Indicates that the the PartitionKeyValue parameter is an + * - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an * int64 partition key. This is valid for the partitions with partitioning * scheme as Int64Range. The value is 2. - * - Named (3) - Indicates that the the PartitionKeyValue parameter is a name - * of the partition. This is valid for the partitions with partitioning scheme - * as Named. The value is 3. - * + * - Named (3) - Indicates that the PartitionKeyValue parameter is a name of + * the partition. This is valid for the partitions with partitioning scheme as + * Named. The value is 3. * * @param {string} [options.partitionKeyValue] Partition key. This is required * if the partition scheme for the service is Int64Range or Named. * * @param {string} [options.previousRspVersion] The value in the Version field * of the response that was received previously. This is required if the user - * knows that the result that was got previously is stale. + * knows that the result that was gotten previously is stale. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10414,31 +11383,32 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the list of partitions of a Service Fabric service. * - * Gets the list of partitions of a Service Fabric service. The response - * include the partition id, partitioning scheme information, keys supported by - * the partition, status, health and other details about the partition. + * The response includes the partition ID, partitioning scheme information, + * keys supported by the partition, status, health, and other details about the + * partition. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10454,31 +11424,32 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the list of partitions of a Service Fabric service. * - * Gets the list of partitions of a Service Fabric service. The response - * include the partition id, partitioning scheme information, keys supported by - * the partition, status, health and other details about the partition. + * The response includes the partition ID, partitioning scheme information, + * keys supported by the partition, status, health, and other details about the + * partition. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10514,19 +11485,18 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the information about a Service Fabric partition. * - * The Partitions endpoint returns information about the specified partition. - * The response include the partition id, partitioning scheme information, keys - * supported by the partition, status, health and other details about the - * partition. + * Gets the information about the specified partition. The response includes + * the partition ID, partitioning scheme information, keys supported by the + * partition, status, health, and other details about the partition. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10542,19 +11512,18 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the information about a Service Fabric partition. * - * The Partitions endpoint returns information about the specified partition. - * The response include the partition id, partitioning scheme information, keys - * supported by the partition, status, health and other details about the - * partition. + * Gets the information about the specified partition. The response includes + * the partition ID, partitioning scheme information, keys supported by the + * partition, status, health, and other details about the partition. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10589,17 +11558,17 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the name of the Service Fabric service for a partition. * - * The GetServiceName endpoint returns the name of the service for the - * specified partition. + * Gets name of the service for the specified partition. A 404 error is + * returned if the partition ID does not exist in the cluster. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10615,17 +11584,17 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the name of the Service Fabric service for a partition. * - * The GetServiceName endpoint returns the name of the service for the - * specified partition. + * Gets name of the service for the specified partition. A 404 error is + * returned if the partition ID does not exist in the cluster. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10660,14 +11629,12 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the health of the specified Service Fabric partition. * - * Gets the health information of the specified partition. * Use EventsHealthStateFilter to filter the collection of health events * reported on the service based on the health state. * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState * objects on the partition. * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * * @param {uuid} partitionId The identity of the partition. * @@ -10679,10 +11646,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -10696,14 +11663,13 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.replicasHealthStateFilter] Allows filtering the * collection of ReplicaHealthState objects on the partition. The value can be * obtained from members or bitwise operations on members of HealthStateFilter. * Only replicas that match the filter will be returned. All replicas will be * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. * For example, If the provided value is 6 then all of the events with * HealthState value of OK (2) and Warning (4) will be returned. The possible * values for this parameter include integer value of one of the following @@ -10720,18 +11686,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10747,14 +11711,12 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the health of the specified Service Fabric partition. * - * Gets the health information of the specified partition. * Use EventsHealthStateFilter to filter the collection of health events * reported on the service based on the health state. * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState * objects on the partition. * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * * @param {uuid} partitionId The identity of the partition. * @@ -10766,10 +11728,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -10783,14 +11745,13 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.replicasHealthStateFilter] Allows filtering the * collection of ReplicaHealthState objects on the partition. The value can be * obtained from members or bitwise operations on members of HealthStateFilter. * Only replicas that match the filter will be returned. All replicas will be * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. * For example, If the provided value is 6 then all of the events with * HealthState value of OK (2) and Warning (4) will be returned. The possible * values for this parameter include integer value of one of the following @@ -10807,18 +11768,16 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10866,8 +11825,7 @@ declare class ServiceFabricClient extends ServiceClient { * objects on the partition. Use ApplicationHealthPolicy in the POST body to * override the health policies used to evaluate the health. * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * * @param {uuid} partitionId The identity of the partition. * @@ -10879,10 +11837,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -10896,14 +11854,13 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.replicasHealthStateFilter] Allows filtering the * collection of ReplicaHealthState objects on the partition. The value can be * obtained from members or bitwise operations on members of HealthStateFilter. * Only replicas that match the filter will be returned. All replicas will be * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. * For example, If the provided value is 6 then all of the events with * HealthState value of OK (2) and Warning (4) will be returned. The possible * values for this parameter include integer value of one of the following @@ -10920,14 +11877,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -10944,9 +11899,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -10962,7 +11917,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -10977,7 +11931,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -10993,8 +11946,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -11002,11 +11956,10 @@ declare class ServiceFabricClient extends ServiceClient { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11035,8 +11988,7 @@ declare class ServiceFabricClient extends ServiceClient { * objects on the partition. Use ApplicationHealthPolicy in the POST body to * override the health policies used to evaluate the health. * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * * @param {uuid} partitionId The identity of the partition. * @@ -11048,10 +12000,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -11065,14 +12017,13 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.replicasHealthStateFilter] Allows filtering the * collection of ReplicaHealthState objects on the partition. The value can be * obtained from members or bitwise operations on members of HealthStateFilter. * Only replicas that match the filter will be returned. All replicas will be * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. * For example, If the provided value is 6 then all of the events with * HealthState value of OK (2) and Warning (4) will be returned. The possible * values for this parameter include integer value of one of the following @@ -11089,14 +12040,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -11113,9 +12062,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -11131,7 +12080,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -11146,7 +12094,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -11162,8 +12109,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -11171,11 +12119,10 @@ declare class ServiceFabricClient extends ServiceClient { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11223,16 +12170,14 @@ declare class ServiceFabricClient extends ServiceClient { * GetPartitionHealth and check that the report appears in the HealthEvents * section. * - * * @param {uuid} partitionId The identity of the partition. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -11249,12 +12194,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -11266,7 +12212,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -11278,7 +12223,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -11286,10 +12230,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -11299,33 +12242,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11354,16 +12295,14 @@ declare class ServiceFabricClient extends ServiceClient { * GetPartitionHealth and check that the report appears in the HealthEvents * section. * - * * @param {uuid} partitionId The identity of the partition. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -11380,12 +12319,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -11397,7 +12337,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -11409,7 +12348,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -11417,10 +12355,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -11430,33 +12367,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11488,22 +12423,22 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Gets the load of the specified Service Fabric partition. + * @summary Gets the load information of the specified Service Fabric + * partition. * - * Returns information about the specified partition. - * The response includes a list of load information. - * Each information includes load metric name, value and last reported time in + * Returns information about the load of a specified partition. + * The response includes a list of load reports for a Service Fabric partition. + * Each report includes the load metric name, value, and last reported time in * UTC. * - * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11517,22 +12452,22 @@ declare class ServiceFabricClient extends ServiceClient { getPartitionLoadInformationWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the load of the specified Service Fabric partition. + * @summary Gets the load information of the specified Service Fabric + * partition. * - * Returns information about the specified partition. - * The response includes a list of load information. - * Each information includes load metric name, value and last reported time in + * Returns information about the load of a specified partition. + * The response includes a list of load reports for a Service Fabric partition. + * Each report includes the load metric name, value, and last reported time in * UTC. * - * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11576,9 +12511,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11602,9 +12537,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11637,22 +12572,20 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover a specific partition which is currently stuck in quorum loss. + * recover a specific partition that is currently stuck in quorum loss. * - * Indicates to the Service Fabric cluster that it should attempt to recover a - * specific partition which is currently stuck in quorum loss. This operation - * should only be performed if it is known that the replicas that are down - * cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11667,22 +12600,20 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover a specific partition which is currently stuck in quorum loss. + * recover a specific partition that is currently stuck in quorum loss. * - * Indicates to the Service Fabric cluster that it should attempt to recover a - * specific partition which is currently stuck in quorum loss. This operation - * should only be performed if it is known that the replicas that are down - * cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11715,27 +12646,28 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the specified service which is currently stuck in quorum loss. + * recover the specified service that is currently stuck in quorum loss. * * Indicates to the Service Fabric cluster that it should attempt to recover - * the specified service which is currently stuck in quorum loss. This - * operation should only be performed if it is known that the replicas that are - * down cannot be recovered. Incorrect use of this API can cause potential data + * the specified service that is currently stuck in quorum loss. This operation + * should only be performed if it is known that the replicas that are down + * cannot be recovered. Incorrect use of this API can cause potential data * loss. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11750,27 +12682,28 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the specified service which is currently stuck in quorum loss. + * recover the specified service that is currently stuck in quorum loss. * * Indicates to the Service Fabric cluster that it should attempt to recover - * the specified service which is currently stuck in quorum loss. This - * operation should only be performed if it is known that the replicas that are - * down cannot be recovered. Incorrect use of this API can cause potential data + * the specified service that is currently stuck in quorum loss. This operation + * should only be performed if it is known that the replicas that are down + * cannot be recovered. Incorrect use of this API can cause potential data * loss. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11803,10 +12736,10 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the system services which are currently stuck in quorum loss. + * recover the system services that are currently stuck in quorum loss. * * Indicates to the Service Fabric cluster that it should attempt to recover - * the system services which are currently stuck in quorum loss. This operation + * the system services that are currently stuck in quorum loss. This operation * should only be performed if it is known that the replicas that are down * cannot be recovered. Incorrect use of this API can cause potential data * loss. @@ -11814,9 +12747,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11831,10 +12764,10 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the system services which are currently stuck in quorum loss. + * recover the system services that are currently stuck in quorum loss. * * Indicates to the Service Fabric cluster that it should attempt to recover - * the system services which are currently stuck in quorum loss. This operation + * the system services that are currently stuck in quorum loss. This operation * should only be performed if it is known that the replicas that are down * cannot be recovered. Incorrect use of this API can cause potential data * loss. @@ -11842,9 +12775,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11880,18 +12813,16 @@ declare class ServiceFabricClient extends ServiceClient { * recover any services (including system services) which are currently stuck * in quorum loss. * - * Indicates to the Service Fabric cluster that it should attempt to recover - * any services (including system services) which are currently stuck in quorum - * loss. This operation should only be performed if it is known that the - * replicas that are down cannot be recovered. Incorrect use of this API can - * cause potential data loss. + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11909,18 +12840,16 @@ declare class ServiceFabricClient extends ServiceClient { * recover any services (including system services) which are currently stuck * in quorum loss. * - * Indicates to the Service Fabric cluster that it should attempt to recover - * any services (including system services) which are currently stuck in quorum - * loss. This operation should only be performed if it is known that the - * replicas that are down cannot be recovered. Incorrect use of this API can - * cause potential data loss. + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11971,7 +12900,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTask Describes the repair task to be created or * updated. * @@ -11986,32 +12914,14 @@ declare class ServiceFabricClient extends ServiceClient { * update will only succeed if the actual current version of the repair task * matches this value. * - * * @param {string} [repairTask.description] A description of the purpose of the * repair task, or other informational details. * May be set when the repair task is created, and is immutable once set. * - * * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' * * @param {number} [repairTask.flags] A bitwise-OR of the following values, * which gives additional details about the status of the repair task. @@ -12019,12 +12929,13 @@ declare class ServiceFabricClient extends ServiceClient { * - 2 - Abort of the repair has been requested * - 4 - Approval of the repair was forced via client request * - * * @param {string} repairTask.action The requested repair action. Must be * specified when the repair task is created, and is immutable once set. * - * - * @param {object} [repairTask.target] + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. * * @param {string} repairTask.target.kind Polymorphic Discriminator * @@ -12034,43 +12945,32 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTask.executorData] A data string that the repair * executor can use to store its internal state. * - * @param {object} [repairTask.impact] + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. * * @param {string} repairTask.impact.kind Polymorphic Discriminator * * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' * * @param {number} [repairTask.resultCode] A numeric value providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * * @param {string} [repairTask.resultDetails] A string providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * - * @param {object} [repairTask.history] + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. * * @param {date} [repairTask.history.createdUtcTimestamp] The time when the * repair task entered the Created state. @@ -12105,11 +13005,15 @@ declare class ServiceFabricClient extends ServiceClient { * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The * time when the repair task completed the health check in the Restoring state. * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * * @param {boolean} [repairTask.performPreparingHealthCheck] A value to * determine if health checks will be performed when the repair task enters the @@ -12152,7 +13056,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTask Describes the repair task to be created or * updated. * @@ -12167,32 +13070,14 @@ declare class ServiceFabricClient extends ServiceClient { * update will only succeed if the actual current version of the repair task * matches this value. * - * * @param {string} [repairTask.description] A description of the purpose of the * repair task, or other informational details. * May be set when the repair task is created, and is immutable once set. * - * * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' * * @param {number} [repairTask.flags] A bitwise-OR of the following values, * which gives additional details about the status of the repair task. @@ -12200,12 +13085,13 @@ declare class ServiceFabricClient extends ServiceClient { * - 2 - Abort of the repair has been requested * - 4 - Approval of the repair was forced via client request * - * * @param {string} repairTask.action The requested repair action. Must be * specified when the repair task is created, and is immutable once set. * - * - * @param {object} [repairTask.target] + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. * * @param {string} repairTask.target.kind Polymorphic Discriminator * @@ -12215,43 +13101,32 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTask.executorData] A data string that the repair * executor can use to store its internal state. * - * @param {object} [repairTask.impact] + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. * * @param {string} repairTask.impact.kind Polymorphic Discriminator * * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' * * @param {number} [repairTask.resultCode] A numeric value providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * * @param {string} [repairTask.resultDetails] A string providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * - * @param {object} [repairTask.history] + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. * * @param {date} [repairTask.history.createdUtcTimestamp] The time when the * repair task entered the Created state. @@ -12286,11 +13161,15 @@ declare class ServiceFabricClient extends ServiceClient { * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The * time when the repair task completed the health check in the Restoring state. * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * * @param {boolean} [repairTask.performPreparingHealthCheck] A value to * determine if health checks will be performed when the repair task enters the @@ -12338,7 +13217,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskCancelDescription Describes the repair task to be * cancelled. * @@ -12348,12 +13226,12 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTaskCancelDescription.version] The current version * number of the repair task. If non-zero, then the request will only succeed * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * zero, then no version check is performed. * * @param {boolean} [repairTaskCancelDescription.requestAbort] _True_ if the * repair should be stopped as soon as possible even if it has already started * executing. _False_ if the repair should be cancelled only if execution has - * not yet started. + * not yet started. * * @param {object} [options] Optional Parameters. * @@ -12374,7 +13252,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskCancelDescription Describes the repair task to be * cancelled. * @@ -12384,12 +13261,12 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTaskCancelDescription.version] The current version * number of the repair task. If non-zero, then the request will only succeed * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * zero, then no version check is performed. * * @param {boolean} [repairTaskCancelDescription.requestAbort] _True_ if the * repair should be stopped as soon as possible even if it has already started * executing. _False_ if the repair should be cancelled only if execution has - * not yet started. + * not yet started. * * @param {object} [options] Optional Parameters. * @@ -12429,7 +13306,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskDeleteDescription Describes the repair task to be * deleted. * @@ -12460,7 +13336,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskDeleteDescription Describes the repair task to be * deleted. * @@ -12509,7 +13384,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} [options] Optional Parameters. * * @param {string} [options.taskIdFilter] The repair task ID prefix to be @@ -12517,6 +13391,7 @@ declare class ServiceFabricClient extends ServiceClient { * * @param {number} [options.stateFilter] A bitwise-OR of the following values, * specifying which task states should be included in the result list. + * * - 1 - Created * - 2 - Claimed * - 4 - Preparing @@ -12525,7 +13400,6 @@ declare class ServiceFabricClient extends ServiceClient { * - 32 - Restoring * - 64 - Completed * - * * @param {string} [options.executorFilter] The name of the repair executor * whose claimed tasks should be included in the list. * @@ -12546,7 +13420,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} [options] Optional Parameters. * * @param {string} [options.taskIdFilter] The repair task ID prefix to be @@ -12554,6 +13427,7 @@ declare class ServiceFabricClient extends ServiceClient { * * @param {number} [options.stateFilter] A bitwise-OR of the following values, * specifying which task states should be included in the result list. + * * - 1 - Created * - 2 - Claimed * - 4 - Preparing @@ -12562,7 +13436,6 @@ declare class ServiceFabricClient extends ServiceClient { * - 32 - Restoring * - 64 - Completed * - * * @param {string} [options.executorFilter] The name of the repair executor * whose claimed tasks should be included in the list. * @@ -12601,7 +13474,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskApproveDescription Describes the repair task to be * approved. * @@ -12611,7 +13483,7 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTaskApproveDescription.version] The current version * number of the repair task. If non-zero, then the request will only succeed * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * zero, then no version check is performed. * * @param {object} [options] Optional Parameters. * @@ -12632,7 +13504,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskApproveDescription Describes the repair task to be * approved. * @@ -12642,7 +13513,7 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTaskApproveDescription.version] The current version * number of the repair task. If non-zero, then the request will only succeed * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * zero, then no version check is performed. * * @param {object} [options] Optional Parameters. * @@ -12682,7 +13553,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskUpdateHealthPolicyDescription Describes the repair * task healthy policy to be updated. * @@ -12725,7 +13595,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskUpdateHealthPolicyDescription Describes the repair * task healthy policy to be updated. * @@ -12787,7 +13656,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTask Describes the repair task to be created or * updated. * @@ -12802,32 +13670,14 @@ declare class ServiceFabricClient extends ServiceClient { * update will only succeed if the actual current version of the repair task * matches this value. * - * * @param {string} [repairTask.description] A description of the purpose of the * repair task, or other informational details. * May be set when the repair task is created, and is immutable once set. * - * * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' * * @param {number} [repairTask.flags] A bitwise-OR of the following values, * which gives additional details about the status of the repair task. @@ -12835,12 +13685,13 @@ declare class ServiceFabricClient extends ServiceClient { * - 2 - Abort of the repair has been requested * - 4 - Approval of the repair was forced via client request * - * * @param {string} repairTask.action The requested repair action. Must be * specified when the repair task is created, and is immutable once set. * - * - * @param {object} [repairTask.target] + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. * * @param {string} repairTask.target.kind Polymorphic Discriminator * @@ -12850,43 +13701,32 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTask.executorData] A data string that the repair * executor can use to store its internal state. * - * @param {object} [repairTask.impact] + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. * * @param {string} repairTask.impact.kind Polymorphic Discriminator * * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' * * @param {number} [repairTask.resultCode] A numeric value providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * * @param {string} [repairTask.resultDetails] A string providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * - * @param {object} [repairTask.history] + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. * * @param {date} [repairTask.history.createdUtcTimestamp] The time when the * repair task entered the Created state. @@ -12921,11 +13761,15 @@ declare class ServiceFabricClient extends ServiceClient { * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The * time when the repair task completed the health check in the Restoring state. * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * * @param {boolean} [repairTask.performPreparingHealthCheck] A value to * determine if health checks will be performed when the repair task enters the @@ -12954,7 +13798,6 @@ declare class ServiceFabricClient extends ServiceClient { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTask Describes the repair task to be created or * updated. * @@ -12969,32 +13812,14 @@ declare class ServiceFabricClient extends ServiceClient { * update will only succeed if the actual current version of the repair task * matches this value. * - * * @param {string} [repairTask.description] A description of the purpose of the * repair task, or other informational details. * May be set when the repair task is created, and is immutable once set. * - * * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' * * @param {number} [repairTask.flags] A bitwise-OR of the following values, * which gives additional details about the status of the repair task. @@ -13002,12 +13827,13 @@ declare class ServiceFabricClient extends ServiceClient { * - 2 - Abort of the repair has been requested * - 4 - Approval of the repair was forced via client request * - * * @param {string} repairTask.action The requested repair action. Must be * specified when the repair task is created, and is immutable once set. * - * - * @param {object} [repairTask.target] + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. * * @param {string} repairTask.target.kind Polymorphic Discriminator * @@ -13017,43 +13843,32 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} [repairTask.executorData] A data string that the repair * executor can use to store its internal state. * - * @param {object} [repairTask.impact] + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. * * @param {string} repairTask.impact.kind Polymorphic Discriminator * * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' * * @param {number} [repairTask.resultCode] A numeric value providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * * @param {string} [repairTask.resultDetails] A string providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * - * @param {object} [repairTask.history] + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. * * @param {date} [repairTask.history.createdUtcTimestamp] The time when the * repair task entered the Created state. @@ -13088,11 +13903,15 @@ declare class ServiceFabricClient extends ServiceClient { * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The * time when the repair task completed the health check in the Restoring state. * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * * @param {boolean} [repairTask.performPreparingHealthCheck] A value to * determine if health checks will be performed when the repair task enters the @@ -13139,25 +13958,25 @@ declare class ServiceFabricClient extends ServiceClient { * partition. * * The GetReplicas endpoint returns information about the replicas of the - * specified partition. The respons include the id, role, status, health, node - * name, uptime, and other details about the replica. + * specified partition. The response includes the ID, role, status, health, + * node name, uptime, and other details about the replica. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13175,25 +13994,25 @@ declare class ServiceFabricClient extends ServiceClient { * partition. * * The GetReplicas endpoint returns information about the replicas of the - * specified partition. The respons include the id, role, status, health, node - * name, uptime, and other details about the replica. + * specified partition. The response includes the ID, role, status, health, + * node name, uptime, and other details about the replica. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13228,7 +14047,7 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Gets the information about a replica of a Service Fabric partition. * - * The respons include the id, role, status, health, node name, uptime, and + * The response includes the ID, role, status, health, node name, uptime, and * other details about the replica. * * @param {uuid} partitionId The identity of the partition. @@ -13237,18 +14056,10 @@ declare class ServiceFabricClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13259,12 +14070,12 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - getReplicaInfoWithHttpOperationResponse(partitionId: string, replicaId: string, options?: { continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getReplicaInfoWithHttpOperationResponse(partitionId: string, replicaId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the information about a replica of a Service Fabric partition. * - * The respons include the id, role, status, health, node name, uptime, and + * The response includes the ID, role, status, health, node name, uptime, and * other details about the replica. * * @param {uuid} partitionId The identity of the partition. @@ -13273,18 +14084,10 @@ declare class ServiceFabricClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13311,9 +14114,9 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getReplicaInfo(partitionId: string, replicaId: string, options?: { continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getReplicaInfo(partitionId: string, replicaId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; getReplicaInfo(partitionId: string, replicaId: string, callback: ServiceCallback): void; - getReplicaInfo(partitionId: string, replicaId: string, options: { continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getReplicaInfo(partitionId: string, replicaId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -13324,7 +14127,6 @@ declare class ServiceFabricClient extends ServiceClient { * Use EventsHealthStateFilter to filter the collection of health events * reported on the replica based on the health state. * - * * @param {uuid} partitionId The identity of the partition. * * @param {string} replicaId The identifier of the replica. @@ -13337,10 +14139,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -13354,11 +14156,10 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13379,7 +14180,6 @@ declare class ServiceFabricClient extends ServiceClient { * Use EventsHealthStateFilter to filter the collection of health events * reported on the replica based on the health state. * - * * @param {uuid} partitionId The identity of the partition. * * @param {string} replicaId The identifier of the replica. @@ -13392,10 +14192,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -13409,11 +14209,10 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13458,7 +14257,6 @@ declare class ServiceFabricClient extends ServiceClient { * the ApplicationHealthPolicy. The rest of the fields are ignored while * evaluating the health of the replica. * - * * @param {uuid} partitionId The identity of the partition. * * @param {string} replicaId The identifier of the replica. @@ -13471,10 +14269,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -13488,14 +14286,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -13512,9 +14308,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -13530,7 +14326,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -13545,7 +14340,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -13561,13 +14355,14 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13593,7 +14388,6 @@ declare class ServiceFabricClient extends ServiceClient { * the ApplicationHealthPolicy. The rest of the fields are ignored while * evaluating the health of the replica. * - * * @param {uuid} partitionId The identity of the partition. * * @param {string} replicaId The identifier of the replica. @@ -13606,10 +14400,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -13623,14 +14417,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -13647,9 +14439,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -13665,7 +14457,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -13680,7 +14471,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -13696,13 +14486,14 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13750,27 +14541,20 @@ declare class ServiceFabricClient extends ServiceClient { * GetReplicaHealth and check that the report appears in the HealthEvents * section. * - * * @param {uuid} partitionId The identity of the partition. * * @param {string} replicaId The identifier of the replica. * - * @param {string} serviceKind The kind of service replica (Stateless or - * Stateful) for which the health is being reported. Following are the possible - * values. - * - Stateless - Does not use Service Fabric to make its state highly available - * or reliable. The value is 1 - * - Stateful - Uses Service Fabric to make its state or part of its state - * highly available and reliable. The value is 2. - * . Possible values include: 'Stateless', 'Stateful' + * @param {string} replicaHealthReportServiceKind The kind of service replica + * (Stateless or Stateful) for which the health is being reported. Following + * are the possible values. Possible values include: 'Stateless', 'Stateful' * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -13787,12 +14571,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -13804,7 +14589,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -13816,7 +14600,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -13824,10 +14607,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -13837,33 +14619,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13874,7 +14654,7 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - reportReplicaHealthWithHttpOperationResponse(partitionId: string, replicaId: string, serviceKind: string, healthInformation: models.HealthInformation, options?: { immediate? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + reportReplicaHealthWithHttpOperationResponse(partitionId: string, replicaId: string, replicaHealthReportServiceKind: string, healthInformation: models.HealthInformation, options?: { immediate? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Sends a health report on the Service Fabric replica. @@ -13892,27 +14672,20 @@ declare class ServiceFabricClient extends ServiceClient { * GetReplicaHealth and check that the report appears in the HealthEvents * section. * - * * @param {uuid} partitionId The identity of the partition. * * @param {string} replicaId The identifier of the replica. * - * @param {string} serviceKind The kind of service replica (Stateless or - * Stateful) for which the health is being reported. Following are the possible - * values. - * - Stateless - Does not use Service Fabric to make its state highly available - * or reliable. The value is 1 - * - Stateful - Uses Service Fabric to make its state or part of its state - * highly available and reliable. The value is 2. - * . Possible values include: 'Stateless', 'Stateful' + * @param {string} replicaHealthReportServiceKind The kind of service replica + * (Stateless or Stateful) for which the health is being reported. Following + * are the possible values. Possible values include: 'Stateless', 'Stateful' * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -13929,12 +14702,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -13946,7 +14720,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -13958,7 +14731,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -13966,10 +14738,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -13979,33 +14750,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14031,17 +14800,17 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - reportReplicaHealth(partitionId: string, replicaId: string, serviceKind: string, healthInformation: models.HealthInformation, options?: { immediate? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - reportReplicaHealth(partitionId: string, replicaId: string, serviceKind: string, healthInformation: models.HealthInformation, callback: ServiceCallback): void; - reportReplicaHealth(partitionId: string, replicaId: string, serviceKind: string, healthInformation: models.HealthInformation, options: { immediate? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + reportReplicaHealth(partitionId: string, replicaId: string, replicaHealthReportServiceKind: string, healthInformation: models.HealthInformation, options?: { immediate? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + reportReplicaHealth(partitionId: string, replicaId: string, replicaHealthReportServiceKind: string, healthInformation: models.HealthInformation, callback: ServiceCallback): void; + reportReplicaHealth(partitionId: string, replicaId: string, replicaHealthReportServiceKind: string, healthInformation: models.HealthInformation, options: { immediate? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * @summary Gets the list of replicas deployed on a Service Fabric node. * * Gets the list containing the information about replicas deployed on a - * Service Fabric node. The information include partition id, replica id, - * status of the replica, name of the service, name of the service type and + * Service Fabric node. The information include partition ID, replica ID, + * status of the replica, name of the service, name of the service type, and * other information. Use PartitionId or ServiceManifestName query parameters * to return information about the deployed replicas matching the specified * values for those parameters. @@ -14051,8 +14820,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -14063,9 +14833,9 @@ declare class ServiceFabricClient extends ServiceClient { * registered as part of an application type in a Service Fabric cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14082,8 +14852,8 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the list of replicas deployed on a Service Fabric node. * * Gets the list containing the information about replicas deployed on a - * Service Fabric node. The information include partition id, replica id, - * status of the replica, name of the service, name of the service type and + * Service Fabric node. The information include partition ID, replica ID, + * status of the replica, name of the service, name of the service type, and * other information. Use PartitionId or ServiceManifestName query parameters * to return information about the deployed replicas matching the specified * values for those parameters. @@ -14093,8 +14863,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -14105,9 +14876,9 @@ declare class ServiceFabricClient extends ServiceClient { * registered as part of an application type in a Service Fabric cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14142,9 +14913,9 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the details of replica deployed on a Service Fabric node. * * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * * @param {string} nodeName The name of the node. * @@ -14155,9 +14926,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14174,9 +14945,9 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the details of replica deployed on a Service Fabric node. * * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * * @param {string} nodeName The name of the node. * @@ -14187,9 +14958,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14226,9 +14997,9 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the details of replica deployed on a Service Fabric node. * * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * * @param {string} nodeName The name of the node. * @@ -14237,9 +15008,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14256,9 +15027,9 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the details of replica deployed on a Service Fabric node. * * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * * @param {string} nodeName The name of the node. * @@ -14267,9 +15038,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14319,9 +15090,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14351,9 +15122,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14393,7 +15164,7 @@ declare class ServiceFabricClient extends ServiceClient { * of the replica from the cluster. This API tests the replica state removal * path, and simulates the report fault permanent path through client APIs. * Warning - There are no safety checks performed when this API is used. - * Incorrect use of this API can lead to data loss for stateful services.In + * Incorrect use of this API can lead to data loss for stateful services. In * addition, the forceRemove flag impacts all other replicas hosted in the same * process. * @@ -14412,9 +15183,9 @@ declare class ServiceFabricClient extends ServiceClient { * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14436,7 +15207,7 @@ declare class ServiceFabricClient extends ServiceClient { * of the replica from the cluster. This API tests the replica state removal * path, and simulates the report fault permanent path through client APIs. * Warning - There are no safety checks performed when this API is used. - * Incorrect use of this API can lead to data loss for stateful services.In + * Incorrect use of this API can lead to data loss for stateful services. In * addition, the forceRemove flag impacts all other replicas hosted in the same * process. * @@ -14455,9 +15226,9 @@ declare class ServiceFabricClient extends ServiceClient { * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14500,16 +15271,17 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14534,16 +15306,17 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14588,8 +15361,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -14597,9 +15371,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14626,8 +15400,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -14635,9 +15410,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14669,10 +15444,10 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Gets the information about health of an service package for a + * @summary Gets the information about health of a service package for a * specific application deployed for a Service Fabric node and application. * - * Gets the information about health of service package for a specific + * Gets the information about health of a service package for a specific * application deployed on a Service Fabric node. Use EventsHealthStateFilter * to optionally filter for the collection of HealthEvent objects reported on * the deployed service package based on health state. @@ -14682,8 +15457,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -14696,10 +15472,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -14713,11 +15489,10 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14731,10 +15506,10 @@ declare class ServiceFabricClient extends ServiceClient { getDeployedServicePackageHealthWithHttpOperationResponse(nodeName: string, applicationId: string, servicePackageName: string, options?: { eventsHealthStateFilter? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the information about health of an service package for a + * @summary Gets the information about health of a service package for a * specific application deployed for a Service Fabric node and application. * - * Gets the information about health of service package for a specific + * Gets the information about health of a service package for a specific * application deployed on a Service Fabric node. Use EventsHealthStateFilter * to optionally filter for the collection of HealthEvent objects reported on * the deployed service package based on health state. @@ -14744,8 +15519,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -14758,10 +15534,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -14775,11 +15551,10 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14816,7 +15591,7 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the information about health of service package for a specific * application deployed on a Service Fabric node using the specified policy. * - * Gets the information about health of an service package for a specific + * Gets the information about health of a service package for a specific * application deployed on a Service Fabric node. using the specified policy. * Use EventsHealthStateFilter to optionally filter for the collection of * HealthEvent objects reported on the deployed service package based on health @@ -14826,14 +15601,14 @@ declare class ServiceFabricClient extends ServiceClient { * the fields are ignored while evaluating the health of the deployed service * package. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -14846,10 +15621,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -14863,14 +15638,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -14887,9 +15660,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -14905,7 +15678,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -14920,7 +15692,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -14936,13 +15707,14 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14959,7 +15731,7 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the information about health of service package for a specific * application deployed on a Service Fabric node using the specified policy. * - * Gets the information about health of an service package for a specific + * Gets the information about health of a service package for a specific * application deployed on a Service Fabric node. using the specified policy. * Use EventsHealthStateFilter to optionally filter for the collection of * HealthEvent objects reported on the deployed service package based on health @@ -14969,14 +15741,14 @@ declare class ServiceFabricClient extends ServiceClient { * the fields are ignored while evaluating the health of the deployed service * package. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -14989,10 +15761,10 @@ declare class ServiceFabricClient extends ServiceClient { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -15006,14 +15778,12 @@ declare class ServiceFabricClient extends ServiceClient { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -15030,9 +15800,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -15048,7 +15818,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -15063,7 +15832,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -15079,13 +15847,14 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15135,14 +15904,14 @@ declare class ServiceFabricClient extends ServiceClient { * service package health and check that the report appears in the HealthEvents * section. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -15151,9 +15920,8 @@ declare class ServiceFabricClient extends ServiceClient { * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -15170,12 +15938,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -15187,7 +15956,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -15199,7 +15967,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -15207,10 +15974,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -15220,33 +15986,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15276,14 +16040,14 @@ declare class ServiceFabricClient extends ServiceClient { * service package health and check that the report appears in the HealthEvents * section. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -15292,9 +16056,8 @@ declare class ServiceFabricClient extends ServiceClient { * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -15311,12 +16074,13 @@ declare class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -15328,7 +16092,6 @@ declare class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -15340,7 +16103,6 @@ declare class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -15348,10 +16110,9 @@ declare class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -15361,33 +16122,31 @@ declare class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15419,12 +16178,15 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Downloads packages associated with specified service manifest to - * image cache on specified node. - * - * Downloads packages associated with specified service manifest to image cache - * on specified node. + * @summary Downloads all of the code packages associated with specified + * service manifest on the specified node. * + * This API provides a way to download code packages including the container + * images on a specific node outside of the normal application deployment and + * upgrade path. This is useful for the large code packages and container + * images to be present on the node before the actual application deployment + * and upgrade, thus significantly reducing the total time required for the + * deployment or upgrade. * * @param {string} nodeName The name of the node. * @@ -15432,21 +16194,26 @@ declare class ServiceFabricClient extends ServiceClient { * for deploying a service package to a Service Fabric node. * * @param {string} deployServicePackageToNodeDescription.serviceManifestName + * The name of service manifest whose packages need to be downloaded. * * @param {string} deployServicePackageToNodeDescription.applicationTypeName + * The application type name as defined in the application manifest. * * @param {string} deployServicePackageToNodeDescription.applicationTypeVersion + * The version of the application type as defined in the application manifest. * - * @param {string} deployServicePackageToNodeDescription.nodeName + * @param {string} deployServicePackageToNodeDescription.nodeName The name of a + * Service Fabric node. * * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] + * List of package sharing policy information. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15457,15 +16224,18 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - deployedServicePackageToNodeWithHttpOperationResponse(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + deployServicePackageToNodeWithHttpOperationResponse(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Downloads packages associated with specified service manifest to - * image cache on specified node. - * - * Downloads packages associated with specified service manifest to image cache - * on specified node. + * @summary Downloads all of the code packages associated with specified + * service manifest on the specified node. * + * This API provides a way to download code packages including the container + * images on a specific node outside of the normal application deployment and + * upgrade path. This is useful for the large code packages and container + * images to be present on the node before the actual application deployment + * and upgrade, thus significantly reducing the total time required for the + * deployment or upgrade. * * @param {string} nodeName The name of the node. * @@ -15473,21 +16243,26 @@ declare class ServiceFabricClient extends ServiceClient { * for deploying a service package to a Service Fabric node. * * @param {string} deployServicePackageToNodeDescription.serviceManifestName + * The name of service manifest whose packages need to be downloaded. * * @param {string} deployServicePackageToNodeDescription.applicationTypeName + * The application type name as defined in the application manifest. * * @param {string} deployServicePackageToNodeDescription.applicationTypeVersion + * The version of the application type as defined in the application manifest. * - * @param {string} deployServicePackageToNodeDescription.nodeName + * @param {string} deployServicePackageToNodeDescription.nodeName The name of a + * Service Fabric node. * * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] + * List of package sharing policy information. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15513,9 +16288,9 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deployedServicePackageToNode(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - deployedServicePackageToNode(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, callback: ServiceCallback): void; - deployedServicePackageToNode(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deployServicePackageToNode(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + deployServicePackageToNode(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, callback: ServiceCallback): void; + deployServicePackageToNode(nodeName: string, deployServicePackageToNodeDescription: models.DeployServicePackageToNodeDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -15529,8 +16304,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -15543,9 +16319,9 @@ declare class ServiceFabricClient extends ServiceClient { * Fabric cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15569,8 +16345,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -15583,9 +16360,9 @@ declare class ServiceFabricClient extends ServiceClient { * Fabric cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15629,28 +16406,46 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} restartDeployedCodePackageDescription Describes the deployed * code package on Service Fabric node to restart. * * @param {string} restartDeployedCodePackageDescription.serviceManifestName + * The name of service manifest that specified this code package. * * @param {string} - * [restartDeployedCodePackageDescription.servicePackageActivationId] + * [restartDeployedCodePackageDescription.servicePackageActivationId] The + * ActivationId of a deployed service package. If ServicePackageActivationMode + * specified at the time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. * - * @param {string} restartDeployedCodePackageDescription.codePackageName + * @param {string} restartDeployedCodePackageDescription.codePackageName The + * name of the code package defined in the service manifest. * * @param {string} restartDeployedCodePackageDescription.codePackageInstanceId + * The instance ID for currently running entry point. For a code package setup + * entry point (if specified) runs first and after it finishes main entry point + * is started. + * Each time entry point executable is run, its instance ID will change. If 0 + * is passed in as the code package instance ID, the API will restart the code + * package with whatever instance ID it is currently running. + * If an instance ID other than 0 is passed in, the API will restart the code + * package only if the current Instance ID matches the passed in instance ID. + * Note, passing in the exact instance ID (not 0) in the API is safer, because + * if ensures at most one restart of the code package. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15676,28 +16471,46 @@ declare class ServiceFabricClient extends ServiceClient { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} restartDeployedCodePackageDescription Describes the deployed * code package on Service Fabric node to restart. * * @param {string} restartDeployedCodePackageDescription.serviceManifestName + * The name of service manifest that specified this code package. * * @param {string} - * [restartDeployedCodePackageDescription.servicePackageActivationId] + * [restartDeployedCodePackageDescription.servicePackageActivationId] The + * ActivationId of a deployed service package. If ServicePackageActivationMode + * specified at the time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. * - * @param {string} restartDeployedCodePackageDescription.codePackageName + * @param {string} restartDeployedCodePackageDescription.codePackageName The + * name of the code package defined in the service manifest. * * @param {string} restartDeployedCodePackageDescription.codePackageInstanceId + * The instance ID for currently running entry point. For a code package setup + * entry point (if specified) runs first and after it finishes main entry point + * is started. + * Each time entry point executable is run, its instance ID will change. If 0 + * is passed in as the code package instance ID, the API will restart the code + * package with whatever instance ID it is currently running. + * If an instance ID other than 0 is passed in, the API will restart the code + * package only if the current Instance ID matches the passed in instance ID. + * Note, passing in the exact instance ID (not 0) in the API is safer, because + * if ensures at most one restart of the code package. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15728,20 +16541,279 @@ declare class ServiceFabricClient extends ServiceClient { restartDeployedCodePackage(nodeName: string, applicationId: string, restartDeployedCodePackageDescription: models.RestartDeployedCodePackageDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Gets the container logs for container deployed on a Service Fabric + * node. + * + * Gets the container logs for container deployed on a Service Fabric node for + * the given code package. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.tail] Number of lines to show from the end of the + * logs. Default is 100. 'all' to show the complete logs. + * + * @param {boolean} [options.previous] Specifies whether to get container logs + * from exited/dead containers of the code package instance. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getContainerLogsDeployedOnNodeWithHttpOperationResponse(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, options?: { tail? : string, previous? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the container logs for container deployed on a Service Fabric + * node. + * + * Gets the container logs for container deployed on a Service Fabric node for + * the given code package. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.tail] Number of lines to show from the end of the + * logs. Default is 100. 'all' to show the complete logs. + * + * @param {boolean} [options.previous] Specifies whether to get container logs + * from exited/dead containers of the code package instance. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ContainerLogs} - 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. + * + * {ContainerLogs} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerLogs} 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. + */ + getContainerLogsDeployedOnNode(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, options?: { tail? : string, previous? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getContainerLogsDeployedOnNode(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, callback: ServiceCallback): void; + getContainerLogsDeployedOnNode(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, options: { tail? : string, previous? : boolean, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke container API on a container deployed on a Service Fabric + * node. + * + * Invoke container API on a container deployed on a Service Fabric node for + * the given code package. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. + * + * @param {string} codePackageInstanceId ID that uniquely identifies a code + * package instance deployed on a service fabric node. + * + * @param {object} containerApiRequestBody Parameters for making container API + * call + * + * @param {string} [containerApiRequestBody.httpVerb] HTTP verb of container + * REST API, defaults to "GET" + * + * @param {string} containerApiRequestBody.uriPath URI path of container REST + * API + * + * @param {string} [containerApiRequestBody.contentType] Content type of + * container REST API request, defaults to "application/json" + * + * @param {string} [containerApiRequestBody.body] HTTP request body of + * container REST API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + invokeContainerApiWithHttpOperationResponse(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, codePackageInstanceId: string, containerApiRequestBody: models.ContainerApiRequestBody, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke container API on a container deployed on a Service Fabric + * node. + * + * Invoke container API on a container deployed on a Service Fabric node for + * the given code package. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. + * + * @param {string} codePackageInstanceId ID that uniquely identifies a code + * package instance deployed on a service fabric node. + * + * @param {object} containerApiRequestBody Parameters for making container API + * call + * + * @param {string} [containerApiRequestBody.httpVerb] HTTP verb of container + * REST API, defaults to "GET" + * + * @param {string} containerApiRequestBody.uriPath URI path of container REST + * API + * + * @param {string} [containerApiRequestBody.contentType] Content type of + * container REST API request, defaults to "application/json" + * + * @param {string} [containerApiRequestBody.body] HTTP request body of + * container REST API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ContainerApiResponse} - 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. + * + * {ContainerApiResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerApiResponse} 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. + */ + invokeContainerApi(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, codePackageInstanceId: string, containerApiRequestBody: models.ContainerApiRequestBody, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + invokeContainerApi(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, codePackageInstanceId: string, containerApiRequestBody: models.ContainerApiRequestBody, callback: ServiceCallback): void; + invokeContainerApi(nodeName: string, applicationId: string, serviceManifestName: string, codePackageName: string, codePackageInstanceId: string, containerApiRequestBody: models.ContainerApiRequestBody, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Creates a Service Fabric compose deployment. * - * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This + * API allows deploying container based applications defined in compose format + * in a Service Fabric cluster. Once the deployment is created, its status can + * be tracked via the `GetComposeDeploymentStatus` API. * * @param {object} createComposeDeploymentDescription Describes the compose * deployment that needs to be created. * - * @param {string} createComposeDeploymentDescription.deploymentName + * @param {string} createComposeDeploymentDescription.deploymentName The name + * of the deployment. * * @param {string} createComposeDeploymentDescription.composeFileContent The * content of the compose file that describes the deployment to create. * * @param {object} [createComposeDeploymentDescription.registryCredential] + * Credential information to connect to container registry. * * @param {string} * [createComposeDeploymentDescription.registryCredential.registryUserName] The @@ -15758,9 +16830,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15776,17 +16848,22 @@ declare class ServiceFabricClient extends ServiceClient { /** * @summary Creates a Service Fabric compose deployment. * - * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This + * API allows deploying container based applications defined in compose format + * in a Service Fabric cluster. Once the deployment is created, its status can + * be tracked via the `GetComposeDeploymentStatus` API. * * @param {object} createComposeDeploymentDescription Describes the compose * deployment that needs to be created. * - * @param {string} createComposeDeploymentDescription.deploymentName + * @param {string} createComposeDeploymentDescription.deploymentName The name + * of the deployment. * * @param {string} createComposeDeploymentDescription.composeFileContent The * content of the compose file that describes the deployment to create. * * @param {object} [createComposeDeploymentDescription.registryCredential] + * Credential information to connect to container registry. * * @param {string} * [createComposeDeploymentDescription.registryCredential.registryUserName] The @@ -15803,9 +16880,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15842,16 +16919,16 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the status of the compose deployment that was created or in the * process of being created in the Service Fabric cluster and whose name * matches the one specified as the parameter. The response includes the name, - * status and other details about the deployment. + * status, and other details about the deployment. * * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15870,16 +16947,16 @@ declare class ServiceFabricClient extends ServiceClient { * Returns the status of the compose deployment that was created or in the * process of being created in the Service Fabric cluster and whose name * matches the one specified as the parameter. The response includes the name, - * status and other details about the deployment. + * status, and other details about the deployment. * * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15918,19 +16995,19 @@ declare class ServiceFabricClient extends ServiceClient { * * Gets the status about the compose deployments that were created or in the * process of being created in the Service Fabric cluster. The response - * includes the name, status and other details about the compose deployments. + * includes the name, status, and other details about the compose deployments. * If the list of deployments do not fit in a page, one page of results is - * returned as well as a continuation token which can be used to get the next + * returned as well as a continuation token, which can be used to get the next * page. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -15938,13 +17015,13 @@ declare class ServiceFabricClient extends ServiceClient { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15963,19 +17040,19 @@ declare class ServiceFabricClient extends ServiceClient { * * Gets the status about the compose deployments that were created or in the * process of being created in the Service Fabric cluster. The response - * includes the name, status and other details about the compose deployments. + * includes the name, status, and other details about the compose deployments. * If the list of deployments do not fit in a page, one page of results is - * returned as well as a continuation token which can be used to get the next + * returned as well as a continuation token, which can be used to get the next * page. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -15983,13 +17060,13 @@ declare class ServiceFabricClient extends ServiceClient { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16034,9 +17111,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16061,9 +17138,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16106,9 +17183,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16131,9 +17208,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16176,12 +17253,14 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} composeDeploymentUpgradeDescription Parameters for upgrading * compose deployment. * - * @param {string} composeDeploymentUpgradeDescription.deploymentName + * @param {string} composeDeploymentUpgradeDescription.deploymentName The name + * of the deployment. * * @param {string} composeDeploymentUpgradeDescription.composeFileContent The * content of the compose file that describes the deployment to create. * * @param {object} [composeDeploymentUpgradeDescription.registryCredential] + * Credential information to connect to container registry. * * @param {string} * [composeDeploymentUpgradeDescription.registryCredential.registryUserName] @@ -16195,41 +17274,81 @@ declare class ServiceFabricClient extends ServiceClient { * [composeDeploymentUpgradeDescription.registryCredential.passwordEncrypted] * Indicates that supplied container registry password is encrypted. * - * @param {string} composeDeploymentUpgradeDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' + * @param {string} composeDeploymentUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} * [composeDeploymentUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * 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} [composeDeploymentUpgradeDescription.forceRestart] + * @param {boolean} [composeDeploymentUpgradeDescription.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} [composeDeploymentUpgradeDescription.monitoringPolicy] + * Describes the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy] + * [composeDeploymentUpgradeDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * * @param {boolean} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.considerWarningAsError] @@ -16248,9 +17367,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -16266,7 +17385,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -16281,7 +17399,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -16297,16 +17414,17 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16331,12 +17449,14 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} composeDeploymentUpgradeDescription Parameters for upgrading * compose deployment. * - * @param {string} composeDeploymentUpgradeDescription.deploymentName + * @param {string} composeDeploymentUpgradeDescription.deploymentName The name + * of the deployment. * * @param {string} composeDeploymentUpgradeDescription.composeFileContent The * content of the compose file that describes the deployment to create. * * @param {object} [composeDeploymentUpgradeDescription.registryCredential] + * Credential information to connect to container registry. * * @param {string} * [composeDeploymentUpgradeDescription.registryCredential.registryUserName] @@ -16350,41 +17470,81 @@ declare class ServiceFabricClient extends ServiceClient { * [composeDeploymentUpgradeDescription.registryCredential.passwordEncrypted] * Indicates that supplied container registry password is encrypted. * - * @param {string} composeDeploymentUpgradeDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' + * @param {string} composeDeploymentUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} * [composeDeploymentUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * 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} [composeDeploymentUpgradeDescription.forceRestart] + * @param {boolean} [composeDeploymentUpgradeDescription.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} [composeDeploymentUpgradeDescription.monitoringPolicy] + * Describes the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy] + * [composeDeploymentUpgradeDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * * @param {boolean} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.considerWarningAsError] @@ -16403,9 +17563,9 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -16421,7 +17581,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -16436,7 +17595,6 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -16452,16 +17610,17 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16492,6 +17651,75 @@ declare class ServiceFabricClient extends ServiceClient { startComposeDeploymentUpgrade(deploymentName: string, composeDeploymentUpgradeDescription: models.ComposeDeploymentUpgradeDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Get the status of Chaos. + * + * Get the status of Chaos indicating whether or not Chaos is running, the + * Chaos parameters used for running Chaos and the status of the Chaos + * Schedule. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getChaosWithHttpOperationResponse(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of Chaos. + * + * Get the status of Chaos indicating whether or not Chaos is running, the + * Chaos parameters used for running Chaos and the status of the Chaos + * Schedule. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {Chaos} - 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. + * + * {Chaos} [result] - The deserialized result object if an error did not occur. + * See {@link Chaos} 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. + */ + getChaos(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getChaos(callback: ServiceCallback): void; + getChaos(options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Starts Chaos in the cluster. * @@ -16499,11 +17727,10 @@ declare class ServiceFabricClient extends ServiceClient { * passed in Chaos parameters. * If Chaos is already running when this call is made, the call fails with the * error code FABRIC_E_CHAOS_ALREADY_RUNNING. - * Please refer to the article [Induce controlled Chaos in Service Fabric - * clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) + * Refer to the article [Induce controlled Chaos in Service Fabric + * clusters](https://docs.microsoft.com/azure/service-fabric/service-fabric-controlled-chaos) * for more details. * - * * @param {object} chaosParameters Describes all the parameters to configure a * Chaos run. * @@ -16511,7 +17738,6 @@ declare class ServiceFabricClient extends ServiceClient { * for which Chaos will run before automatically stopping. The maximum allowed * value is 4,294,967,295 (System.UInt32.MaxValue). * - * * @param {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] * The maximum amount of time to wait for all cluster entities to become stable * and healthy. Chaos executes in iterations and at the start of each iteration @@ -16520,21 +17746,18 @@ declare class ServiceFabricClient extends ServiceClient { * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed * event. * - * * @param {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults is * the maximum number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated by * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise * caution while moving up. * - * * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or * disables the move primary and move secondary faults. * - * * @param {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait time * (in seconds) between consecutive faults within a single iteration. * The larger the value, the lower the overlapping between faults and the @@ -16542,13 +17765,15 @@ declare class ServiceFabricClient extends ServiceClient { * The recommendation is to start with a value between 1 and 5 and exercise * caution while moving up. * - * * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] * Time-separation (in seconds) between two consecutive iterations of Chaos. * The larger the value, the lower the fault injection rate. * - * - * @param {object} [chaosParameters.clusterHealthPolicy] + * @param {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected exception + * happens during fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. * * @param {boolean} * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates @@ -16571,7 +17796,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [chaosParameters.clusterHealthPolicy.maxPercentUnhealthyApplications] The * maximum allowed percentage of unhealthy applications before reporting an @@ -16589,20 +17813,88 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} - * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * - * @param {object} [chaosParameters.context] - * - * @param {object} [chaosParameters.context.map] + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used to + * record information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * + * @param {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. + * + * @param {object} [chaosParameters.chaosTargetFilter] List of cluster entities + * to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * + * @param {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] A + * list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * + * @param {array} [chaosParameters.chaosTargetFilter.applicationInclusionList] + * A list of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16622,11 +17914,10 @@ declare class ServiceFabricClient extends ServiceClient { * passed in Chaos parameters. * If Chaos is already running when this call is made, the call fails with the * error code FABRIC_E_CHAOS_ALREADY_RUNNING. - * Please refer to the article [Induce controlled Chaos in Service Fabric - * clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) + * Refer to the article [Induce controlled Chaos in Service Fabric + * clusters](https://docs.microsoft.com/azure/service-fabric/service-fabric-controlled-chaos) * for more details. * - * * @param {object} chaosParameters Describes all the parameters to configure a * Chaos run. * @@ -16634,7 +17925,6 @@ declare class ServiceFabricClient extends ServiceClient { * for which Chaos will run before automatically stopping. The maximum allowed * value is 4,294,967,295 (System.UInt32.MaxValue). * - * * @param {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] * The maximum amount of time to wait for all cluster entities to become stable * and healthy. Chaos executes in iterations and at the start of each iteration @@ -16643,21 +17933,18 @@ declare class ServiceFabricClient extends ServiceClient { * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed * event. * - * * @param {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults is * the maximum number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated by * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise * caution while moving up. * - * * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or * disables the move primary and move secondary faults. * - * * @param {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait time * (in seconds) between consecutive faults within a single iteration. * The larger the value, the lower the overlapping between faults and the @@ -16665,13 +17952,15 @@ declare class ServiceFabricClient extends ServiceClient { * The recommendation is to start with a value between 1 and 5 and exercise * caution while moving up. * - * * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] * Time-separation (in seconds) between two consecutive iterations of Chaos. * The larger the value, the lower the fault injection rate. * - * - * @param {object} [chaosParameters.clusterHealthPolicy] + * @param {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected exception + * happens during fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. * * @param {boolean} * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates @@ -16694,7 +17983,6 @@ declare class ServiceFabricClient extends ServiceClient { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [chaosParameters.clusterHealthPolicy.maxPercentUnhealthyApplications] The * maximum allowed percentage of unhealthy applications before reporting an @@ -16712,20 +18000,88 @@ declare class ServiceFabricClient extends ServiceClient { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} - * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * - * @param {object} [chaosParameters.context] - * - * @param {object} [chaosParameters.context.map] + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used to + * record information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * + * @param {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. + * + * @param {object} [chaosParameters.chaosTargetFilter] List of cluster entities + * to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * + * @param {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] A + * list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * + * @param {array} [chaosParameters.chaosTargetFilter.applicationInclusionList] + * A list of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16757,18 +18113,22 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Stops Chaos in the cluster if it is already running, otherwise it - * does nothing. + * @summary Stops Chaos if it is running in the cluster and put the Chaos + * Schedule in a stopped state. * - * Stops Chaos from scheduling further faults; but, the in-flight faults are - * not affected. + * Stops Chaos from executing new faults. In-flight faults will continue to + * execute until they are complete. The current Chaos Schedule is put into a + * stopped state. + * Once a schedule is stopped, it will stay in the stopped state and not be + * used to Chaos Schedule new runs of Chaos. A new Chaos Schedule must be set + * in order to resume scheduling. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16782,18 +18142,22 @@ declare class ServiceFabricClient extends ServiceClient { stopChaosWithHttpOperationResponse(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Stops Chaos in the cluster if it is already running, otherwise it - * does nothing. + * @summary Stops Chaos if it is running in the cluster and put the Chaos + * Schedule in a stopped state. * - * Stops Chaos from scheduling further faults; but, the in-flight faults are - * not affected. + * Stops Chaos from executing new faults. In-flight faults will continue to + * execute until they are complete. The current Chaos Schedule is put into a + * stopped state. + * Once a schedule is stopped, it will stay in the stopped state and not be + * used to Chaos Schedule new runs of Chaos. A new Chaos Schedule must be set + * in order to resume scheduling. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16825,93 +18189,294 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Gets the next segment of the Chaos report based on the passed-in - * continuation token or the passed-in time-range. - * - * You can either specify the ContinuationToken to get the next segment of the - * Chaos report or you can specify the time-range - * through StartTimeUtc and EndTimeUtc, but you cannot specify both the - * ContinuationToken and the time-range in the same call. - * When there are more than 100 Chaos events, the Chaos report is returned in - * segments where a segment contains no more than 100 Chaos events. + * @summary Gets the next segment of the Chaos events based on the continuation + * token or the time range. * + * To get the next segment of the Chaos events, you can specify the + * ContinuationToken. To get the start of a new segment of Chaos events, you + * can specify the time range + * through StartTimeUtc and EndTimeUtc. You cannot specify both the + * ContinuationToken and the time range in the same call. + * When there are more than 100 Chaos events, the Chaos events are returned in + * multiple segments where a segment contains no more than 100 Chaos events and + * to get the next segment you make a call to this API with the continuation + * token. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * - * @param {string} [options.startTimeUtc] The count of ticks representing the - * start time of the time range for which a Chaos report is to be generated. - * Please consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {string} [options.startTimeUtc] The Windows file time representing + * the start time of the time range for which a Chaos report is to be + * generated. Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. + * + * @param {string} [options.endTimeUtc] The Windows file time representing the + * end time of the time range for which a Chaos report is to be generated. + * Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. * - * @param {string} [options.endTimeUtc] The count of ticks representing the end - * time of the time range for which a Chaos report is to be generated. Please - * consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getChaosReportWithHttpOperationResponse(options?: { continuationToken? : string, startTimeUtc? : string, endTimeUtc? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getChaosEventsWithHttpOperationResponse(options?: { continuationToken? : string, startTimeUtc? : string, endTimeUtc? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the next segment of the Chaos report based on the passed-in - * continuation token or the passed-in time-range. - * - * You can either specify the ContinuationToken to get the next segment of the - * Chaos report or you can specify the time-range - * through StartTimeUtc and EndTimeUtc, but you cannot specify both the - * ContinuationToken and the time-range in the same call. - * When there are more than 100 Chaos events, the Chaos report is returned in - * segments where a segment contains no more than 100 Chaos events. + * @summary Gets the next segment of the Chaos events based on the continuation + * token or the time range. * + * To get the next segment of the Chaos events, you can specify the + * ContinuationToken. To get the start of a new segment of Chaos events, you + * can specify the time range + * through StartTimeUtc and EndTimeUtc. You cannot specify both the + * ContinuationToken and the time range in the same call. + * When there are more than 100 Chaos events, the Chaos events are returned in + * multiple segments where a segment contains no more than 100 Chaos events and + * to get the next segment you make a call to this API with the continuation + * token. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * - * @param {string} [options.startTimeUtc] The count of ticks representing the - * start time of the time range for which a Chaos report is to be generated. - * Please consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {string} [options.startTimeUtc] The Windows file time representing + * the start time of the time range for which a Chaos report is to be + * generated. Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. + * + * @param {string} [options.endTimeUtc] The Windows file time representing the + * end time of the time range for which a Chaos report is to be generated. + * Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ChaosEventsSegment} - 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. + * + * {ChaosEventsSegment} [result] - The deserialized result object if an error did not occur. + * See {@link ChaosEventsSegment} 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. + */ + getChaosEvents(options?: { continuationToken? : string, startTimeUtc? : string, endTimeUtc? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getChaosEvents(callback: ServiceCallback): void; + getChaosEvents(options: { continuationToken? : string, startTimeUtc? : string, endTimeUtc? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the Chaos Schedule defining when and how to run Chaos. + * + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that + * defines when and how to run Chaos. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getChaosScheduleWithHttpOperationResponse(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the Chaos Schedule defining when and how to run Chaos. + * + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that + * defines when and how to run Chaos. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ChaosScheduleDescription} - 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. + * + * {ChaosScheduleDescription} [result] - The deserialized result object if an error did not occur. + * See {@link ChaosScheduleDescription} 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. + */ + getChaosSchedule(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getChaosSchedule(callback: ServiceCallback): void; + getChaosSchedule(options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Set the schedule used by Chaos. + * + * Chaos will automatically schedule runs based on the Chaos Schedule. + * The Chaos Schedule will be updated if the provided version matches the + * version on the server. + * When updating the Chaos Schedule, the version on the server is incremented + * by 1. + * The version on the server will wrap back to 0 after reaching a large number. + * If Chaos is running when this call is made, the call will fail. + * + * @param {object} chaosSchedule Describes the schedule used by Chaos. + * + * @param {number} [chaosSchedule.version] The version number of the Schedule. + * + * @param {object} [chaosSchedule.schedule] Defines the schedule used by Chaos. + * + * @param {date} [chaosSchedule.schedule.startDate] The date and time Chaos + * will start using this schedule. * - * @param {string} [options.endTimeUtc] The count of ticks representing the end - * time of the time range for which a Chaos report is to be generated. Please - * consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {date} [chaosSchedule.schedule.expiryDate] The date and time Chaos + * will continue to use this schedule until. + * + * @param {array} [chaosSchedule.schedule.chaosParametersDictionary] A mapping + * of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * + * @param {array} [chaosSchedule.schedule.jobs] A list of all Chaos Schedule + * Jobs that will be automated by the schedule. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + postChaosScheduleWithHttpOperationResponse(chaosSchedule: models.ChaosScheduleDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Set the schedule used by Chaos. + * + * Chaos will automatically schedule runs based on the Chaos Schedule. + * The Chaos Schedule will be updated if the provided version matches the + * version on the server. + * When updating the Chaos Schedule, the version on the server is incremented + * by 1. + * The version on the server will wrap back to 0 after reaching a large number. + * If Chaos is running when this call is made, the call will fail. + * + * @param {object} chaosSchedule Describes the schedule used by Chaos. + * + * @param {number} [chaosSchedule.version] The version number of the Schedule. + * + * @param {object} [chaosSchedule.schedule] Defines the schedule used by Chaos. + * + * @param {date} [chaosSchedule.schedule.startDate] The date and time Chaos + * will start using this schedule. + * + * @param {date} [chaosSchedule.schedule.expiryDate] The date and time Chaos + * will continue to use this schedule until. + * + * @param {array} [chaosSchedule.schedule.chaosParametersDictionary] A mapping + * of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * + * @param {array} [chaosSchedule.schedule.jobs] A list of all Chaos Schedule + * Jobs that will be automated by the schedule. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16923,7 +18488,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {ChaosReport} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16931,16 +18496,15 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ChaosReport} [result] - The deserialized result object if an error did not occur. - * See {@link ChaosReport} 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. */ - getChaosReport(options?: { continuationToken? : string, startTimeUtc? : string, endTimeUtc? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getChaosReport(callback: ServiceCallback): void; - getChaosReport(options: { continuationToken? : string, startTimeUtc? : string, endTimeUtc? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + postChaosSchedule(chaosSchedule: models.ChaosScheduleDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + postChaosSchedule(chaosSchedule: models.ChaosScheduleDescription, callback: ServiceCallback): void; + postChaosSchedule(chaosSchedule: models.ChaosScheduleDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -16953,21 +18517,20 @@ declare class ServiceFabricClient extends ServiceClient { * availability of the folder. The mark file is an empty file named "_.dir". * The mark file is generated by the image store service when all files in a * folder are uploaded. When using File-by-File approach to upload application - * package in REST, the image store service isn�t aware of the file hierarchy + * package in REST, the image store service isn't aware of the file hierarchy * of the application package; you need to create a mark file per folder and * upload it last, to let the image store service know that the folder is * complete. * - * * @param {string} contentPath Relative path to file or folder in the image * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16990,21 +18553,20 @@ declare class ServiceFabricClient extends ServiceClient { * availability of the folder. The mark file is an empty file named "_.dir". * The mark file is generated by the image store service when all files in a * folder are uploaded. When using File-by-File approach to upload application - * package in REST, the image store service isn�t aware of the file hierarchy + * package in REST, the image store service isn't aware of the file hierarchy * of the application package; you need to create a mark file per folder and * upload it last, to let the image store service know that the folder is * complete. * - * * @param {string} contentPath Relative path to file or folder in the image * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17039,7 +18601,7 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the image store content information. * * Returns the information about the image store content at the specified - * contentPath relative to the root of the image store. + * contentPath. The contentPath is relative to the root of the image store. * * @param {string} contentPath Relative path to file or folder in the image * store from its root. @@ -17047,9 +18609,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17066,7 +18628,7 @@ declare class ServiceFabricClient extends ServiceClient { * @summary Gets the image store content information. * * Returns the information about the image store content at the specified - * contentPath relative to the root of the image store. + * contentPath. The contentPath is relative to the root of the image store. * * @param {string} contentPath Relative path to file or folder in the image * store from its root. @@ -17074,9 +18636,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17121,9 +18683,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17149,9 +18711,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17191,9 +18753,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17215,9 +18777,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17276,9 +18838,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17318,9 +18880,9 @@ declare class ServiceFabricClient extends ServiceClient { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17352,81 +18914,49 @@ declare class ServiceFabricClient extends ServiceClient { /** - * @summary Invokes an administrative command on the given Infrastructure - * Service instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific commands to a - * particular - * instance of the Infrastructure Service. + * @summary Cancels an image store upload session. * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * The DELETE request will cause the existing upload session to expire and + * remove any previously uploaded file chunks. * - * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - invokeInfrastructureCommandWithHttpOperationResponse(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteImageStoreUploadSessionWithHttpOperationResponse(sessionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Invokes an administrative command on the given Infrastructure - * Service instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific commands to a - * particular - * instance of the Infrastructure Service. - * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @summary Cancels an image store upload session. * + * The DELETE request will cause the existing upload session to expire and + * remove any previously uploaded file chunks. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17438,7 +18968,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17446,93 +18976,65 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {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. */ - invokeInfrastructureCommand(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - invokeInfrastructureCommand(command: string, callback: ServiceCallback): void; - invokeInfrastructureCommand(command: string, options: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteImageStoreUploadSession(sessionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteImageStoreUploadSession(sessionId: string, callback: ServiceCallback): void; + deleteImageStoreUploadSession(sessionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Invokes a read-only query on the given infrastructure service - * instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific queries to a - * particular - * instance of the Infrastructure Service. - * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @summary Commit an image store upload session. * + * When all file chunks have been uploaded, the upload session needs to be + * committed explicitly to complete the upload. Image store preserves the + * upload session until the expiration time, which is 30 minutes after the last + * chunk received. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - invokeInfrastructureQueryWithHttpOperationResponse(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + commitImageStoreUploadSessionWithHttpOperationResponse(sessionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Invokes a read-only query on the given infrastructure service - * instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific queries to a - * particular - * instance of the Infrastructure Service. - * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @summary Commit an image store upload session. * + * When all file chunks have been uploaded, the upload session needs to be + * committed explicitly to complete the upload. Image store preserves the + * upload session until the expiration time, which is 30 minutes after the last + * chunk received. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17544,7 +19046,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17552,137 +19054,6478 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {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. */ - invokeInfrastructureQuery(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - invokeInfrastructureQuery(command: string, callback: ServiceCallback): void; - invokeInfrastructureQuery(command: string, options: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + commitImageStoreUploadSession(sessionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + commitImageStoreUploadSession(sessionId: string, callback: ServiceCallback): void; + commitImageStoreUploadSession(sessionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary This API will induce data loss for the specified partition. It will - * trigger a call to the OnDataLossAsync API of the partition. + * @summary Get the image store upload session by ID. * - * This API will induce data loss for the specified partition. It will trigger - * a call to the OnDataLoss API of the partition. - * Actual data loss will depend on the specified DataLossMode - * PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is - * triggered for the partition but actual data loss depends on the presence of - * in-flight replication. - * FullDataLoss - All replicas are removed hence all data is lost and - * OnDataLoss is triggered. + * Gets the image store upload session identified by the given ID. User can + * query the upload session at any time during uploading. * - * This API should only be called with a stateful service as the target. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * - * Calling this API with a system service as the target is not advised. + * @param {object} [options] Optional Parameters. * - * Note: Once this API has been called, it cannot be reversed. Calling - * CancelOperation will only stop execution and clean up internal system state. - * It will not restore data if the command has progressed far enough to cause - * data loss. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * Call the GetDataLossProgress API with the same OperationId to return - * information on the operation started with this API. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * + * @returns {Promise} A promise is returned * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {uuid} partitionId The identity of the partition. + * @reject {Error|ServiceError} - The error object. + */ + getImageStoreUploadSessionByIdWithHttpOperationResponse(sessionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the image store upload session by ID. * - * @param {uuid} operationId A GUID that identifies a call of this API. This + * Gets the image store upload session identified by the given ID. User can + * query the upload session at any time during uploading. + * + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {UploadSession} - 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. + * + * {UploadSession} [result] - The deserialized result object if an error did not occur. + * See {@link UploadSession} 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. + */ + getImageStoreUploadSessionById(sessionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getImageStoreUploadSessionById(sessionId: string, callback: ServiceCallback): void; + getImageStoreUploadSessionById(sessionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the image store upload session by relative path. + * + * Gets the image store upload session associated with the given image store + * relative path. User can query the upload session at any time during + * uploading. + * + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getImageStoreUploadSessionByPathWithHttpOperationResponse(contentPath: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the image store upload session by relative path. + * + * Gets the image store upload session associated with the given image store + * relative path. User can query the upload session at any time during + * uploading. + * + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {UploadSession} - 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. + * + * {UploadSession} [result] - The deserialized result object if an error did not occur. + * See {@link UploadSession} 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. + */ + getImageStoreUploadSessionByPath(contentPath: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getImageStoreUploadSessionByPath(contentPath: string, callback: ServiceCallback): void; + getImageStoreUploadSessionByPath(contentPath: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Uploads a file chunk to the image store relative path. + * + * Uploads a file chunk to the image store with the specified upload session ID + * and image store relative path. This API allows user to resume the file + * upload operation. user doesn't have to restart the file upload from scratch + * whenever there is a network interruption. Use this option if the file size + * is large. + * + * To perform a resumable file upload, user need to break the file into + * multiple chunks and upload these chunks to the image store one-by-one. + * Chunks don't have to be uploaded in order. If the file represented by the + * image store relative path already exists, it will be overwritten when the + * upload session commits. + * + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. + * + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. + * + * @param {string} contentRange When uploading file chunks to the image store, + * the Content-Range header field need to be configured and sent with a + * request. The format should looks like "bytes + * {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, + * Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300 + * through 5,000 and the total file length is 20,000 bytes. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + uploadFileChunkWithHttpOperationResponse(contentPath: string, sessionId: string, contentRange: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Uploads a file chunk to the image store relative path. + * + * Uploads a file chunk to the image store with the specified upload session ID + * and image store relative path. This API allows user to resume the file + * upload operation. user doesn't have to restart the file upload from scratch + * whenever there is a network interruption. Use this option if the file size + * is large. + * + * To perform a resumable file upload, user need to break the file into + * multiple chunks and upload these chunks to the image store one-by-one. + * Chunks don't have to be uploaded in order. If the file represented by the + * image store relative path already exists, it will be overwritten when the + * upload session commits. + * + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. + * + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. + * + * @param {string} contentRange When uploading file chunks to the image store, + * the Content-Range header field need to be configured and sent with a + * request. The format should looks like "bytes + * {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, + * Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300 + * through 5,000 and the total file length is 20,000 bytes. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + uploadFileChunk(contentPath: string, sessionId: string, contentRange: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + uploadFileChunk(contentPath: string, sessionId: string, contentRange: string, callback: ServiceCallback): void; + uploadFileChunk(contentPath: string, sessionId: string, contentRange: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invokes an administrative command on the given Infrastructure + * Service instance. + * + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific commands to a + * particular + * instance of the Infrastructure Service. + * + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. + * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + invokeInfrastructureCommandWithHttpOperationResponse(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invokes an administrative command on the given Infrastructure + * Service instance. + * + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific commands to a + * particular + * instance of the Infrastructure Service. + * + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. + * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {String} - 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. + * + * {String} [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. + */ + invokeInfrastructureCommand(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + invokeInfrastructureCommand(command: string, callback: ServiceCallback): void; + invokeInfrastructureCommand(command: string, options: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invokes a read-only query on the given infrastructure service + * instance. + * + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific queries to a + * particular + * instance of the Infrastructure Service. + * + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. + * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + invokeInfrastructureQueryWithHttpOperationResponse(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invokes a read-only query on the given infrastructure service + * instance. + * + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific queries to a + * particular + * instance of the Infrastructure Service. + * + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. + * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {String} - 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. + * + * {String} [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. + */ + invokeInfrastructureQuery(command: string, options?: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + invokeInfrastructureQuery(command: string, callback: ServiceCallback): void; + invokeInfrastructureQuery(command: string, options: { serviceId? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This API will induce data loss for the specified partition. It will + * trigger a call to the OnDataLossAsync API of the partition. + * + * This API will induce data loss for the specified partition. It will trigger + * a call to the OnDataLoss API of the partition. + * Actual data loss will depend on the specified DataLossMode. + * + * - PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is + * triggered for the partition but actual data loss depends on the presence of + * in-flight replication. + * - FullDataLoss - All replicas are removed hence all data is lost and + * OnDataLoss is triggered. + * + * This API should only be called with a stateful service as the target. + * + * Calling this API with a system service as the target is not advised. + * + * Note: Once this API has been called, it cannot be reversed. Calling + * CancelOperation will only stop execution and clean up internal system state. + * It will not restore data if the command has progressed far enough to cause + * data loss. + * + * Call the GetDataLossProgress API with the same OperationId to return + * information on the operation started with this API. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} dataLossMode This enum is passed to the StartDataLoss API to + * indicate what type of data loss to induce. Possible values include: + * 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + startDataLossWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This API will induce data loss for the specified partition. It will + * trigger a call to the OnDataLossAsync API of the partition. + * + * This API will induce data loss for the specified partition. It will trigger + * a call to the OnDataLoss API of the partition. + * Actual data loss will depend on the specified DataLossMode. + * + * - PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is + * triggered for the partition but actual data loss depends on the presence of + * in-flight replication. + * - FullDataLoss - All replicas are removed hence all data is lost and + * OnDataLoss is triggered. + * + * This API should only be called with a stateful service as the target. + * + * Calling this API with a system service as the target is not advised. + * + * Note: Once this API has been called, it cannot be reversed. Calling + * CancelOperation will only stop execution and clean up internal system state. + * It will not restore data if the command has progressed far enough to cause + * data loss. + * + * Call the GetDataLossProgress API with the same OperationId to return + * information on the operation started with this API. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} dataLossMode This enum is passed to the StartDataLoss API to + * indicate what type of data loss to induce. Possible values include: + * 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + startDataLoss(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + startDataLoss(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, callback: ServiceCallback): void; + startDataLoss(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the progress of a partition data loss operation started using + * the StartDataLoss API. + * + * Gets the progress of a data loss operation started with StartDataLoss, using + * the OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getDataLossProgressWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the progress of a partition data loss operation started using + * the StartDataLoss API. + * + * Gets the progress of a data loss operation started with StartDataLoss, using + * the OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PartitionDataLossProgress} - 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. + * + * {PartitionDataLossProgress} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionDataLossProgress} 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. + */ + getDataLossProgress(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDataLossProgress(serviceId: string, partitionId: string, operationId: string, callback: ServiceCallback): void; + getDataLossProgress(serviceId: string, partitionId: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Induces quorum loss for a given stateful service partition. + * + * This API is useful for a temporary quorum loss situation on your service. + * + * Call the GetQuorumLossProgress API with the same OperationId to return + * information on the operation started with this API. + * + * This can only be called on stateful persisted (HasPersistedState==true) + * services. Do not use this API on stateless services or stateful in-memory + * only services. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss + * API to indicate what type of quorum loss to induce. Possible values include: + * 'Invalid', 'QuorumReplicas', 'AllReplicas' + * + * @param {number} quorumLossDuration The amount of time for which the + * partition will be kept in quorum loss. This must be specified in seconds. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + startQuorumLossWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Induces quorum loss for a given stateful service partition. + * + * This API is useful for a temporary quorum loss situation on your service. + * + * Call the GetQuorumLossProgress API with the same OperationId to return + * information on the operation started with this API. + * + * This can only be called on stateful persisted (HasPersistedState==true) + * services. Do not use this API on stateless services or stateful in-memory + * only services. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss + * API to indicate what type of quorum loss to induce. Possible values include: + * 'Invalid', 'QuorumReplicas', 'AllReplicas' + * + * @param {number} quorumLossDuration The amount of time for which the + * partition will be kept in quorum loss. This must be specified in seconds. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + startQuorumLoss(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + startQuorumLoss(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, callback: ServiceCallback): void; + startQuorumLoss(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the progress of a quorum loss operation on a partition started + * using the StartQuorumLoss API. + * + * Gets the progress of a quorum loss operation started with StartQuorumLoss, + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getQuorumLossProgressWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the progress of a quorum loss operation on a partition started + * using the StartQuorumLoss API. + * + * Gets the progress of a quorum loss operation started with StartQuorumLoss, + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PartitionQuorumLossProgress} - 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. + * + * {PartitionQuorumLossProgress} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionQuorumLossProgress} 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. + */ + getQuorumLossProgress(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getQuorumLossProgress(serviceId: string, partitionId: string, operationId: string, callback: ServiceCallback): void; + getQuorumLossProgress(serviceId: string, partitionId: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This API will restart some or all replicas or instances of the + * specified partition. + * + * This API is useful for testing failover. + * + * If used to target a stateless service partition, RestartPartitionMode must + * be AllReplicasOrInstances. + * + * Call the GetPartitionRestartProgress API using the same OperationId to get + * the progress. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} restartPartitionMode Describe which partitions to restart. + * Possible values include: 'Invalid', 'AllReplicasOrInstances', + * 'OnlyActiveSecondaries' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + startPartitionRestartWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This API will restart some or all replicas or instances of the + * specified partition. + * + * This API is useful for testing failover. + * + * If used to target a stateless service partition, RestartPartitionMode must + * be AllReplicasOrInstances. + * + * Call the GetPartitionRestartProgress API using the same OperationId to get + * the progress. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} restartPartitionMode Describe which partitions to restart. + * Possible values include: 'Invalid', 'AllReplicasOrInstances', + * 'OnlyActiveSecondaries' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + startPartitionRestart(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + startPartitionRestart(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, callback: ServiceCallback): void; + startPartitionRestart(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the progress of a PartitionRestart operation started using + * StartPartitionRestart. + * + * Gets the progress of a PartitionRestart started with StartPartitionRestart + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getPartitionRestartProgressWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the progress of a PartitionRestart operation started using + * StartPartitionRestart. + * + * Gets the progress of a PartitionRestart started with StartPartitionRestart + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PartitionRestartProgress} - 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. + * + * {PartitionRestartProgress} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionRestartProgress} 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. + */ + getPartitionRestartProgress(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionRestartProgress(serviceId: string, partitionId: string, operationId: string, callback: ServiceCallback): void; + getPartitionRestartProgress(serviceId: string, partitionId: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Starts or stops a cluster node. + * + * Starts or stops a cluster node. A cluster node is a process, not the OS + * instance itself. To start a node, pass in "Start" for the + * NodeTransitionType parameter. + * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This + * API starts the operation - when the API returns the node may not have + * finished transitioning yet. + * Call GetNodeTransitionProgress with the same OperationId to get the progress + * of the operation. + * + * @param {string} nodeName The name of the node. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} nodeTransitionType Indicates the type of transition to + * perform. NodeTransitionType.Start will start a stopped node. + * NodeTransitionType.Stop will stop a node that is up. Possible values + * include: 'Invalid', 'Start', 'Stop' + * + * @param {string} nodeInstanceId The node instance ID of the target node. + * This can be determined through GetNodeInfo API. + * + * @param {number} stopDurationInSeconds The duration, in seconds, to keep the + * node stopped. The minimum value is 600, the maximum is 14400. After this + * time expires, the node will automatically come back up. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + startNodeTransitionWithHttpOperationResponse(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Starts or stops a cluster node. + * + * Starts or stops a cluster node. A cluster node is a process, not the OS + * instance itself. To start a node, pass in "Start" for the + * NodeTransitionType parameter. + * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This + * API starts the operation - when the API returns the node may not have + * finished transitioning yet. + * Call GetNodeTransitionProgress with the same OperationId to get the progress + * of the operation. + * + * @param {string} nodeName The name of the node. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} nodeTransitionType Indicates the type of transition to + * perform. NodeTransitionType.Start will start a stopped node. + * NodeTransitionType.Stop will stop a node that is up. Possible values + * include: 'Invalid', 'Start', 'Stop' + * + * @param {string} nodeInstanceId The node instance ID of the target node. + * This can be determined through GetNodeInfo API. + * + * @param {number} stopDurationInSeconds The duration, in seconds, to keep the + * node stopped. The minimum value is 600, the maximum is 14400. After this + * time expires, the node will automatically come back up. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + startNodeTransition(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + startNodeTransition(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, callback: ServiceCallback): void; + startNodeTransition(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the progress of an operation started using + * StartNodeTransition. + * + * Gets the progress of an operation started with StartNodeTransition using the + * provided OperationId. + * + * @param {string} nodeName The name of the node. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getNodeTransitionProgressWithHttpOperationResponse(nodeName: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the progress of an operation started using + * StartNodeTransition. + * + * Gets the progress of an operation started with StartNodeTransition using the + * provided OperationId. + * + * @param {string} nodeName The name of the node. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {NodeTransitionProgress} - 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. + * + * {NodeTransitionProgress} [result] - The deserialized result object if an error did not occur. + * See {@link NodeTransitionProgress} 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. + */ + getNodeTransitionProgress(nodeName: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getNodeTransitionProgress(nodeName: string, operationId: string, callback: ServiceCallback): void; + getNodeTransitionProgress(nodeName: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of user-induced fault operations filtered by provided + * input. + * + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param {number} typeFilter Used to filter on OperationType for user-induced + * operations. + * + * - 65535 - select all + * - 1 - select PartitionDataLoss. + * - 2 - select PartitionQuorumLoss. + * - 4 - select PartitionRestart. + * - 8 - select NodeTransition. + * + * @param {number} stateFilter Used to filter on OperationState's for + * user-induced operations. + * + * - 65535 - select All + * - 1 - select Running + * - 2 - select RollingBack + * - 8 - select Completed + * - 16 - select Faulted + * - 32 - select Cancelled + * - 64 - select ForceCancelled + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getFaultOperationListWithHttpOperationResponse(typeFilter: number, stateFilter: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of user-induced fault operations filtered by provided + * input. + * + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param {number} typeFilter Used to filter on OperationType for user-induced + * operations. + * + * - 65535 - select all + * - 1 - select PartitionDataLoss. + * - 2 - select PartitionQuorumLoss. + * - 4 - select PartitionRestart. + * - 8 - select NodeTransition. + * + * @param {number} stateFilter Used to filter on OperationState's for + * user-induced operations. + * + * - 65535 - select All + * - 1 - select Running + * - 2 - select RollingBack + * - 8 - select Completed + * - 16 - select Faulted + * - 32 - select Cancelled + * - 64 - select ForceCancelled + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getFaultOperationList(typeFilter: number, stateFilter: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getFaultOperationList(typeFilter: number, stateFilter: number, callback: ServiceCallback): void; + getFaultOperationList(typeFilter: number, stateFilter: number, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Cancels a user-induced fault operation. + * + * The following APIs start fault operations that may be cancelled by using + * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, + * StartNodeTransition. + * + * If force is false, then the specified user-induced operation will be + * gracefully stopped and cleaned up. If force is true, the command will be + * aborted, and some internal state + * may be left behind. Specifying force as true should be used with care. + * Calling this API with force set to true is not allowed until this API has + * already + * been called on the same test command with force set to false first, or + * unless the test command already has an OperationState of + * OperationState.RollingBack. + * Clarification: OperationState.RollingBack means that the system will be/is + * cleaning up internal system state caused by executing the command. It will + * not restore data if the + * test command was to cause data loss. For example, if you call StartDataLoss + * then call this API, the system will only clean up internal state from + * running the command. + * It will not restore the target partition's data, if the command progressed + * far enough to cause data loss. + * + * Important note: if this API is invoked with force==true, internal state may + * be left behind. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {boolean} force Indicates whether to gracefully rollback and clean up + * internal system state modified by executing the user-induced operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + cancelOperationWithHttpOperationResponse(operationId: string, force: boolean, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Cancels a user-induced fault operation. + * + * The following APIs start fault operations that may be cancelled by using + * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, + * StartNodeTransition. + * + * If force is false, then the specified user-induced operation will be + * gracefully stopped and cleaned up. If force is true, the command will be + * aborted, and some internal state + * may be left behind. Specifying force as true should be used with care. + * Calling this API with force set to true is not allowed until this API has + * already + * been called on the same test command with force set to false first, or + * unless the test command already has an OperationState of + * OperationState.RollingBack. + * Clarification: OperationState.RollingBack means that the system will be/is + * cleaning up internal system state caused by executing the command. It will + * not restore data if the + * test command was to cause data loss. For example, if you call StartDataLoss + * then call this API, the system will only clean up internal state from + * running the command. + * It will not restore the target partition's data, if the command progressed + * far enough to cause data loss. + * + * Important note: if this API is invoked with force==true, internal state may + * be left behind. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This * is passed into the corresponding GetProgress API * - * @param {string} dataLossMode This enum is passed to the StartDataLoss API to - * indicate what type of data loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - PartialDataLoss - PartialDataLoss option will cause a quorum of replicas - * to go down, triggering an OnDataLoss event in the system for the given - * partition. - * - FullDataLoss - FullDataLoss option will drop all the replicas which means - * that all the data will be lost. - * . Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @param {boolean} force Indicates whether to gracefully rollback and clean up + * internal system state modified by executing the user-induced operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + cancelOperation(operationId: string, force: boolean, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + cancelOperation(operationId: string, force: boolean, callback: ServiceCallback): void; + cancelOperation(operationId: string, force: boolean, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a backup policy. + * + * Creates a backup policy which can be associated later with a Service Fabric + * application, service or a partition for periodic backup. + * + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + createBackupPolicyWithHttpOperationResponse(backupPolicyDescription: models.BackupPolicyDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a backup policy. + * + * Creates a backup policy which can be associated later with a Service Fabric + * application, service or a partition for periodic backup. + * + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + createBackupPolicy(backupPolicyDescription: models.BackupPolicyDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + createBackupPolicy(backupPolicyDescription: models.BackupPolicyDescription, callback: ServiceCallback): void; + createBackupPolicy(backupPolicyDescription: models.BackupPolicyDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the backup policy. + * + * Deletes an existing backup policy. A backup policy must be created before it + * can be deleted. A currently active backup policy, associated with any + * Service Fabric application, service or partition, cannot be deleted without + * first deleting the mapping. + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + deleteBackupPolicyWithHttpOperationResponse(backupPolicyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the backup policy. + * + * Deletes an existing backup policy. A backup policy must be created before it + * can be deleted. A currently active backup policy, associated with any + * Service Fabric application, service or partition, cannot be deleted without + * first deleting the mapping. + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + deleteBackupPolicy(backupPolicyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteBackupPolicy(backupPolicyName: string, callback: ServiceCallback): void; + deleteBackupPolicy(backupPolicyName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all the backup policies configured. + * + * Get a list of all the backup policies configured. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getBackupPolicyListWithHttpOperationResponse(options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all the backup policies configured. + * + * Get a list of all the backup policies configured. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedBackupPolicyDescriptionList} - 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. + * + * {PagedBackupPolicyDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupPolicyDescriptionList} 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. + */ + getBackupPolicyList(options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupPolicyList(callback: ServiceCallback): void; + getBackupPolicyList(options: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a particular backup policy by name. + * + * Gets a particular backup policy identified by {backupPolicyName} + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getBackupPolicyByNameWithHttpOperationResponse(backupPolicyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a particular backup policy by name. + * + * Gets a particular backup policy identified by {backupPolicyName} + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {BackupPolicyDescription} - 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. + * + * {BackupPolicyDescription} [result] - The deserialized result object if an error did not occur. + * See {@link BackupPolicyDescription} 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. + */ + getBackupPolicyByName(backupPolicyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupPolicyByName(backupPolicyName: string, callback: ServiceCallback): void; + getBackupPolicyByName(backupPolicyName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of backup entities that are associated with this + * policy. + * + * Returns a list of Service Fabric application, service or partition which are + * associated with this backup policy. + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getAllEntitiesBackedUpByPolicyWithHttpOperationResponse(backupPolicyName: string, options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of backup entities that are associated with this + * policy. + * + * Returns a list of Service Fabric application, service or partition which are + * associated with this backup policy. + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedBackupEntityList} - 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. + * + * {PagedBackupEntityList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupEntityList} 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. + */ + getAllEntitiesBackedUpByPolicy(backupPolicyName: string, options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getAllEntitiesBackedUpByPolicy(backupPolicyName: string, callback: ServiceCallback): void; + getAllEntitiesBackedUpByPolicy(backupPolicyName: string, options: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the backup policy. + * + * Updates the backup policy identified by {backupPolicyName} + * + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + updateBackupPolicyWithHttpOperationResponse(backupPolicyDescription: models.BackupPolicyDescription, backupPolicyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the backup policy. + * + * Updates the backup policy identified by {backupPolicyName} + * + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + updateBackupPolicy(backupPolicyDescription: models.BackupPolicyDescription, backupPolicyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + updateBackupPolicy(backupPolicyDescription: models.BackupPolicyDescription, backupPolicyName: string, callback: ServiceCallback): void; + updateBackupPolicy(backupPolicyDescription: models.BackupPolicyDescription, backupPolicyName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric application. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric application. Each partition is backed up individually as per + * the specified backup policy description. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + enableApplicationBackupWithHttpOperationResponse(applicationId: string, enableBackupDescription: models.EnableBackupDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric application. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric application. Each partition is backed up individually as per + * the specified backup policy description. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + enableApplicationBackup(applicationId: string, enableBackupDescription: models.EnableBackupDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + enableApplicationBackup(applicationId: string, enableBackupDescription: models.EnableBackupDescription, callback: ServiceCallback): void; + enableApplicationBackup(applicationId: string, enableBackupDescription: models.EnableBackupDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disables periodic backup of Service Fabric application. + * + * Disables periodic backup of Service Fabric application which was previously + * enabled. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + disableApplicationBackupWithHttpOperationResponse(applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disables periodic backup of Service Fabric application. + * + * Disables periodic backup of Service Fabric application which was previously + * enabled. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + disableApplicationBackup(applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + disableApplicationBackup(applicationId: string, callback: ServiceCallback): void; + disableApplicationBackup(applicationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Service Fabric application backup configuration + * information. + * + * Gets the Service Fabric backup configuration information for the application + * and the services and partitions under this application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationBackupConfigurationInfoWithHttpOperationResponse(applicationId: string, options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Service Fabric application backup configuration + * information. + * + * Gets the Service Fabric backup configuration information for the application + * and the services and partitions under this application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedBackupConfigurationInfoList} - 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. + * + * {PagedBackupConfigurationInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupConfigurationInfoList} 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. + */ + getApplicationBackupConfigurationInfo(applicationId: string, options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getApplicationBackupConfigurationInfo(applicationId: string, callback: ServiceCallback): void; + getApplicationBackupConfigurationInfo(applicationId: string, options: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of backups available for every partition in this + * application. + * + * Returns a list of backups available for every partition in this Service + * Fabric application. The server enumerates all the backups available at the + * backup location configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {object} [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. + */ + getApplicationBackupListWithHttpOperationResponse(applicationId: string, options?: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of backups available for every partition in this + * application. + * + * Returns a list of backups available for every partition in this Service + * Fabric application. The server enumerates all the backups available at the + * backup location configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @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 {PagedBackupInfoList} - 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. + * + * {PagedBackupInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupInfoList} 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. + */ + getApplicationBackupList(applicationId: string, options?: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getApplicationBackupList(applicationId: string, callback: ServiceCallback): void; + getApplicationBackupList(applicationId: string, options: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Suspends periodic backup for the specified Service Fabric + * application. + * + * The application which is configured to take periodic backups, is suspended + * for taking further backups till it is resumed again. This operation applies + * to the entire application's hierarchy. It means all the services and + * partitions under this application are now suspended for backup. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + suspendApplicationBackupWithHttpOperationResponse(applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Suspends periodic backup for the specified Service Fabric + * application. + * + * The application which is configured to take periodic backups, is suspended + * for taking further backups till it is resumed again. This operation applies + * to the entire application's hierarchy. It means all the services and + * partitions under this application are now suspended for backup. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + suspendApplicationBackup(applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + suspendApplicationBackup(applicationId: string, callback: ServiceCallback): void; + suspendApplicationBackup(applicationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resumes periodic backup of a Service Fabric application which was + * previously suspended. + * + * The previously suspended Service Fabric application resumes taking periodic + * backup as per the backup policy currently configured for the same. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + resumeApplicationBackupWithHttpOperationResponse(applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resumes periodic backup of a Service Fabric application which was + * previously suspended. + * + * The previously suspended Service Fabric application resumes taking periodic + * backup as per the backup policy currently configured for the same. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + resumeApplicationBackup(applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + resumeApplicationBackup(applicationId: string, callback: ServiceCallback): void; + resumeApplicationBackup(applicationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric service. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric service. Each partition is backed up individually as per the + * specified backup policy description. In case the application, which the + * service is part of, is already enabled for backup then this operation would + * override the policy being used to take the periodic backup for this service + * and its partitions (unless explicitly overridden at the partition level). + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + enableServiceBackupWithHttpOperationResponse(serviceId: string, enableBackupDescription: models.EnableBackupDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric service. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric service. Each partition is backed up individually as per the + * specified backup policy description. In case the application, which the + * service is part of, is already enabled for backup then this operation would + * override the policy being used to take the periodic backup for this service + * and its partitions (unless explicitly overridden at the partition level). + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + enableServiceBackup(serviceId: string, enableBackupDescription: models.EnableBackupDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + enableServiceBackup(serviceId: string, enableBackupDescription: models.EnableBackupDescription, callback: ServiceCallback): void; + enableServiceBackup(serviceId: string, enableBackupDescription: models.EnableBackupDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disables periodic backup of Service Fabric service which was + * previously enabled. + * + * Disables periodic backup of Service Fabric service which was previously + * enabled. Backup must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application, which this + * service is part of, this service would continue to be periodically backed up + * as per the policy mapped at the application level. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + disableServiceBackupWithHttpOperationResponse(serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disables periodic backup of Service Fabric service which was + * previously enabled. + * + * Disables periodic backup of Service Fabric service which was previously + * enabled. Backup must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application, which this + * service is part of, this service would continue to be periodically backed up + * as per the policy mapped at the application level. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + disableServiceBackup(serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + disableServiceBackup(serviceId: string, callback: ServiceCallback): void; + disableServiceBackup(serviceId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Service Fabric service backup configuration information. + * + * Gets the Service Fabric backup configuration information for the service and + * the partitions under this service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getServiceBackupConfigurationInfoWithHttpOperationResponse(serviceId: string, options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Service Fabric service backup configuration information. + * + * Gets the Service Fabric backup configuration information for the service and + * the partitions under this service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedBackupConfigurationInfoList} - 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. + * + * {PagedBackupConfigurationInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupConfigurationInfoList} 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. + */ + getServiceBackupConfigurationInfo(serviceId: string, options?: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getServiceBackupConfigurationInfo(serviceId: string, callback: ServiceCallback): void; + getServiceBackupConfigurationInfo(serviceId: string, options: { continuationToken? : string, maxResults? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of backups available for every partition in this + * service. + * + * Returns a list of backups available for every partition in this Service + * Fabric service. The server enumerates all the backups available in the + * backup store configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {object} [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. + */ + getServiceBackupListWithHttpOperationResponse(serviceId: string, options?: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of backups available for every partition in this + * service. + * + * Returns a list of backups available for every partition in this Service + * Fabric service. The server enumerates all the backups available in the + * backup store configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @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 {PagedBackupInfoList} - 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. + * + * {PagedBackupInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupInfoList} 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. + */ + getServiceBackupList(serviceId: string, options?: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getServiceBackupList(serviceId: string, callback: ServiceCallback): void; + getServiceBackupList(serviceId: string, options: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Suspends periodic backup for the specified Service Fabric service. + * + * The service which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. This operation applies to + * the entire service's hierarchy. It means all the partitions under this + * service are now suspended for backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + suspendServiceBackupWithHttpOperationResponse(serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Suspends periodic backup for the specified Service Fabric service. + * + * The service which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. This operation applies to + * the entire service's hierarchy. It means all the partitions under this + * service are now suspended for backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + suspendServiceBackup(serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + suspendServiceBackup(serviceId: string, callback: ServiceCallback): void; + suspendServiceBackup(serviceId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resumes periodic backup of a Service Fabric service which was + * previously suspended. + * + * The previously suspended Service Fabric service resumes taking periodic + * backup as per the backup policy currently configured for the same. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + resumeServiceBackupWithHttpOperationResponse(serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resumes periodic backup of a Service Fabric service which was + * previously suspended. + * + * The previously suspended Service Fabric service resumes taking periodic + * backup as per the backup policy currently configured for the same. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + resumeServiceBackup(serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + resumeServiceBackup(serviceId: string, callback: ServiceCallback): void; + resumeServiceBackup(serviceId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Enables periodic backup of the stateful persisted partition. + * + * Enables periodic backup of stateful persisted partition. Each partition is + * backed up as per the specified backup policy description. In case the + * application or service, which is partition is part of, is already enabled + * for backup then this operation would override the policy being used to take + * the periodic backup of this partition. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + enablePartitionBackupWithHttpOperationResponse(partitionId: string, enableBackupDescription: models.EnableBackupDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Enables periodic backup of the stateful persisted partition. + * + * Enables periodic backup of stateful persisted partition. Each partition is + * backed up as per the specified backup policy description. In case the + * application or service, which is partition is part of, is already enabled + * for backup then this operation would override the policy being used to take + * the periodic backup of this partition. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + enablePartitionBackup(partitionId: string, enableBackupDescription: models.EnableBackupDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + enablePartitionBackup(partitionId: string, enableBackupDescription: models.EnableBackupDescription, callback: ServiceCallback): void; + enablePartitionBackup(partitionId: string, enableBackupDescription: models.EnableBackupDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disables periodic backup of Service Fabric partition which was + * previously enabled. + * + * Disables periodic backup of partition which was previously enabled. Backup + * must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application or service, + * which this partition is part of, this partition would continue to be + * periodically backed up as per the policy mapped at the higher level entity. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + disablePartitionBackupWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disables periodic backup of Service Fabric partition which was + * previously enabled. + * + * Disables periodic backup of partition which was previously enabled. Backup + * must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application or service, + * which this partition is part of, this partition would continue to be + * periodically backed up as per the policy mapped at the higher level entity. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + disablePartitionBackup(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + disablePartitionBackup(partitionId: string, callback: ServiceCallback): void; + disablePartitionBackup(partitionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the partition backup configuration information + * + * Gets the Service Fabric Backup configuration information for the specified + * partition. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getPartitionBackupConfigurationInfoWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the partition backup configuration information + * + * Gets the Service Fabric Backup configuration information for the specified + * partition. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PartitionBackupConfigurationInfo} - 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. + * + * {PartitionBackupConfigurationInfo} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionBackupConfigurationInfo} 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. + */ + getPartitionBackupConfigurationInfo(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionBackupConfigurationInfo(partitionId: string, callback: ServiceCallback): void; + getPartitionBackupConfigurationInfo(partitionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of backups available for the specified partition. + * + * Returns a list of backups available for the specified partition. The server + * enumerates all the backups available in the backup store configured in the + * backup policy. It also allows filtering of the result based on start and end + * datetime or just fetching the latest available backup for the partition. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {object} [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. + */ + getPartitionBackupListWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of backups available for the specified partition. + * + * Returns a list of backups available for the specified partition. The server + * enumerates all the backups available in the backup store configured in the + * backup policy. It also allows filtering of the result based on start and end + * datetime or just fetching the latest available backup for the partition. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @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 {PagedBackupInfoList} - 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. + * + * {PagedBackupInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupInfoList} 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. + */ + getPartitionBackupList(partitionId: string, options?: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionBackupList(partitionId: string, callback: ServiceCallback): void; + getPartitionBackupList(partitionId: string, options: { timeout? : number, latest? : boolean, startDateTimeFilter? : Date, endDateTimeFilter? : Date, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Suspends periodic backup for the specified partition. + * + * The partition which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + suspendPartitionBackupWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Suspends periodic backup for the specified partition. + * + * The partition which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + suspendPartitionBackup(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + suspendPartitionBackup(partitionId: string, callback: ServiceCallback): void; + suspendPartitionBackup(partitionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resumes periodic backup of partition which was previously + * suspended. + * + * The previously suspended partition resumes taking periodic backup as per the + * backup policy currently configured for the same. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + resumePartitionBackupWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resumes periodic backup of partition which was previously + * suspended. + * + * The previously suspended partition resumes taking periodic backup as per the + * backup policy currently configured for the same. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + resumePartitionBackup(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + resumePartitionBackup(partitionId: string, callback: ServiceCallback): void; + resumePartitionBackup(partitionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Triggers backup of the partition's state. + * + * Creates a backup of the stateful persisted partition's state. In case the + * partition is already being periodically backed up, then by default the new + * backup is created at the same backup storage. One can also override the same + * by specifying the backup storage details as part of the request body. Once + * the backup is initiated, its progress can be tracked using the + * GetBackupProgress operation. + * In case, the operation times out, specify a greater backup timeout value in + * the query parameter. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.backupPartitionDescription] Describes the + * parameters to backup the partition now. If not present, backup operation + * uses default parameters from the backup policy current associated with this + * partition. + * + * @param {object} [options.backupPartitionDescription.backupStorage] Specifies + * the details of the backup storage where to save the backup. + * + * @param {string} + * [options.backupPartitionDescription.backupStorage.friendlyName] Friendly + * name for this backup storage. + * + * @param {string} options.backupPartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {number} [options.backupTimeout] Specifies the maximum amount of + * time, in minutes, to wait for the backup operation to complete. Post that, + * the operation completes with timeout error. However, in certain corner cases + * it could be that though the operation returns back timeout, the backup + * actually goes through. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. The default value for the + * same is 10 minutes. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + backupPartitionWithHttpOperationResponse(partitionId: string, options?: { backupPartitionDescription? : models.BackupPartitionDescription, backupTimeout? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Triggers backup of the partition's state. + * + * Creates a backup of the stateful persisted partition's state. In case the + * partition is already being periodically backed up, then by default the new + * backup is created at the same backup storage. One can also override the same + * by specifying the backup storage details as part of the request body. Once + * the backup is initiated, its progress can be tracked using the + * GetBackupProgress operation. + * In case, the operation times out, specify a greater backup timeout value in + * the query parameter. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.backupPartitionDescription] Describes the + * parameters to backup the partition now. If not present, backup operation + * uses default parameters from the backup policy current associated with this + * partition. + * + * @param {object} [options.backupPartitionDescription.backupStorage] Specifies + * the details of the backup storage where to save the backup. + * + * @param {string} + * [options.backupPartitionDescription.backupStorage.friendlyName] Friendly + * name for this backup storage. + * + * @param {string} options.backupPartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {number} [options.backupTimeout] Specifies the maximum amount of + * time, in minutes, to wait for the backup operation to complete. Post that, + * the operation completes with timeout error. However, in certain corner cases + * it could be that though the operation returns back timeout, the backup + * actually goes through. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. The default value for the + * same is 10 minutes. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + backupPartition(partitionId: string, options?: { backupPartitionDescription? : models.BackupPartitionDescription, backupTimeout? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + backupPartition(partitionId: string, callback: ServiceCallback): void; + backupPartition(partitionId: string, options: { backupPartitionDescription? : models.BackupPartitionDescription, backupTimeout? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets details for the latest backup triggered for this partition. + * + * Returns information about the state of the latest backup along with details + * or failure reason in case of completion. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getPartitionBackupProgressWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets details for the latest backup triggered for this partition. + * + * Returns information about the state of the latest backup along with details + * or failure reason in case of completion. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {BackupProgressInfo} - 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. + * + * {BackupProgressInfo} [result] - The deserialized result object if an error did not occur. + * See {@link BackupProgressInfo} 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. + */ + getPartitionBackupProgress(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionBackupProgress(partitionId: string, callback: ServiceCallback): void; + getPartitionBackupProgress(partitionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Triggers restore of the state of the partition using the specified + * restore partition description. + * + * Restores the state of a of the stateful persisted partition using the + * specified backup point. In case the partition is already being periodically + * backed up, then by default the backup point is looked for in the storage + * specified in backup policy. One can also override the same by specifying the + * backup storage details as part of the restore partition description in body. + * Once the restore is initiated, its progress can be tracked using the + * GetRestoreProgress operation. + * In case, the operation times out, specify a greater restore timeout value in + * the query parameter. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} restorePartitionDescription Describes the parameters to + * restore the partition. + * + * @param {uuid} restorePartitionDescription.backupId Unique backup ID. + * + * @param {string} restorePartitionDescription.backupLocation Location of the + * backup relative to the backup storage specified/ configured. + * + * @param {object} [restorePartitionDescription.backupStorage] Location of the + * backup from where the partition will be restored. + * + * @param {string} [restorePartitionDescription.backupStorage.friendlyName] + * Friendly name for this backup storage. + * + * @param {string} restorePartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.restoreTimeout] Specifies the maximum amount of + * time to wait, in minutes, for the restore operation to complete. Post that, + * the operation returns back with timeout error. However, in certain corner + * cases it could be that the restore operation goes through even though it + * completes with timeout. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. the default value for the + * same is 10 minutes. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + restorePartitionWithHttpOperationResponse(partitionId: string, restorePartitionDescription: models.RestorePartitionDescription, options?: { restoreTimeout? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Triggers restore of the state of the partition using the specified + * restore partition description. + * + * Restores the state of a of the stateful persisted partition using the + * specified backup point. In case the partition is already being periodically + * backed up, then by default the backup point is looked for in the storage + * specified in backup policy. One can also override the same by specifying the + * backup storage details as part of the restore partition description in body. + * Once the restore is initiated, its progress can be tracked using the + * GetRestoreProgress operation. + * In case, the operation times out, specify a greater restore timeout value in + * the query parameter. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} restorePartitionDescription Describes the parameters to + * restore the partition. + * + * @param {uuid} restorePartitionDescription.backupId Unique backup ID. + * + * @param {string} restorePartitionDescription.backupLocation Location of the + * backup relative to the backup storage specified/ configured. + * + * @param {object} [restorePartitionDescription.backupStorage] Location of the + * backup from where the partition will be restored. + * + * @param {string} [restorePartitionDescription.backupStorage.friendlyName] + * Friendly name for this backup storage. + * + * @param {string} restorePartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.restoreTimeout] Specifies the maximum amount of + * time to wait, in minutes, for the restore operation to complete. Post that, + * the operation returns back with timeout error. However, in certain corner + * cases it could be that the restore operation goes through even though it + * completes with timeout. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. the default value for the + * same is 10 minutes. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + restorePartition(partitionId: string, restorePartitionDescription: models.RestorePartitionDescription, options?: { restoreTimeout? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + restorePartition(partitionId: string, restorePartitionDescription: models.RestorePartitionDescription, callback: ServiceCallback): void; + restorePartition(partitionId: string, restorePartitionDescription: models.RestorePartitionDescription, options: { restoreTimeout? : number, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets details for the latest restore operation triggered for this + * partition. + * + * Returns information about the state of the latest restore operation along + * with details or failure reason in case of completion. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getPartitionRestoreProgressWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets details for the latest restore operation triggered for this + * partition. + * + * Returns information about the state of the latest restore operation along + * with details or failure reason in case of completion. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {RestoreProgressInfo} - 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. + * + * {RestoreProgressInfo} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreProgressInfo} 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. + */ + getPartitionRestoreProgress(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionRestoreProgress(partitionId: string, callback: ServiceCallback): void; + getPartitionRestoreProgress(partitionId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of backups available for the specified backed up + * entity at the specified backup location. + * + * Gets the list of backups available for the specified backed up entity + * (Application, Service or Partition) at the specified backup location + * (FileShare or Azure Blob Storage). + * + * @param {object} getBackupByStorageQueryDescription Describes the filters and + * backup storage details to be used for enumerating backups. + * + * @param {date} [getBackupByStorageQueryDescription.startDateTimeFilter] + * Specifies the start date time in ISO8601 from which to enumerate backups. If + * not specified, backups are enumerated from the beginning. + * + * @param {date} [getBackupByStorageQueryDescription.endDateTimeFilter] + * Specifies the end date time in ISO8601 till which to enumerate backups. If + * not specified, backups are enumerated till the end. + * + * @param {boolean} [getBackupByStorageQueryDescription.latest] If specified as + * true, gets the most recent backup (within the specified time range) for + * every partition under the specified backup entity. + * + * @param {object} getBackupByStorageQueryDescription.storage Describes the + * parameters for the backup storage from where to enumerate backups. This is + * optional and by default backups are enumerated from the backup storage where + * this backup entity is currently being backed up (as specified in backup + * policy). This parameter is useful to be able to enumerate backups from + * another cluster where you may intend to restore. + * + * @param {string} [getBackupByStorageQueryDescription.storage.friendlyName] + * Friendly name for this backup storage. + * + * @param {string} getBackupByStorageQueryDescription.storage.storageKind + * Polymorphic Discriminator + * + * @param {object} getBackupByStorageQueryDescription.backupEntity Indicates + * the entity for which to enumerate backups. + * + * @param {string} getBackupByStorageQueryDescription.backupEntity.entityKind + * Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {object} [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. + */ + getBackupsFromBackupLocationWithHttpOperationResponse(getBackupByStorageQueryDescription: models.GetBackupByStorageQueryDescription, options?: { timeout? : number, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of backups available for the specified backed up + * entity at the specified backup location. + * + * Gets the list of backups available for the specified backed up entity + * (Application, Service or Partition) at the specified backup location + * (FileShare or Azure Blob Storage). + * + * @param {object} getBackupByStorageQueryDescription Describes the filters and + * backup storage details to be used for enumerating backups. + * + * @param {date} [getBackupByStorageQueryDescription.startDateTimeFilter] + * Specifies the start date time in ISO8601 from which to enumerate backups. If + * not specified, backups are enumerated from the beginning. + * + * @param {date} [getBackupByStorageQueryDescription.endDateTimeFilter] + * Specifies the end date time in ISO8601 till which to enumerate backups. If + * not specified, backups are enumerated till the end. + * + * @param {boolean} [getBackupByStorageQueryDescription.latest] If specified as + * true, gets the most recent backup (within the specified time range) for + * every partition under the specified backup entity. + * + * @param {object} getBackupByStorageQueryDescription.storage Describes the + * parameters for the backup storage from where to enumerate backups. This is + * optional and by default backups are enumerated from the backup storage where + * this backup entity is currently being backed up (as specified in backup + * policy). This parameter is useful to be able to enumerate backups from + * another cluster where you may intend to restore. + * + * @param {string} [getBackupByStorageQueryDescription.storage.friendlyName] + * Friendly name for this backup storage. + * + * @param {string} getBackupByStorageQueryDescription.storage.storageKind + * Polymorphic Discriminator + * + * @param {object} getBackupByStorageQueryDescription.backupEntity Indicates + * the entity for which to enumerate backups. + * + * @param {string} getBackupByStorageQueryDescription.backupEntity.entityKind + * Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @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 {PagedBackupInfoList} - 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. + * + * {PagedBackupInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupInfoList} 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. + */ + getBackupsFromBackupLocation(getBackupByStorageQueryDescription: models.GetBackupByStorageQueryDescription, options?: { timeout? : number, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupsFromBackupLocation(getBackupByStorageQueryDescription: models.GetBackupByStorageQueryDescription, callback: ServiceCallback): void; + getBackupsFromBackupLocation(getBackupByStorageQueryDescription: models.GetBackupByStorageQueryDescription, options: { timeout? : number, continuationToken? : string, maxResults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a Service Fabric name. + * + * Creates the specified Service Fabric name. + * + * @param {object} nameDescription Describes the Service Fabric name to be + * created. + * + * @param {string} nameDescription.name The Service Fabric name, including the + * 'fabric:' URI scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + createNameWithHttpOperationResponse(nameDescription: models.NameDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a Service Fabric name. + * + * Creates the specified Service Fabric name. + * + * @param {object} nameDescription Describes the Service Fabric name to be + * created. + * + * @param {string} nameDescription.name The Service Fabric name, including the + * 'fabric:' URI scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + createName(nameDescription: models.NameDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + createName(nameDescription: models.NameDescription, callback: ServiceCallback): void; + createName(nameDescription: models.NameDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns whether the Service Fabric name exists. + * + * Returns whether the specified Service Fabric name exists. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getNameExistsInfoWithHttpOperationResponse(nameId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns whether the Service Fabric name exists. + * + * Returns whether the specified Service Fabric name exists. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + getNameExistsInfo(nameId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getNameExistsInfo(nameId: string, callback: ServiceCallback): void; + getNameExistsInfo(nameId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a Service Fabric name. + * + * Deletes the specified Service Fabric name. A name must be created before it + * can be deleted. Deleting a name with child properties will fail. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + deleteNameWithHttpOperationResponse(nameId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Service Fabric name. + * + * Deletes the specified Service Fabric name. A name must be created before it + * can be deleted. Deleting a name with child properties will fail. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + deleteName(nameId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteName(nameId: string, callback: ServiceCallback): void; + deleteName(nameId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Enumerates all the Service Fabric names under a given name. + * + * Enumerates all the Service Fabric names under a given name. If the subnames + * do not fit in a page, one page of results is returned as well as a + * continuation token, which can be used to get the next page. Querying a name + * that doesn't exist will fail. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] Allows specifying that the search + * performed should be recursive. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getSubNameInfoListWithHttpOperationResponse(nameId: string, options?: { recursive? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Enumerates all the Service Fabric names under a given name. + * + * Enumerates all the Service Fabric names under a given name. If the subnames + * do not fit in a page, one page of results is returned as well as a + * continuation token, which can be used to get the next page. Querying a name + * that doesn't exist will fail. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] Allows specifying that the search + * performed should be recursive. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedSubNameInfoList} - 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. + * + * {PagedSubNameInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedSubNameInfoList} 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. + */ + getSubNameInfoList(nameId: string, options?: { recursive? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getSubNameInfoList(nameId: string, callback: ServiceCallback): void; + getSubNameInfoList(nameId: string, options: { recursive? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets information on all Service Fabric properties under a given + * name. + * + * A Service Fabric name can have one or more named properties that store + * custom information. This operation gets the information about these + * properties in a paged list. The information includes name, value, and + * metadata about each of the properties. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeValues] Allows specifying whether to + * include the values of the properties returned. True if values should be + * returned with the metadata; False to return only property metadata. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getPropertyInfoListWithHttpOperationResponse(nameId: string, options?: { includeValues? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets information on all Service Fabric properties under a given + * name. + * + * A Service Fabric name can have one or more named properties that store + * custom information. This operation gets the information about these + * properties in a paged list. The information includes name, value, and + * metadata about each of the properties. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeValues] Allows specifying whether to + * include the values of the properties returned. True if values should be + * returned with the metadata; False to return only property metadata. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedPropertyInfoList} - 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. + * + * {PagedPropertyInfoList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedPropertyInfoList} 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. + */ + getPropertyInfoList(nameId: string, options?: { includeValues? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getPropertyInfoList(nameId: string, callback: ServiceCallback): void; + getPropertyInfoList(nameId: string, options: { includeValues? : boolean, continuationToken? : string, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a Service Fabric property. + * + * Creates or updates the specified Service Fabric property under a given name. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} propertyDescription Describes the Service Fabric property to + * be created. + * + * @param {string} propertyDescription.propertyName The name of the Service + * Fabric property. + * + * @param {string} [propertyDescription.customTypeId] The property's custom + * type ID. Using this property, the user is able to tag the type of the value + * of the property. + * + * @param {object} propertyDescription.value Describes a Service Fabric + * property value. + * + * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + putPropertyWithHttpOperationResponse(nameId: string, propertyDescription: models.PropertyDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Service Fabric property. + * + * Creates or updates the specified Service Fabric property under a given name. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} propertyDescription Describes the Service Fabric property to + * be created. + * + * @param {string} propertyDescription.propertyName The name of the Service + * Fabric property. + * + * @param {string} [propertyDescription.customTypeId] The property's custom + * type ID. Using this property, the user is able to tag the type of the value + * of the property. + * + * @param {object} propertyDescription.value Describes a Service Fabric + * property value. + * + * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + putProperty(nameId: string, propertyDescription: models.PropertyDescription, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + putProperty(nameId: string, propertyDescription: models.PropertyDescription, callback: ServiceCallback): void; + putProperty(nameId: string, propertyDescription: models.PropertyDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the specified Service Fabric property. + * + * Gets the specified Service Fabric property under a given name. This will + * always return both value and metadata. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getPropertyInfoWithHttpOperationResponse(nameId: string, propertyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the specified Service Fabric property. + * + * Gets the specified Service Fabric property under a given name. This will + * always return both value and metadata. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PropertyInfo} - 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. + * + * {PropertyInfo} [result] - The deserialized result object if an error did not occur. + * See {@link PropertyInfo} 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. + */ + getPropertyInfo(nameId: string, propertyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getPropertyInfo(nameId: string, propertyName: string, callback: ServiceCallback): void; + getPropertyInfo(nameId: string, propertyName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the specified Service Fabric property. + * + * Deletes the specified Service Fabric property under a given name. A property + * must be created before it can be deleted. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + deletePropertyWithHttpOperationResponse(nameId: string, propertyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the specified Service Fabric property. + * + * Deletes the specified Service Fabric property under a given name. A property + * must be created before it can be deleted. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + deleteProperty(nameId: string, propertyName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteProperty(nameId: string, propertyName: string, callback: ServiceCallback): void; + deleteProperty(nameId: string, propertyName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Submits a property batch. + * + * Submits a batch of property operations. Either all or none of the operations + * will be committed. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} propertyBatchDescriptionList Describes the property batch + * operations to be submitted. + * + * @param {array} [propertyBatchDescriptionList.operations] A list of the + * property batch operations to be executed. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + submitPropertyBatchWithHttpOperationResponse(nameId: string, propertyBatchDescriptionList: models.PropertyBatchDescriptionList, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Submits a property batch. + * + * Submits a batch of property operations. Either all or none of the operations + * will be committed. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} propertyBatchDescriptionList Describes the property batch + * operations to be submitted. + * + * @param {array} [propertyBatchDescriptionList.operations] A list of the + * property batch operations to be executed. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PropertyBatchInfo} - 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. + * + * {PropertyBatchInfo} [result] - The deserialized result object if an error did not occur. + * See {@link PropertyBatchInfo} 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. + */ + submitPropertyBatch(nameId: string, propertyBatchDescriptionList: models.PropertyBatchDescriptionList, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + submitPropertyBatch(nameId: string, propertyBatchDescriptionList: models.PropertyBatchDescriptionList, callback: ServiceCallback): void; + submitPropertyBatch(nameId: string, propertyBatchDescriptionList: models.PropertyBatchDescriptionList, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all Cluster-related events. + * + * The response is list of ClusterEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getClusterEventListWithHttpOperationResponse(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all Cluster-related events. + * + * The response is list of ClusterEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getClusterEventList(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getClusterEventList(startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getClusterEventList(startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all Containers-related events. + * + * The response is list of ContainerInstanceEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getContainersEventListWithHttpOperationResponse(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all Containers-related events. + * + * The response is list of ContainerInstanceEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getContainersEventList(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getContainersEventList(startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getContainersEventList(startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a Node-related events. + * + * The response is list of NodeEvent objects. + * + * @param {string} nodeName The name of the node. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getNodeEventListWithHttpOperationResponse(nodeName: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Node-related events. + * + * The response is list of NodeEvent objects. + * + * @param {string} nodeName The name of the node. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getNodeEventList(nodeName: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getNodeEventList(nodeName: string, startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getNodeEventList(nodeName: string, startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all Nodes-related Events. + * + * The response is list of NodeEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getNodesEventListWithHttpOperationResponse(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all Nodes-related Events. + * + * The response is list of NodeEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getNodesEventList(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getNodesEventList(startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getNodesEventList(startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets an Application-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getApplicationEventListWithHttpOperationResponse(applicationId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets an Application-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getApplicationEventList(applicationId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getApplicationEventList(applicationId: string, startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getApplicationEventList(applicationId: string, startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all Applications-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getApplicationsEventListWithHttpOperationResponse(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all Applications-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getApplicationsEventList(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getApplicationsEventList(startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getApplicationsEventList(startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a Service-related events. + * + * The response is list of ServiceEvent objects. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getServiceEventListWithHttpOperationResponse(serviceId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Service-related events. + * + * The response is list of ServiceEvent objects. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getServiceEventList(serviceId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getServiceEventList(serviceId: string, startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getServiceEventList(serviceId: string, startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all Services-related events. + * + * The response is list of ServiceEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getServicesEventListWithHttpOperationResponse(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all Services-related events. + * + * The response is list of ServiceEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getServicesEventList(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getServicesEventList(startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getServicesEventList(startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a Partition-related events. + * + * The response is list of PartitionEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getPartitionEventListWithHttpOperationResponse(partitionId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Partition-related events. + * + * The response is list of PartitionEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getPartitionEventList(partitionId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionEventList(partitionId: string, startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getPartitionEventList(partitionId: string, startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all Partitions-related events. + * + * The response is list of PartitionEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getPartitionsEventListWithHttpOperationResponse(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all Partitions-related events. + * + * The response is list of PartitionEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getPartitionsEventList(startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionsEventList(startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getPartitionsEventList(startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a Partition Replica-related events. + * + * The response is list of ReplicaEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getPartitionReplicaEventListWithHttpOperationResponse(partitionId: string, replicaId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Partition Replica-related events. + * + * The response is list of ReplicaEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + getPartitionReplicaEventList(partitionId: string, replicaId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionReplicaEventList(partitionId: string, replicaId: string, startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getPartitionReplicaEventList(partitionId: string, replicaId: string, startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all Replicas-related events for a Partition. + * + * The response is list of ReplicaEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startDataLossWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getPartitionReplicasEventListWithHttpOperationResponse(partitionId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary This API will induce data loss for the specified partition. It will - * trigger a call to the OnDataLossAsync API of the partition. - * - * This API will induce data loss for the specified partition. It will trigger - * a call to the OnDataLoss API of the partition. - * Actual data loss will depend on the specified DataLossMode - * PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is - * triggered for the partition but actual data loss depends on the presence of - * in-flight replication. - * FullDataLoss - All replicas are removed hence all data is lost and - * OnDataLoss is triggered. - * - * This API should only be called with a stateful service as the target. - * - * Calling this API with a system service as the target is not advised. - * - * Note: Once this API has been called, it cannot be reversed. Calling - * CancelOperation will only stop execution and clean up internal system state. - * It will not restore data if the command has progressed far enough to cause - * data loss. - * - * Call the GetDataLossProgress API with the same OperationId to return - * information on the operation started with this API. + * @summary Gets all Replicas-related events for a Partition. * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * The response is list of ReplicaEvent objects. * * @param {uuid} partitionId The identity of the partition. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} dataLossMode This enum is passed to the StartDataLoss API to - * indicate what type of data loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - PartialDataLoss - PartialDataLoss option will cause a quorum of replicas - * to go down, triggering an OnDataLoss event in the system for the given - * partition. - * - FullDataLoss - FullDataLoss option will drop all the replicas which means - * that all the data will be lost. - * . Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17694,7 +25537,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17702,81 +25545,55 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - startDataLoss(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - startDataLoss(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, callback: ServiceCallback): void; - startDataLoss(serviceId: string, partitionId: string, operationId: string, dataLossMode: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getPartitionReplicasEventList(partitionId: string, startTimeUtc: string, endTimeUtc: string, options?: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getPartitionReplicasEventList(partitionId: string, startTimeUtc: string, endTimeUtc: string, callback: ServiceCallback): void; + getPartitionReplicasEventList(partitionId: string, startTimeUtc: string, endTimeUtc: string, options: { timeout? : number, eventsTypesFilter? : string, excludeAnalysisEvents? : boolean, skipCorrelationLookup? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the progress of a partition data loss operation started using - * the StartDataLoss API. - * - * Gets the progress of a data loss operation started with StartDataLoss, using - * the OperationId. + * @summary Gets all correlated events for a given event. * + * The response is list of FabricEvents. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} eventInstanceId The EventInstanceId. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getDataLossProgressWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getCorrelatedEventListWithHttpOperationResponse(eventInstanceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the progress of a partition data loss operation started using - * the StartDataLoss API. - * - * Gets the progress of a data loss operation started with StartDataLoss, using - * the OperationId. - * + * @summary Gets all correlated events for a given event. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. + * The response is list of FabricEvents. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} eventInstanceId The EventInstanceId. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17788,7 +25605,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {PartitionDataLossProgress} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17796,63 +25613,55 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PartitionDataLossProgress} [result] - The deserialized result object if an error did not occur. - * See {@link PartitionDataLossProgress} for more - * information. + * {Array} [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. */ - getDataLossProgress(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getDataLossProgress(serviceId: string, partitionId: string, operationId: string, callback: ServiceCallback): void; - getDataLossProgress(serviceId: string, partitionId: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCorrelatedEventList(eventInstanceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getCorrelatedEventList(eventInstanceId: string, callback: ServiceCallback): void; + getCorrelatedEventList(eventInstanceId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Induces quorum loss for a given stateful service partition. + * @summary Creates or updates an application resource. * - * Induces quorum loss for a given stateful service partition. This API is - * useful for a temporary quorum loss situation on your service. + * Creates an application with the specified name and description. If an + * application with the same name already exists, then its description are + * updated to the one indicated in this request. * - * Call the GetQuorumLossProgress API with the same OperationId to return - * information on the operation started with this API. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * This can only be called on stateful persisted (HasPersistedState==true) - * services. Do not use this API on stateless services or stateful in-memory - * only services. + * @param {object} applicationResourceDescription Description for creating an + * application resource. * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {string} [applicationResourceDescription.debugParams] Internal use. * - * @param {uuid} partitionId The identity of the partition. + * @param {array} [applicationResourceDescription.services] describes the + * services in the application. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {object} [applicationResourceDescription.diagnostics] Describes the + * diagnostics definition and usage for an application resource. * - * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss - * API to indicate what type of quorum loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - QuorumReplicas - Partial Quorum loss mode : Minimum number of replicas for - * a partition will be down that will cause a quorum loss. - * - AllReplicas- Full Quorum loss mode : All replicas for a partition will be - * down that will cause a quorum loss. - * . Possible values include: 'Invalid', 'QuorumReplicas', 'AllReplicas' + * @param {array} [applicationResourceDescription.diagnostics.sinks] List of + * supported sinks that can be referenced. * - * @param {number} quorumLossDuration The amount of time for which the - * partition will be kept in quorum loss. This must be specified in seconds. + * @param {boolean} [applicationResourceDescription.diagnostics.enabled] Status + * of whether or not sinks are enabled. * - * @param {object} [options] Optional Parameters. + * @param {array} [applicationResourceDescription.diagnostics.defaultSinkRefs] + * The sinks to be used if diagnostics is enabled. Sink choices can be + * overridden at the service and code package level. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} applicationResourceDescription.name Application resource + * name. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17863,52 +25672,46 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - startQuorumLossWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + createApplicationResourceWithHttpOperationResponse(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Induces quorum loss for a given stateful service partition. + * @summary Creates or updates an application resource. * - * Induces quorum loss for a given stateful service partition. This API is - * useful for a temporary quorum loss situation on your service. + * Creates an application with the specified name and description. If an + * application with the same name already exists, then its description are + * updated to the one indicated in this request. * - * Call the GetQuorumLossProgress API with the same OperationId to return - * information on the operation started with this API. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * This can only be called on stateful persisted (HasPersistedState==true) - * services. Do not use this API on stateless services or stateful in-memory - * only services. + * @param {object} applicationResourceDescription Description for creating an + * application resource. * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {string} [applicationResourceDescription.debugParams] Internal use. * - * @param {uuid} partitionId The identity of the partition. + * @param {array} [applicationResourceDescription.services] describes the + * services in the application. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {object} [applicationResourceDescription.diagnostics] Describes the + * diagnostics definition and usage for an application resource. * - * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss - * API to indicate what type of quorum loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - QuorumReplicas - Partial Quorum loss mode : Minimum number of replicas for - * a partition will be down that will cause a quorum loss. - * - AllReplicas- Full Quorum loss mode : All replicas for a partition will be - * down that will cause a quorum loss. - * . Possible values include: 'Invalid', 'QuorumReplicas', 'AllReplicas' + * @param {array} [applicationResourceDescription.diagnostics.sinks] List of + * supported sinks that can be referenced. * - * @param {number} quorumLossDuration The amount of time for which the - * partition will be kept in quorum loss. This must be specified in seconds. + * @param {boolean} [applicationResourceDescription.diagnostics.enabled] Status + * of whether or not sinks are enabled. * - * @param {object} [options] Optional Parameters. + * @param {array} [applicationResourceDescription.diagnostics.defaultSinkRefs] + * The sinks to be used if diagnostics is enabled. Sink choices can be + * overridden at the service and code package level. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} applicationResourceDescription.name Application resource + * name. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17934,76 +25737,44 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - startQuorumLoss(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - startQuorumLoss(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, callback: ServiceCallback): void; - startQuorumLoss(serviceId: string, partitionId: string, operationId: string, quorumLossMode: string, quorumLossDuration: number, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createApplicationResource(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createApplicationResource(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, callback: ServiceCallback): void; + createApplicationResource(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the progress of a quorum loss operation on a partition started - * using the StartQuorumLoss API. - * - * Gets the progress of a quorum loss operation started with StartQuorumLoss, - * using the provided OperationId. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @summary Gets the application with the given name. * - * @param {uuid} partitionId The identity of the partition. + * Gets the application with the given name. This includes the information + * about the application's services and other runtime information. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getQuorumLossProgressWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getApplicationResourceWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the progress of a quorum loss operation on a partition started - * using the StartQuorumLoss API. - * - * Gets the progress of a quorum loss operation started with StartQuorumLoss, - * using the provided OperationId. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @summary Gets the application with the given name. * - * @param {uuid} partitionId The identity of the partition. + * Gets the application with the given name. This includes the information + * about the application's services and other runtime information. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18014,7 +25785,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {PartitionQuorumLossProgress} - The deserialized result object. + * @resolve {ApplicationResourceDescription} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18022,110 +25793,180 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PartitionQuorumLossProgress} [result] - The deserialized result object if an error did not occur. - * See {@link PartitionQuorumLossProgress} for more + * {ApplicationResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationResourceDescription} 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. */ - getQuorumLossProgress(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getQuorumLossProgress(serviceId: string, partitionId: string, operationId: string, callback: ServiceCallback): void; - getQuorumLossProgress(serviceId: string, partitionId: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getApplicationResource(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getApplicationResource(applicationResourceName: string, callback: ServiceCallback): void; + getApplicationResource(applicationResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary This API will restart some or all replicas or instances of the - * specified partition. + * @summary Deletes the specified application. * - * This API is useful for testing failover. + * Deletes the application identified by the name. * - * If used to target a stateless service partition, RestartPartitionMode must - * be AllReplicasOrInstances. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * Call the GetPartitionRestartProgress API using the same OperationId to get - * the progress. + * @param {object} [options] Optional Parameters. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @returns {Promise} A promise is returned * - * @param {uuid} partitionId The identity of the partition. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @reject {Error|ServiceError} - The error object. + */ + deleteApplicationResourceWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the specified application. * - * @param {string} restartPartitionMode - Invalid - Reserved. Do not pass into - * API. - * - AllReplicasOrInstances - All replicas or instances in the partition are - * restarted at once. - * - OnlyActiveSecondaries - Only the secondary replicas are restarted. - * . Possible values include: 'Invalid', 'AllReplicasOrInstances', - * 'OnlyActiveSecondaries' + * Deletes the application identified by the name. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @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. + */ + deleteApplicationResource(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteApplicationResource(applicationResourceName: string, callback: ServiceCallback): void; + deleteApplicationResource(applicationResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all the services in the application resource. + * + * The operation returns the service descriptions of all the services in the + * application resource. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startPartitionRestartWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getServicesWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary This API will restart some or all replicas or instances of the - * specified partition. + * @summary Gets all the services in the application resource. + * + * The operation returns the service descriptions of all the services in the + * application resource. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PagedServiceResourceDescriptionList} - 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. + * + * {PagedServiceResourceDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedServiceResourceDescriptionList} 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. + */ + getServices(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getServices(applicationResourceName: string, callback: ServiceCallback): void; + getServices(applicationResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the description of the specified service in an application + * resource. + * + * Gets the description of the service resource. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {string} serviceResourceName Service Fabric service resource name. * - * This API is useful for testing failover. + * @param {object} [options] Optional Parameters. * - * If used to target a stateless service partition, RestartPartitionMode must - * be AllReplicasOrInstances. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Call the GetPartitionRestartProgress API using the same OperationId to get - * the progress. + * @returns {Promise} A promise is returned * + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @reject {Error|ServiceError} - The error object. + */ + getServiceWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the description of the specified service in an application + * resource. * - * @param {uuid} partitionId The identity of the partition. + * Gets the description of the service resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {string} restartPartitionMode - Invalid - Reserved. Do not pass into - * API. - * - AllReplicasOrInstances - All replicas or instances in the partition are - * restarted at once. - * - OnlyActiveSecondaries - Only the secondary replicas are restarted. - * . Possible values include: 'Invalid', 'AllReplicasOrInstances', - * 'OnlyActiveSecondaries' + * @param {string} serviceResourceName Service Fabric service resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18136,7 +25977,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceResourceDescription} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18144,82 +25985,58 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServiceResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceDescription} 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. */ - startPartitionRestart(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - startPartitionRestart(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, callback: ServiceCallback): void; - startPartitionRestart(serviceId: string, partitionId: string, operationId: string, restartPartitionMode: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getService(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getService(applicationResourceName: string, serviceResourceName: string, callback: ServiceCallback): void; + getService(applicationResourceName: string, serviceResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the progress of a PartitionRestart operation started using - * StartPartitionRestart. - * - * Gets the progress of a PartitionRestart started with StartPartitionRestart - * using the provided OperationId. + * @summary Gets replicas of a given service in an applciation resource. * + * Gets the information about all replicas of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} serviceResourceName Service Fabric service resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getPartitionRestartProgressWithHttpOperationResponse(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getReplicasWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the progress of a PartitionRestart operation started using - * StartPartitionRestart. - * - * Gets the progress of a PartitionRestart started with StartPartitionRestart - * using the provided OperationId. + * @summary Gets replicas of a given service in an applciation resource. * + * Gets the information about all replicas of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} serviceResourceName Service Fabric service resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18230,7 +26047,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {PartitionRestartProgress} - The deserialized result object. + * @resolve {PagedServiceResourceReplicaDescriptionList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18238,110 +26055,64 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PartitionRestartProgress} [result] - The deserialized result object if an error did not occur. - * See {@link PartitionRestartProgress} for more - * information. + * {PagedServiceResourceReplicaDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedServiceResourceReplicaDescriptionList} + * 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. */ - getPartitionRestartProgress(serviceId: string, partitionId: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getPartitionRestartProgress(serviceId: string, partitionId: string, operationId: string, callback: ServiceCallback): void; - getPartitionRestartProgress(serviceId: string, partitionId: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getReplicas(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getReplicas(applicationResourceName: string, serviceResourceName: string, callback: ServiceCallback): void; + getReplicas(applicationResourceName: string, serviceResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Starts or stops a cluster node. - * - * Starts or stops a cluster node. A cluster node is a process, not the OS - * instance itself. To start a node, pass in "Start" for the - * NodeTransitionType parameter. - * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This - * API starts the operation - when the API returns the node may not have - * finished transitioning yet. - * Call GetNodeTransitionProgress with the same OperationId to get the progress - * of the operation. - * - * - * @param {string} nodeName The name of the node. + * @summary Gets a specific replica of a given service in an application + * resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * Gets the information about the specified replica of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {string} nodeTransitionType Indicates the type of transition to - * perform. NodeTransitionType.Start will start a stopped node. - * NodeTransitionType.Stop will stop a node that is up. - * - Invalid - Reserved. Do not pass into API. - * - Start - Transition a stopped node to up. - * - Stop - Transition an up node to stopped. - * . Possible values include: 'Invalid', 'Start', 'Stop' + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {string} nodeInstanceId The node instance ID of the target node. - * This can be determined through GetNodeInfo API. + * @param {string} serviceResourceName Service Fabric service resource name. * - * @param {number} stopDurationInSeconds The duration, in seconds, to keep the - * node stopped. The minimum value is 600, the maximum is 14400. After this - * time expires, the node will automatically come back up. + * @param {string} replicaName Service Fabric replica name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startNodeTransitionWithHttpOperationResponse(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getReplicaWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, replicaName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Starts or stops a cluster node. - * - * Starts or stops a cluster node. A cluster node is a process, not the OS - * instance itself. To start a node, pass in "Start" for the - * NodeTransitionType parameter. - * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This - * API starts the operation - when the API returns the node may not have - * finished transitioning yet. - * Call GetNodeTransitionProgress with the same OperationId to get the progress - * of the operation. - * - * - * @param {string} nodeName The name of the node. + * @summary Gets a specific replica of a given service in an application + * resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * Gets the information about the specified replica of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {string} nodeTransitionType Indicates the type of transition to - * perform. NodeTransitionType.Start will start a stopped node. - * NodeTransitionType.Stop will stop a node that is up. - * - Invalid - Reserved. Do not pass into API. - * - Start - Transition a stopped node to up. - * - Stop - Transition an up node to stopped. - * . Possible values include: 'Invalid', 'Start', 'Stop' + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {string} nodeInstanceId The node instance ID of the target node. - * This can be determined through GetNodeInfo API. + * @param {string} serviceResourceName Service Fabric service resource name. * - * @param {number} stopDurationInSeconds The duration, in seconds, to keep the - * node stopped. The minimum value is 600, the maximum is 14400. After this - * time expires, the node will automatically come back up. + * @param {string} replicaName Service Fabric replica name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18352,7 +26123,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceResourceReplicaDescription} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18360,67 +26131,91 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServiceResourceReplicaDescription} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceReplicaDescription} 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. */ - startNodeTransition(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - startNodeTransition(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, callback: ServiceCallback): void; - startNodeTransition(nodeName: string, operationId: string, nodeTransitionType: string, nodeInstanceId: string, stopDurationInSeconds: number, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getReplica(applicationResourceName: string, serviceResourceName: string, replicaName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getReplica(applicationResourceName: string, serviceResourceName: string, replicaName: string, callback: ServiceCallback): void; + getReplica(applicationResourceName: string, serviceResourceName: string, replicaName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the progress of an operation started using - * StartNodeTransition. + * @summary Creates or updates a volume resource. * - * Gets the progress of an operation started with StartNodeTransition using the - * provided OperationId. + * Creates a volume resource with the specified name and description. If a + * volume with the same name already exists, then its description is updated to + * the one indicated in this request. * + * @param {string} volumeResourceName Service Fabric volume resource name. * - * @param {string} nodeName The name of the node. + * @param {object} volumeResourceDescription Description for creating a volume + * resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} [volumeResourceDescription.description] User readable + * description of the volume. * - * @param {object} [options] Optional Parameters. + * @param {object} [volumeResourceDescription.azureFileParameters] This type + * describes a volume provided by an Azure Files file share. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} volumeResourceDescription.azureFileParameters.accountName + * Name of the Azure storage account for the File Share. + * + * @param {string} [volumeResourceDescription.azureFileParameters.accountKey] + * Access key of the Azure storage account for the File Share. + * + * @param {string} volumeResourceDescription.azureFileParameters.shareName Name + * of the Azure Files file share that provides storage for the volume. + * + * @param {string} volumeResourceDescription.name Volume resource name. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getNodeTransitionProgressWithHttpOperationResponse(nodeName: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + createVolumeResourceWithHttpOperationResponse(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the progress of an operation started using - * StartNodeTransition. + * @summary Creates or updates a volume resource. * - * Gets the progress of an operation started with StartNodeTransition using the - * provided OperationId. + * Creates a volume resource with the specified name and description. If a + * volume with the same name already exists, then its description is updated to + * the one indicated in this request. * + * @param {string} volumeResourceName Service Fabric volume resource name. * - * @param {string} nodeName The name of the node. + * @param {object} volumeResourceDescription Description for creating a volume + * resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} [volumeResourceDescription.description] User readable + * description of the volume. * - * @param {object} [options] Optional Parameters. + * @param {object} [volumeResourceDescription.azureFileParameters] This type + * describes a volume provided by an Azure Files file share. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} volumeResourceDescription.azureFileParameters.accountName + * Name of the Azure storage account for the File Share. + * + * @param {string} [volumeResourceDescription.azureFileParameters.accountKey] + * Access key of the Azure storage account for the File Share. + * + * @param {string} volumeResourceDescription.azureFileParameters.shareName Name + * of the Azure Files file share that provides storage for the volume. + * + * @param {string} volumeResourceDescription.name Volume resource name. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18432,7 +26227,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {NodeTransitionProgress} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18440,96 +26235,48 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {NodeTransitionProgress} [result] - The deserialized result object if an error did not occur. - * See {@link NodeTransitionProgress} 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. */ - getNodeTransitionProgress(nodeName: string, operationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getNodeTransitionProgress(nodeName: string, operationId: string, callback: ServiceCallback): void; - getNodeTransitionProgress(nodeName: string, operationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createVolumeResource(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createVolumeResource(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, callback: ServiceCallback): void; + createVolumeResource(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets a list of user-induced fault operations filtered by provided - * input. - * - * Gets the a list of user-induced fault operations filtered by provided input. - * - * @param {number} typeFilter Used to filter on OperationType for user-induced - * operations. - * 65535 - select all - * 1 - select PartitionDataLoss. - * 2 - select PartitionQuorumLoss. - * 4 - select PartitionRestart. - * 8 - select NodeTransition. - * + * @summary Gets the volume resource. * - * @param {number} stateFilter Used to filter on OperationState's for - * user-induced operations. - * 65535 - select All - * 1 - select Running - * 2 - select RollingBack - * 8 - select Completed - * 16 - select Faulted - * 32 - select Cancelled - * 64 - select ForceCancelled + * Gets the information about the volume resource with a given name. This + * information includes the volume description and other runtime information. * + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getFaultOperationListWithHttpOperationResponse(typeFilter: number, stateFilter: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getVolumeResourceWithHttpOperationResponse(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets a list of user-induced fault operations filtered by provided - * input. - * - * Gets the a list of user-induced fault operations filtered by provided input. - * - * @param {number} typeFilter Used to filter on OperationType for user-induced - * operations. - * 65535 - select all - * 1 - select PartitionDataLoss. - * 2 - select PartitionQuorumLoss. - * 4 - select PartitionRestart. - * 8 - select NodeTransition. - * + * @summary Gets the volume resource. * - * @param {number} stateFilter Used to filter on OperationState's for - * user-induced operations. - * 65535 - select All - * 1 - select Running - * 2 - select RollingBack - * 8 - select Completed - * 16 - select Faulted - * 32 - select Cancelled - * 64 - select ForceCancelled + * Gets the information about the volume resource with a given name. This + * information includes the volume description and other runtime information. * + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18540,7 +26287,7 @@ declare class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {VolumeResourceDescription} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18548,62 +26295,28 @@ declare class ServiceFabricClient extends ServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {VolumeResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link VolumeResourceDescription} 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. */ - getFaultOperationList(typeFilter: number, stateFilter: number, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getFaultOperationList(typeFilter: number, stateFilter: number, callback: ServiceCallback): void; - getFaultOperationList(typeFilter: number, stateFilter: number, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getVolumeResource(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVolumeResource(volumeResourceName: string, callback: ServiceCallback): void; + getVolumeResource(volumeResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Cancels a user-induced fault operation. - * - * The following is a list of APIs that start fault operations that may be - * cancelled using CancelOperation - - * - StartDataLoss - * - StartQuorumLoss - * - StartPartitionRestart - * - StartNodeTransition - * - * If force is false, then the specified user-induced operation will be - * gracefully stopped and cleaned up. If force is true, the command will be - * aborted, and some internal state - * may be left behind. Specifying force as true should be used with care. - * Calling this API with force set to true is not allowed until this API has - * already - * been called on the same test command with force set to false first, or - * unless the test command already has an OperationState of - * OperationState.RollingBack. - * Clarification: OperationState.RollingBack means that the system will/is be - * cleaning up internal system state caused by executing the command. It will - * not restore data if the - * test command was to cause data loss. For example, if you call StartDataLoss - * then call this API, the system will only clean up internal state from - * running the command. - * It will not restore the target partition's data, if the command progressed - * far enough to cause data loss. - * - * Important note: if this API is invoked with force==true, internal state may - * be left behind. + * @summary Deletes the volume resource. * + * Deletes the volume identified by the name. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API - * - * @param {boolean} force Indicates whether to gracefully rollback and clean up - * internal system state modified by executing the user-induced operation. + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18613,53 +26326,17 @@ declare class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - cancelOperationWithHttpOperationResponse(operationId: string, force: boolean, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteVolumeResourceWithHttpOperationResponse(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Cancels a user-induced fault operation. - * - * The following is a list of APIs that start fault operations that may be - * cancelled using CancelOperation - - * - StartDataLoss - * - StartQuorumLoss - * - StartPartitionRestart - * - StartNodeTransition - * - * If force is false, then the specified user-induced operation will be - * gracefully stopped and cleaned up. If force is true, the command will be - * aborted, and some internal state - * may be left behind. Specifying force as true should be used with care. - * Calling this API with force set to true is not allowed until this API has - * already - * been called on the same test command with force set to false first, or - * unless the test command already has an OperationState of - * OperationState.RollingBack. - * Clarification: OperationState.RollingBack means that the system will/is be - * cleaning up internal system state caused by executing the command. It will - * not restore data if the - * test command was to cause data loss. For example, if you call StartDataLoss - * then call this API, the system will only clean up internal state from - * running the command. - * It will not restore the target partition's data, if the command progressed - * far enough to cause data loss. - * - * Important note: if this API is invoked with force==true, internal state may - * be left behind. + * @summary Deletes the volume resource. * + * Deletes the volume identified by the name. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API - * - * @param {boolean} force Indicates whether to gracefully rollback and clean up - * internal system state modified by executing the user-induced operation. + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18684,9 +26361,9 @@ declare class ServiceFabricClient extends ServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancelOperation(operationId: string, force: boolean, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - cancelOperation(operationId: string, force: boolean, callback: ServiceCallback): void; - cancelOperation(operationId: string, force: boolean, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteVolumeResource(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteVolumeResource(volumeResourceName: string, callback: ServiceCallback): void; + deleteVolumeResource(volumeResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -export = ServiceFabricClient; +export { ServiceFabricClient, models as ServiceFabricModels }; diff --git a/lib/services/serviceFabric/lib/serviceFabricClient.js b/lib/services/serviceFabric/lib/serviceFabricClient.js index 3b466440f2..f1e08a0de1 100644 --- a/lib/services/serviceFabric/lib/serviceFabricClient.js +++ b/lib/services/serviceFabric/lib/serviceFabricClient.js @@ -26,25 +26,24 @@ const models = require('./models'); * * Get the Service Fabric cluster manifest. The cluster manifest contains * properties of the cluster that include different node types on the cluster, - * security configurations, fault and upgrade domain topologies etc. + * security configurations, fault, and upgrade domain topologies, etc. * * These properties are specified as part of the ClusterConfig.JSON file while - * deploying a stand alone cluster. However, most of the information in the + * deploying a stand-alone cluster. However, most of the information in the * cluster manifest * is generated internally by service fabric during cluster deployment in other - * deployment scenarios (for e.g when using azuer portal). + * deployment scenarios (e.g. when using Azure portal). * * The contents of the cluster manifest are for informational purposes only and * users are not expected to take a dependency on the format of the file * contents or its interpretation. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -180,14 +179,12 @@ function _getClusterManifest(options, callback) { /** * @summary Gets the health of a Service Fabric cluster. * - * Gets the health of a Service Fabric cluster. * Use EventsHealthStateFilter to filter the collection of health events * reported on the cluster based on the health state. * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to * filter the collection of nodes and applications returned based on their * aggregated health state. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.nodesHealthStateFilter] Allows filtering of the @@ -197,7 +194,7 @@ function _getClusterManifest(options, callback) { * following health states. Only nodes that match the filter are returned. All * nodes are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of nodes with * HealthState value of OK (2) and Warning (4) are returned. @@ -213,7 +210,6 @@ function _getClusterManifest(options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.applicationsHealthStateFilter] Allows filtering of * the application health state objects returned in the result of cluster * health @@ -224,7 +220,7 @@ function _getClusterManifest(options, callback) { * the filter are returned. * All applications are used to evaluate the aggregated health state. If not * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of applications * with HealthState value of OK (2) and Warning (4) are returned. @@ -240,17 +236,16 @@ function _getClusterManifest(options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.eventsHealthStateFilter] Allows filtering the * collection of HealthEvent objects returned based on health state. * The possible values for this parameter include integer value of one of the * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -264,14 +259,12 @@ function _getClusterManifest(options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {boolean} [options.includeSystemApplicationHealthStatistics] * Indicates whether the health statistics should include the fabric:/System * application health statistics. False by default. @@ -283,11 +276,10 @@ function _getClusterManifest(options, callback) { * The health statistics must be included in the query result for this * parameter to be applied. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -459,7 +451,6 @@ function _getClusterHealth(options, callback) { * @summary Gets the health of a Service Fabric cluster using the specified * policy. * - * Gets the health of a Service Fabric cluster. * Use EventsHealthStateFilter to filter the collection of health events * reported on the cluster based on the health state. * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to @@ -468,7 +459,6 @@ function _getClusterHealth(options, callback) { * Use ClusterHealthPolicies to override the health policies used to evaluate * the health. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.nodesHealthStateFilter] Allows filtering of the @@ -478,7 +468,7 @@ function _getClusterHealth(options, callback) { * following health states. Only nodes that match the filter are returned. All * nodes are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of nodes with * HealthState value of OK (2) and Warning (4) are returned. @@ -494,7 +484,6 @@ function _getClusterHealth(options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.applicationsHealthStateFilter] Allows filtering of * the application health state objects returned in the result of cluster * health @@ -505,7 +494,7 @@ function _getClusterHealth(options, callback) { * the filter are returned. * All applications are used to evaluate the aggregated health state. If not * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a + * The state values are flag-based enumeration, so the value could be a * combination of these values obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of applications * with HealthState value of OK (2) and Warning (4) are returned. @@ -521,17 +510,16 @@ function _getClusterHealth(options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.eventsHealthStateFilter] Allows filtering the * collection of HealthEvent objects returned based on health state. * The possible values for this parameter include integer value of one of the * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -545,14 +533,12 @@ function _getClusterHealth(options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {boolean} [options.includeSystemApplicationHealthStatistics] * Indicates whether the health statistics should include the fabric:/System * application health statistics. False by default. @@ -564,7 +550,6 @@ function _getClusterHealth(options, callback) { * The health statistics must be included in the query result for this * parameter to be applied. * - * * @param {object} [options.clusterHealthPolicies] Describes the health * policies used to evaluate the cluster health. * If not present, the health evaluation uses the cluster health policy defined @@ -576,10 +561,20 @@ function _getClusterHealth(options, callback) { * an application, the specified application health policy * is used to evaluate the application health. * - * * @param {array} [options.clusterHealthPolicies.applicationHealthPolicyMap] - * - * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] + * Defines a map that contains specific application health policies for + * different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * + * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [options.clusterHealthPolicies.clusterHealthPolicy.considerWarningAsError] @@ -602,7 +597,6 @@ function _getClusterHealth(options, callback) { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthPolicies.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -620,14 +614,35 @@ function _getClusterHealth(options, callback) { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [options.clusterHealthPolicies.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -820,13 +835,12 @@ function _getClusterHealthUsingPolicy(options, callback) { * entities, use the POST URI and specify the cluster health chunk query * description. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -976,7 +990,6 @@ function _getClusterHealthChunk(options, callback) { * only services that are in Error or Warning, and all partitions and replicas * for one of these services. * - * * @param {object} [options] Optional Parameters. * * @param {object} [options.clusterHealthChunkQueryDescription] Describes the @@ -1001,7 +1014,6 @@ function _getClusterHealthChunk(options, callback) { * only services that are in Error or Warning, and all partitions and replicas * for one of these services. * - * * @param {array} [options.clusterHealthChunkQueryDescription.nodeFilters] * Defines a list of filters that specify which nodes to be included in the * returned cluster health chunk. @@ -1013,7 +1025,6 @@ function _getClusterHealthChunk(options, callback) { * Error and another filter to always include a node identified by its * NodeName. * - * * @param {array} * [options.clusterHealthChunkQueryDescription.applicationFilters] Defines a * list of filters that specify which applications to be included in the @@ -1026,9 +1037,10 @@ function _getClusterHealthChunk(options, callback) { * state Error and another filter to always include applications of a specified * application type. * - * * @param {object} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] Defines a + * health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.considerWarningAsError] @@ -1051,7 +1063,6 @@ function _getClusterHealthChunk(options, callback) { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -1069,20 +1080,45 @@ function _getClusterHealthChunk(options, callback) { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {object} * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1246,14 +1282,12 @@ function _getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, callback) * GetClusterHealth and check that the report appears in the HealthEvents * section. * - * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -1270,12 +1304,13 @@ function _getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, callback) * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -1287,7 +1322,6 @@ function _getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, callback) * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -1299,7 +1333,6 @@ function _getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, callback) * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -1307,10 +1340,9 @@ function _getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, callback) * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -1320,33 +1352,31 @@ function _getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, callback) * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1498,9 +1528,9 @@ function _reportClusterHealth(healthInformation, options, callback) { * @param {string} [options.codeVersion] The product version of Service Fabric. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1667,9 +1697,9 @@ function _getProvisionedFabricCodeVersionInfoList(options, callback) { * Fabric. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1826,14 +1856,14 @@ function _getProvisionedFabricConfigVersionInfoList(options, callback) { * @summary Gets the progress of the current cluster upgrade. * * Gets the current progress of the ongoing cluster upgrade. If no upgrade is - * currently in progress, gets the last state of the previous cluster upgrade. + * currently in progress, get the last state of the previous cluster upgrade. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1970,11 +2000,9 @@ function _getClusterUpgradeProgress(options, callback) { /** * @summary Get the Service Fabric standalone cluster configuration. * - * Get the Service Fabric standalone cluster configuration. The cluster - * configuration contains properties of the cluster that include different node - * types on the cluster, - * security configurations, fault and upgrade domain topologies etc. - * + * The cluster configuration contains properties of the cluster that include + * different node types on the cluster, + * security configurations, fault, and upgrade domain topologies, etc. * * @param {string} configurationApiVersion The API version of the Standalone * cluster json configuration. @@ -1982,9 +2010,9 @@ function _getClusterUpgradeProgress(options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2125,16 +2153,15 @@ function _getClusterConfiguration(configurationApiVersion, options, callback) { * @summary Get the cluster configuration upgrade status of a Service Fabric * standalone cluster. * - * Get the cluster configuration upgrade status of a Service Fabric standalone - * cluster. - * + * Get the cluster configuration upgrade status details of a Service Fabric + * standalone cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2269,27 +2296,170 @@ function _getClusterConfigurationUpgradeStatus(options, callback) { } /** - * @summary Provision the code or configuration packages of a Service Fabric - * cluster. + * @summary Get the service state of Service Fabric Upgrade Orchestration + * Service. * - * Validate and provision the code or configuration packages of a Service - * Fabric cluster. + * Get the service state of Service Fabric Upgrade Orchestration Service. This + * API is internally used for support purposes. * - * @param {object} provisionFabricDescription Describes the parameters for - * provisioning a cluster. + * @param {object} [options] Optional Parameters. * - * @param {string} [provisionFabricDescription.codeFilePath] The cluster code - * package file path. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {string} [provisionFabricDescription.clusterManifestFilePath] The - * cluster manifest file path. + * @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 UpgradeOrchestrationServiceState} 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 _getUpgradeOrchestrationServiceState(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/GetUpgradeOrchestrationServiceState'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['UpgradeOrchestrationServiceState']().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 the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Update the service state of Service Fabric Upgrade Orchestration Service. + * This API is internally used for support purposes. + * + * @param {object} upgradeOrchestrationServiceState Service state of Service + * Fabric Upgrade Orchestration Service. + * + * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of + * Service Fabric Upgrade Orchestration Service. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2300,13 +2470,15 @@ function _getClusterConfigurationUpgradeStatus(options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link UpgradeOrchestrationServiceStateSummary} 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 _provisionCluster(provisionFabricDescription, options, callback) { +function _setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -2320,8 +2492,8 @@ function _provisionCluster(provisionFabricDescription, options, callback) { let apiVersion = '6.0'; // Validate try { - if (provisionFabricDescription === null || provisionFabricDescription === undefined) { - throw new Error('provisionFabricDescription cannot be null or undefined.'); + if (upgradeOrchestrationServiceState === null || upgradeOrchestrationServiceState === undefined) { + throw new Error('upgradeOrchestrationServiceState cannot be null or undefined.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -2342,7 +2514,7 @@ function _provisionCluster(provisionFabricDescription, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/Provision'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/SetUpgradeOrchestrationServiceState'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -2370,14 +2542,14 @@ function _provisionCluster(provisionFabricDescription, options, callback) { let requestContent = null; let requestModel = null; try { - if (provisionFabricDescription !== null && provisionFabricDescription !== undefined) { - let requestModelMapper = new client.models['ProvisionFabricDescription']().mapper(); - requestModel = client.serialize(requestModelMapper, provisionFabricDescription, 'provisionFabricDescription'); + if (upgradeOrchestrationServiceState !== null && upgradeOrchestrationServiceState !== undefined) { + let requestModelMapper = new client.models['UpgradeOrchestrationServiceState']().mapper(); + requestModel = client.serialize(requestModelMapper, upgradeOrchestrationServiceState, 'upgradeOrchestrationServiceState'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(provisionFabricDescription, null, 2)}.`); + `payload - ${JSON.stringify(upgradeOrchestrationServiceState, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -2416,32 +2588,50 @@ function _provisionCluster(provisionFabricDescription, options, callback) { // 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['UpgradeOrchestrationServiceStateSummary']().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 Unprovision the code or configuration packages of a Service Fabric + * @summary Provision the code or configuration packages of a Service Fabric * cluster. * - * Unprovision the code or configuration packages of a Service Fabric cluster. + * Validate and provision the code or configuration packages of a Service + * Fabric cluster. * - * @param {object} unprovisionFabricDescription Describes the parameters for - * unprovisioning a cluster. + * @param {object} provisionFabricDescription Describes the parameters for + * provisioning a cluster. * - * @param {string} [unprovisionFabricDescription.codeVersion] The cluster code - * package version. + * @param {string} [provisionFabricDescription.codeFilePath] The cluster code + * package file path. * - * @param {string} [unprovisionFabricDescription.configVersion] The cluster - * manifest version. + * @param {string} [provisionFabricDescription.clusterManifestFilePath] The + * cluster manifest file path. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2458,7 +2648,7 @@ function _provisionCluster(provisionFabricDescription, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _unprovisionCluster(unprovisionFabricDescription, options, callback) { +function _provisionCluster(provisionFabricDescription, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -2472,8 +2662,8 @@ function _unprovisionCluster(unprovisionFabricDescription, options, callback) { let apiVersion = '6.0'; // Validate try { - if (unprovisionFabricDescription === null || unprovisionFabricDescription === undefined) { - throw new Error('unprovisionFabricDescription cannot be null or undefined.'); + if (provisionFabricDescription === null || provisionFabricDescription === undefined) { + throw new Error('provisionFabricDescription cannot be null or undefined.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -2494,7 +2684,7 @@ function _unprovisionCluster(unprovisionFabricDescription, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/Unprovision'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/Provision'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -2522,14 +2712,14 @@ function _unprovisionCluster(unprovisionFabricDescription, options, callback) { let requestContent = null; let requestModel = null; try { - if (unprovisionFabricDescription !== null && unprovisionFabricDescription !== undefined) { - let requestModelMapper = new client.models['UnprovisionFabricDescription']().mapper(); - requestModel = client.serialize(requestModelMapper, unprovisionFabricDescription, 'unprovisionFabricDescription'); + if (provisionFabricDescription !== null && provisionFabricDescription !== undefined) { + let requestModelMapper = new client.models['ProvisionFabricDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, provisionFabricDescription, 'provisionFabricDescription'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(unprovisionFabricDescription, null, 2)}.`); + `payload - ${JSON.stringify(provisionFabricDescription, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -2574,16 +2764,26 @@ function _unprovisionCluster(unprovisionFabricDescription, options, callback) { } /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Unprovision the code or configuration packages of a Service Fabric + * cluster. * - * Rollback the upgrade of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param {object} unprovisionFabricDescription Describes the parameters for + * unprovisioning a cluster. + * + * @param {string} [unprovisionFabricDescription.codeVersion] The cluster code + * package version. + * + * @param {string} [unprovisionFabricDescription.configVersion] The cluster + * manifest version. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2600,7 +2800,7 @@ function _unprovisionCluster(unprovisionFabricDescription, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _rollbackClusterUpgrade(options, callback) { +function _unprovisionCluster(unprovisionFabricDescription, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -2614,6 +2814,9 @@ function _rollbackClusterUpgrade(options, callback) { let apiVersion = '6.0'; // Validate try { + if (unprovisionFabricDescription === null || unprovisionFabricDescription === undefined) { + throw new Error('unprovisionFabricDescription cannot be null or undefined.'); + } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -2633,7 +2836,146 @@ function _rollbackClusterUpgrade(options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/RollbackUpgrade'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/Unprovision'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (unprovisionFabricDescription !== null && unprovisionFabricDescription !== undefined) { + let requestModelMapper = new client.models['UnprovisionFabricDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, unprovisionFabricDescription, 'unprovisionFabricDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(unprovisionFabricDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Rollback the upgrade of a Service Fabric cluster. + * + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _rollbackClusterUpgrade(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/RollbackUpgrade'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -2701,7 +3043,8 @@ function _rollbackClusterUpgrade(options, callback) { /** * @summary Make the cluster upgrade move on to the next upgrade domain. * - * Make the cluster upgrade move on to the next upgrade domain. + * Make the cluster code or configuration upgrade move on to the next upgrade + * domain if appropriate. * * @param {object} resumeClusterUpgradeDescription Describes the parameters for * resuming a cluster upgrade. @@ -2712,9 +3055,9 @@ function _rollbackClusterUpgrade(options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2863,40 +3206,80 @@ function _resumeClusterUpgrade(resumeClusterUpgradeDescription, options, callbac * @param {string} [startClusterUpgradeDescription.configVersion] The cluster * configuration version. * - * @param {string} [startClusterUpgradeDescription.upgradeKind] Possible values - * include: 'Invalid', 'Rolling' + * @param {string} [startClusterUpgradeDescription.upgradeKind] The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} - * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [startClusterUpgradeDescription.forceRestart] + * @param {boolean} [startClusterUpgradeDescription.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} [startClusterUpgradeDescription.monitoringPolicy] + * @param {object} [startClusterUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [startClusterUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [startClusterUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [startClusterUpgradeDescription.clusterHealthPolicy] + * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] @@ -2919,7 +3302,6 @@ function _resumeClusterUpgrade(resumeClusterUpgradeDescription, options, callbac * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [startClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -2937,9 +3319,30 @@ function _resumeClusterUpgrade(resumeClusterUpgradeDescription, options, callbac * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [startClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, @@ -2947,6 +3350,8 @@ function _resumeClusterUpgrade(resumeClusterUpgradeDescription, options, callbac * completion of each upgrade domain. * * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. * * @param {number} * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] @@ -2968,16 +3373,20 @@ function _resumeClusterUpgrade(resumeClusterUpgradeDescription, options, callbac * tolerated limits. The default value is 15%. * * @param {object} [startClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3164,12 +3573,22 @@ function _startClusterUpgrade(startClusterUpgradeDescription, options, callback) * The maximum allowed percentage of upgrade domain delta health degradation * during the upgrade. Allowed values are integer values from zero to 100. * + * @param {object} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies] Defines + * the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3304,47 +3723,88 @@ function _startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescriptio /** * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. * - * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. * * @param {object} updateClusterUpgradeDescription Parameters for updating a * cluster upgrade. * - * @param {string} [updateClusterUpgradeDescription.upgradeKind] Possible - * values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart' + * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling', 'Rolling_ForceRestart' * * @param {object} [updateClusterUpgradeDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. * * @param {string} - * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {boolean} - * [updateClusterUpgradeDescription.updateDescription.forceRestart] + * [updateClusterUpgradeDescription.updateDescription.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 {number} * [updateClusterUpgradeDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} - * [updateClusterUpgradeDescription.updateDescription.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [updateClusterUpgradeDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [updateClusterUpgradeDescription.clusterHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. * * @param {boolean} * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] @@ -3367,7 +3827,6 @@ function _startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescriptio * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [updateClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an @@ -3385,14 +3844,39 @@ function _startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescriptio * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} - * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] + * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * enables delta health evaluation rather than absolute health evaluation after + * completion of each upgrade domain. * * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. * * @param {number} * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] @@ -3414,16 +3898,20 @@ function _startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescriptio * tolerated limits. The default value is 15%. * * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * * @param {array} * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3565,13 +4053,12 @@ function _updateClusterUpgrade(updateClusterUpgradeDescription, options, callbac * needed to set up an Azure Active Directory secured connection with a Service * Fabric cluster. * - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3707,48 +4194,37 @@ function _getAadMetadata(options, callback) { /** * @summary Gets the list of nodes in the Service Fabric cluster. * - * The Nodes endpoint returns information about the nodes in the Service Fabric - * Cluster. The respons include the name, status, id, health, uptime and other - * details about the node. + * The response includes the name, status, ID, health, uptime, and other + * details about the nodes. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {string} [options.nodeStatusFilter] Allows filtering the nodes based * on the NodeStatus. Only the nodes that are matching the specified filter * value will be returned. The filter value can be one of the following. - * - * - default - This filter value will match all of the nodes excepts the ones - * with with status as Unknown or Removed. - * - all - This filter value will match all of the nodes. - * - up - This filter value will match nodes that are Up. - * - down - This filter value will match nodes that are Down. - * - enabling - This filter value will match nodes that are in the process of - * being enabled with status as Enabling. - * - disabling - This filter value will match nodes that are in the process of - * being disabled with status as Disabling. - * - disabled - This filter value will match nodes that are Disabled. - * - unknown - This filter value will match nodes whose status is Unknown. A - * node would be in Unknown state if Service Fabric does not have authoritative - * information about that node. This can happen if the system learns about a - * node at runtime. - * - removed - This filter value will match nodes whose status is Removed. - * These are the nodes that are removed from the cluster using the - * RemoveNodeState API. - * . Possible values include: 'default', 'all', 'up', 'down', 'enabling', + * Possible values include: 'default', 'all', 'up', 'down', 'enabling', * 'disabling', 'disabled', 'unknown', 'removed' * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3778,8 +4254,9 @@ function _getNodeInfoList(options, callback) { } let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; let nodeStatusFilter = (options && options.nodeStatusFilter !== undefined) ? options.nodeStatusFilter : 'default'; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let apiVersion = '6.3'; // Validate try { if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { @@ -3788,6 +4265,15 @@ function _getNodeInfoList(options, callback) { if (nodeStatusFilter !== null && nodeStatusFilter !== undefined && typeof nodeStatusFilter.valueOf() !== 'string') { throw new Error('nodeStatusFilter must be of type string.'); } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -3816,6 +4302,9 @@ function _getNodeInfoList(options, callback) { if (nodeStatusFilter !== null && nodeStatusFilter !== undefined) { queryParameters.push('NodeStatusFilter=' + encodeURIComponent(nodeStatusFilter)); } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -3896,20 +4385,20 @@ function _getNodeInfoList(options, callback) { } /** - * @summary Gets the list of nodes in the Service Fabric cluster. + * @summary Gets the information about a specific node in the Service Fabric + * cluster. * - * Gets the information about a specific node in the Service Fabric Cluster.The - * respons include the name, status, id, health, uptime and other details about - * the node. + * The response includes the name, status, ID, health, uptime, and other + * details about the node. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4064,10 +4553,10 @@ function _getNodeInfo(nodeName, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -4081,11 +4570,10 @@ function _getNodeInfo(nodeName, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4249,10 +4737,10 @@ function _getNodeHealth(nodeName, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -4266,7 +4754,6 @@ function _getNodeHealth(nodeName, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.clusterHealthPolicy] Describes the health policies * used to evaluate the health of a cluster or node. If not present, the health * evaluation uses the health policy from cluster manifest or the default @@ -4291,7 +4778,6 @@ function _getNodeHealth(nodeName, options, callback) { * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [options.clusterHealthPolicy.maxPercentUnhealthyApplications] The maximum * allowed percentage of unhealthy applications before reporting an error. For @@ -4309,13 +4795,34 @@ function _getNodeHealth(nodeName, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} [options.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4489,16 +4996,14 @@ function _getNodeHealthUsingPolicy(nodeName, options, callback) { * To see whether the report was applied in the health store, run GetNodeHealth * and check that the report appears in the HealthEvents section. * - * * @param {string} nodeName The name of the node. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -4515,12 +5020,13 @@ function _getNodeHealthUsingPolicy(nodeName, options, callback) { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -4532,7 +5038,6 @@ function _getNodeHealthUsingPolicy(nodeName, options, callback) { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -4544,7 +5049,6 @@ function _getNodeHealthUsingPolicy(nodeName, options, callback) { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -4552,10 +5056,9 @@ function _getNodeHealthUsingPolicy(nodeName, options, callback) { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -4565,33 +5068,31 @@ function _getNodeHealthUsingPolicy(nodeName, options, callback) { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4737,16 +5238,17 @@ function _reportNodeHealth(nodeName, healthInformation, options, callback) { /** * @summary Gets the load information of a Service Fabric node. * - * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics + * that have load or capacity defined. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -4889,13 +5391,13 @@ function _getNodeLoadInfo(nodeName, options, callback) { * * Deactivate a Service Fabric cluster node with the specified deactivation * intent. Once the deactivation is in progress, the deactivation intent can be - * increased, but not decreased (for example, a node which is was deactivated - * with the Pause intent can be deactivated further with Restart, but not the - * other way around. Nodes may be reactivated using the Activate a node - * operation any time after they are deactivated. If the deactivation is not - * complete this will cancel the deactivation. A node which goes down and comes - * back up while deactivated will still need to be reactivated before services - * will be placed on that node. + * increased, but not decreased (for example, a node that is deactivated with + * the Pause intent can be deactivated further with Restart, but not the other + * way around. Nodes may be reactivated using the Activate a node operation any + * time after they are deactivated. If the deactivation is not complete, this + * will cancel the deactivation. A node that goes down and comes back up while + * deactivated will still need to be reactivated before services will be placed + * on that node. * * @param {string} nodeName The name of the node. * @@ -4904,20 +5406,14 @@ function _getNodeLoadInfo(nodeName, options, callback) { * * @param {string} [deactivationIntentDescription.deactivationIntent] Describes * the intent or reason for deactivating the node. The possible values are - * following. - * - Pause - Indicates that the node should be paused. The value is 1. - * - Restart - Indicates that the intent is for the node to be restarted after - * a short period of time. The value is 2. - * - RemoveData - Indicates the intent is for the node to remove data. The - * value is 3. - * . Possible values include: 'Pause', 'Restart', 'RemoveData' + * following. Possible values include: 'Pause', 'Restart', 'RemoveData' * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5054,10 +5550,10 @@ function _disableNode(nodeName, deactivationIntentDescription, options, callback } /** - * @summary Activate a Service Fabric cluster node which is currently + * @summary Activate a Service Fabric cluster node that is currently * deactivated. * - * Activates a Service Fabric cluster node which is currently deactivated. Once + * Activates a Service Fabric cluster node that is currently deactivated. Once * activated, the node will again become a viable target for placing new * replicas, and any deactivated replicas remaining on the node will be * reactivated. @@ -5067,9 +5563,9 @@ function _disableNode(nodeName, deactivationIntentDescription, options, callback * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5192,24 +5688,23 @@ function _enableNode(nodeName, options, callback) { * @summary Notifies Service Fabric that the persisted state on a node has been * permanently removed or lost. * - * Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. This implies that it is not possible to - * recover the persisted state of that node. This generally happens if a hard - * disk has been wiped clean, or if a hard disk crashes. The node has to be - * down for this operation to be successful. This operation lets Service Fabric - * know that the replicas on that node no longer exist, and that Service Fabric - * should stop waiting for those replicas to come back up. Do not run this - * cmdlet if the state on the node has not been removed and the node can comes - * back up with its state intact. + * This implies that it is not possible to recover the persisted state of that + * node. This generally happens if a hard disk has been wiped clean, or if a + * hard disk crashes. The node has to be down for this operation to be + * successful. This operation lets Service Fabric know that the replicas on + * that node no longer exist, and that Service Fabric should stop waiting for + * those replicas to come back up. Do not run this cmdlet if the state on the + * node has not been removed and the node can come back up with its state + * intact. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5338,21 +5833,21 @@ function _removeNodeState(nodeName, options, callback) { * @param {object} restartNodeDescription The instance of the node to be * restarted and a flag indicating the need to take dump of the fabric process. * - * @param {string} restartNodeDescription.nodeInstanceId The instance id of the - * target node. If instance id is specified the node is restarted only if it + * @param {string} restartNodeDescription.nodeInstanceId The instance ID of the + * target node. If instance ID is specified the node is restarted only if it * matches with the current instance of the node. A default value of "0" would - * match any instance id. The instance id can be obtained using get node query. + * match any instance ID. The instance ID can be obtained using get node query. * * @param {string} [restartNodeDescription.createFabricDump] Specify True to - * create a dump of the fabric node process. This is case sensitive. Possible + * create a dump of the fabric node process. This is case-sensitive. Possible * values include: 'False', 'True' * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5494,22 +5989,23 @@ function _restartNode(nodeName, restartNodeDescription, options, callback) { * Returns the information about the application types that are provisioned or * in the process of being provisioned in the Service Fabric cluster. Each * version of an application type is returned as one application type. The - * response includes the name, version, status and other details about the + * response includes the name, version, status, and other details about the * application type. This is a paged query, meaning that if not all of the * application types fit in a page, one page of results is returned as well as - * a continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * a continuation token, which can be used to get the next page. For example, + * if there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. * * @param {object} [options] Optional Parameters. * * @param {number} [options.applicationTypeDefinitionKindFilter] Used to filter - * on ApplicationTypeDefinitionKind for application type query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationTypeDefinitionKind value. The value is 0. + * on ApplicationTypeDefinitionKind which is the mechanism used to define a + * Service Fabric application type. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. * - All - Filter that matches input with any ApplicationTypeDefinitionKind * value. The value is 65535. * - ServiceFabricApplicationPackage - Filter that matches input with @@ -5518,16 +6014,15 @@ function _restartNode(nodeName, restartNodeDescription, options, callback) { * - Compose - Filter that matches input with ApplicationTypeDefinitionKind * value Compose. The value is 2. * - * * @param {boolean} [options.excludeApplicationParameters] The flag that * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -5535,13 +6030,13 @@ function _restartNode(nodeName, restartNodeDescription, options, callback) { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5570,7 +6065,7 @@ function _getApplicationTypeInfoList(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let applicationTypeDefinitionKindFilter = (options && options.applicationTypeDefinitionKindFilter !== undefined) ? options.applicationTypeDefinitionKindFilter : 65535; + let applicationTypeDefinitionKindFilter = (options && options.applicationTypeDefinitionKindFilter !== undefined) ? options.applicationTypeDefinitionKindFilter : 0; let excludeApplicationParameters = (options && options.excludeApplicationParameters !== undefined) ? options.excludeApplicationParameters : false; let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; @@ -5719,29 +6214,32 @@ function _getApplicationTypeInfoList(options, callback) { * as the parameter, and which comply with the given query parameters. All * versions of the application type matching the application type name are * returned, with each version returned as one application type. The response - * includes the name, version, status and other details about the application + * includes the name, version, status, and other details about the application * type. This is a paged query, meaning that if not all of the application * types fit in a page, one page of results is returned as well as a - * continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * continuation token, which can be used to get the next page. For example, if + * there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. * * @param {string} applicationTypeName The name of the application type. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.applicationTypeVersion] The version of the + * application type. + * * @param {boolean} [options.excludeApplicationParameters] The flag that * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.maxResults] The maximum number of results to be @@ -5749,13 +6247,13 @@ function _getApplicationTypeInfoList(options, callback) { * bound on the number of results returned. The results returned can be less * than the specified maximum results if they do not fit in the message as per * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5784,6 +6282,7 @@ function _getApplicationTypeInfoListByName(applicationTypeName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let applicationTypeVersion = (options && options.applicationTypeVersion !== undefined) ? options.applicationTypeVersion : undefined; let excludeApplicationParameters = (options && options.excludeApplicationParameters !== undefined) ? options.excludeApplicationParameters : false; let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; @@ -5794,6 +6293,9 @@ function _getApplicationTypeInfoListByName(applicationTypeName, options, callbac 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 (applicationTypeVersion !== null && applicationTypeVersion !== undefined && typeof applicationTypeVersion.valueOf() !== 'string') { + throw new Error('applicationTypeVersion must be of type string.'); + } if (excludeApplicationParameters !== null && excludeApplicationParameters !== undefined && typeof excludeApplicationParameters !== 'boolean') { throw new Error('excludeApplicationParameters must be of type boolean.'); } @@ -5832,6 +6334,9 @@ function _getApplicationTypeInfoListByName(applicationTypeName, options, callbac requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (applicationTypeVersion !== null && applicationTypeVersion !== undefined) { + queryParameters.push('ApplicationTypeVersion=' + encodeURIComponent(applicationTypeVersion)); + } if (excludeApplicationParameters !== null && excludeApplicationParameters !== undefined) { queryParameters.push('ExcludeApplicationParameters=' + encodeURIComponent(excludeApplicationParameters.toString())); } @@ -5922,24 +6427,37 @@ function _getApplicationTypeInfoListByName(applicationTypeName, options, callbac /** * @summary Provisions or registers a Service Fabric application type with the - * cluster. + * cluster using the '.sfpkg' package in the external store or using the + * application package in the image store. * - * Provisions or registers a Service Fabric application type with the cluster. - * This is required before any new applications can be instantiated. + * Provisions a Service Fabric application type with the cluster. The provision + * is required before any new applications can be instantiated. + * The provision operation can be performed either on the application package + * specified by the relativePathInImageStore, or by using the URI of the + * external '.sfpkg'. * - * @param {object} applicationTypeImageStorePath The relative path for the - * application package in the image store specified during the prior copy - * operation. + * @param {object} provisionApplicationTypeDescriptionBaseRequiredBodyParam The + * base type of provision application type description which supports either + * image store-based provision or external store-based provision. * - * @param {string} applicationTypeImageStorePath.applicationTypeBuildPath The - * relative image store path to the application package. + * @param {boolean} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.async Indicates + * whether or not provisioning should occur asynchronously. When set to true, + * the provision operation returns when the request is accepted by the system, + * and the provision operation continues without any timeout limit. The default + * value is false. For large application packages, we recommend setting the + * value to true. + * + * @param {string} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic + * Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5956,7 +6474,7 @@ function _getApplicationTypeInfoListByName(applicationTypeName, options, callbac * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _provisionApplicationType(applicationTypeImageStorePath, options, callback) { +function _provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -5967,11 +6485,11 @@ function _provisionApplicationType(applicationTypeImageStorePath, options, callb throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let apiVersion = '6.2'; // Validate try { - if (applicationTypeImageStorePath === null || applicationTypeImageStorePath === undefined) { - throw new Error('applicationTypeImageStorePath cannot be null or undefined.'); + if (provisionApplicationTypeDescriptionBaseRequiredBodyParam === null || provisionApplicationTypeDescriptionBaseRequiredBodyParam === undefined) { + throw new Error('provisionApplicationTypeDescriptionBaseRequiredBodyParam cannot be null or undefined.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -6020,14 +6538,14 @@ function _provisionApplicationType(applicationTypeImageStorePath, options, callb let requestContent = null; let requestModel = null; try { - if (applicationTypeImageStorePath !== null && applicationTypeImageStorePath !== undefined) { - let requestModelMapper = new client.models['ApplicationTypeImageStorePath']().mapper(); - requestModel = client.serialize(requestModelMapper, applicationTypeImageStorePath, 'applicationTypeImageStorePath'); + if (provisionApplicationTypeDescriptionBaseRequiredBodyParam !== null && provisionApplicationTypeDescriptionBaseRequiredBodyParam !== undefined) { + let requestModelMapper = new client.models['ProvisionApplicationTypeDescriptionBase']().mapper(); + requestModel = client.serialize(requestModelMapper, provisionApplicationTypeDescriptionBaseRequiredBodyParam, 'provisionApplicationTypeDescriptionBaseRequiredBodyParam'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(applicationTypeImageStorePath, null, 2)}.`); + `payload - ${JSON.stringify(provisionApplicationTypeDescriptionBaseRequiredBodyParam, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -6037,7 +6555,7 @@ function _provisionApplicationType(applicationTypeImageStorePath, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -6075,25 +6593,34 @@ function _provisionApplicationType(applicationTypeImageStorePath, options, callb * @summary Removes or unregisters a Service Fabric application type from the * cluster. * - * Removes or unregisters a Service Fabric application type from the cluster. - * This operation can only be performed if all application instance of the - * application type has been deleted. Once the application type is - * unregistered, no new application instance can be created for this particular - * application type. + * This operation can only be performed if all application instances of the + * application type have been deleted. Once the application type is + * unregistered, no new application instances can be created for this + * particular application type. * * @param {string} applicationTypeName The name of the application type. * - * @param {object} applicationTypeImageStoreVersion The version of the - * application type in the image store. + * @param {object} unprovisionApplicationTypeDescriptionInfo The relative path + * for the application package in the image store specified during the prior + * copy operation. + * + * @param {string} + * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version + * of the application type as defined in the application manifest. * - * @param {string} applicationTypeImageStoreVersion.applicationTypeVersion + * @param {boolean} [unprovisionApplicationTypeDescriptionInfo.async] The flag + * indicating whether or not unprovision should occur asynchronously. When set + * to true, the unprovision operation returns when the request is accepted by + * the system, and the unprovision operation continues without any timeout + * limit. The default value is false. However, we recommend setting it to true + * for large application packages that were provisioned. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6110,7 +6637,7 @@ function _provisionApplicationType(applicationTypeImageStorePath, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _unprovisionApplicationType(applicationTypeName, applicationTypeImageStoreVersion, options, callback) { +function _unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -6127,8 +6654,8 @@ function _unprovisionApplicationType(applicationTypeName, applicationTypeImageSt 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 (applicationTypeImageStoreVersion === null || applicationTypeImageStoreVersion === undefined) { - throw new Error('applicationTypeImageStoreVersion cannot be null or undefined.'); + if (unprovisionApplicationTypeDescriptionInfo === null || unprovisionApplicationTypeDescriptionInfo === undefined) { + throw new Error('unprovisionApplicationTypeDescriptionInfo cannot be null or undefined.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -6178,14 +6705,14 @@ function _unprovisionApplicationType(applicationTypeName, applicationTypeImageSt let requestContent = null; let requestModel = null; try { - if (applicationTypeImageStoreVersion !== null && applicationTypeImageStoreVersion !== undefined) { - let requestModelMapper = new client.models['ApplicationTypeImageStoreVersion']().mapper(); - requestModel = client.serialize(requestModelMapper, applicationTypeImageStoreVersion, 'applicationTypeImageStoreVersion'); + if (unprovisionApplicationTypeDescriptionInfo !== null && unprovisionApplicationTypeDescriptionInfo !== undefined) { + let requestModelMapper = new client.models['UnprovisionApplicationTypeDescriptionInfo']().mapper(); + requestModel = client.serialize(requestModelMapper, unprovisionApplicationTypeDescriptionInfo, 'unprovisionApplicationTypeDescriptionInfo'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(applicationTypeImageStoreVersion, null, 2)}.`); + `payload - ${JSON.stringify(unprovisionApplicationTypeDescriptionInfo, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -6195,7 +6722,7 @@ function _unprovisionApplicationType(applicationTypeName, applicationTypeImageSt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -6235,9 +6762,7 @@ function _unprovisionApplicationType(applicationTypeName, applicationTypeImageSt * * Gets the list containing the information about service types that are * supported by a provisioned application type in a Service Fabric cluster. The - * response includes the name of the service type, the name and version of the - * service manifest the type is defined in, kind (stateless or stateless) of - * the service type and other information about it. + * provided application type must exist. Otherwise, a 404 status is returned. * * @param {string} applicationTypeName The name of the application type. * @@ -6246,9 +6771,9 @@ function _unprovisionApplicationType(applicationTypeName, applicationTypeImageSt * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6403,24 +6928,28 @@ function _getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, op } /** - * @summary Gets the manifest describing a service type. + * @summary Gets the information about a specific service type that is + * supported by a provisioned application type in a Service Fabric cluster. * - * Gets the manifest describing a service type. The response contains the - * service manifest XML as a string. + * Gets the information about a specific service type that is supported by a + * provisioned application type in a Service Fabric cluster. The provided + * application type must exist. Otherwise, a 404 status is returned. A 204 + * response is returned if the specificed service type is not found in the + * cluster. * * @param {string} applicationTypeName The name of the application type. * * @param {string} applicationTypeVersion The version of the application type. * - * @param {string} serviceManifestName The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6432,13 +6961,13 @@ function _getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, op * {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 ServiceTypeManifest} for more information. + * See {@link ServiceTypeInfo} 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 _getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, callback) { +function _getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -6458,8 +6987,8 @@ function _getServiceManifest(applicationTypeName, applicationTypeVersion, servic if (applicationTypeVersion === null || applicationTypeVersion === undefined || typeof applicationTypeVersion.valueOf() !== 'string') { throw new Error('applicationTypeVersion cannot be null or undefined and it must be of type string.'); } - if (serviceManifestName === null || serviceManifestName === undefined || typeof serviceManifestName.valueOf() !== 'string') { - throw new Error('serviceManifestName cannot be null or undefined and it must be of type string.'); + if (serviceTypeName === null || serviceTypeName === undefined || typeof serviceTypeName.valueOf() !== 'string') { + throw new Error('serviceTypeName cannot be null or undefined and it must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -6480,12 +7009,12 @@ function _getServiceManifest(applicationTypeName, applicationTypeVersion, servic // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ApplicationTypes/{applicationTypeName}/$/GetServiceManifest'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}'; requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + requestUrl = requestUrl.replace('{serviceTypeName}', serviceTypeName); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); queryParameters.push('ApplicationTypeVersion=' + encodeURIComponent(applicationTypeVersion)); - queryParameters.push('ServiceManifestName=' + encodeURIComponent(serviceManifestName)); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -6514,7 +7043,7 @@ function _getServiceManifest(applicationTypeName, applicationTypeVersion, servic 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); @@ -6550,7 +7079,7 @@ function _getServiceManifest(applicationTypeName, applicationTypeVersion, servic parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ServiceTypeManifest']().mapper(); + let resultMapper = new client.models['ServiceTypeInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -6566,34 +7095,24 @@ function _getServiceManifest(applicationTypeName, applicationTypeVersion, servic } /** - * @summary Gets the list containing the information about service types from - * the applications deployed on a node in a Service Fabric cluster. + * @summary Gets the manifest describing a service type. * - * Gets the list containing the information about service types from the - * applications deployed on a node in a Service Fabric cluster. The response - * includes the name of the service type, its registration status, the code - * package that registered it and activation id of the service package. + * Gets the manifest describing a service type. The response contains the + * service manifest XML as a string. * - * @param {string} nodeName The name of the node. + * @param {string} applicationTypeName The name of the application type. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} applicationTypeVersion The version of the application type. * - * @param {object} [options] Optional Parameters. + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * - * @param {string} [options.serviceManifestName] The name of the service - * manifest to filter the list of deployed service type information. If - * specified, the response will only contain the information about service - * types that are defined in this service manifest. + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6604,13 +7123,14 @@ function _getServiceManifest(applicationTypeName, applicationTypeVersion, servic * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceTypeManifest} 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 _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callback) { +function _getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -6620,19 +7140,18 @@ function _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let serviceManifestName = (options && options.serviceManifestName !== undefined) ? options.serviceManifestName : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate try { - if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { - throw new Error('nodeName 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 (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { - throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + if (applicationTypeVersion === null || applicationTypeVersion === undefined || typeof applicationTypeVersion.valueOf() !== 'string') { + throw new Error('applicationTypeVersion cannot be null or undefined and it must be of type string.'); } - if (serviceManifestName !== null && serviceManifestName !== undefined && typeof serviceManifestName.valueOf() !== 'string') { - throw new Error('serviceManifestName must be of type string.'); + if (serviceManifestName === null || serviceManifestName === undefined || typeof serviceManifestName.valueOf() !== 'string') { + throw new Error('serviceManifestName cannot be null or undefined and it must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -6653,14 +7172,12 @@ function _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callb // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes'; - requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); - requestUrl = requestUrl.replace('{applicationId}', applicationId); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ApplicationTypes/{applicationTypeName}/$/GetServiceManifest'; + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (serviceManifestName !== null && serviceManifestName !== undefined) { - queryParameters.push('ServiceManifestName=' + encodeURIComponent(serviceManifestName)); - } + queryParameters.push('ApplicationTypeVersion=' + encodeURIComponent(applicationTypeVersion)); + queryParameters.push('ServiceManifestName=' + encodeURIComponent(serviceManifestName)); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -6725,21 +7242,7 @@ function _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DeployedServiceTypeInfoElementType', - type: { - name: 'Composite', - className: 'DeployedServiceTypeInfo' - } - } - } - }; + let resultMapper = new client.models['ServiceTypeManifest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -6755,28 +7258,24 @@ function _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callb } /** - * @summary Gets the information about a specified service type of the - * application deployed on a node in a Service Fabric cluster. + * @summary Gets the list containing the information about service types from + * the applications deployed on a node in a Service Fabric cluster. * - * Gets the list containing the information about a specific service type from - * the applications deployed on a node in a Service Fabric cluster. The - * response includes the name of the service type, its registration status, the - * code package that registered it and activation id of the service package. - * Each entry represents one activation of a service type, differentiated by - * the activation id. + * Gets the list containing the information about service types from the + * applications deployed on a node in a Service Fabric cluster. The response + * includes the name of the service type, its registration status, the code + * package that registered it and activation ID of the service package. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {string} serviceTypeName Specifies the name of a Service Fabric - * service type. - * * @param {object} [options] Optional Parameters. * * @param {string} [options.serviceManifestName] The name of the service @@ -6785,9 +7284,9 @@ function _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callb * types that are defined in this service manifest. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -6804,7 +7303,7 @@ function _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, callback) { +function _getDeployedServiceTypeInfoList(nodeName, applicationId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -6825,9 +7324,6 @@ function _getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeN if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { throw new Error('applicationId cannot be null or undefined and it must be of type string.'); } - if (serviceTypeName === null || serviceTypeName === undefined || typeof serviceTypeName.valueOf() !== 'string') { - throw new Error('serviceTypeName cannot be null or undefined and it must be of type string.'); - } if (serviceManifestName !== null && serviceManifestName !== undefined && typeof serviceManifestName.valueOf() !== 'string') { throw new Error('serviceManifestName must be of type string.'); } @@ -6850,10 +7346,9 @@ function _getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeN // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes'; requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); requestUrl = requestUrl.replace('{applicationId}', applicationId); - requestUrl = requestUrl.replace('{serviceTypeName}', serviceTypeName); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (serviceManifestName !== null && serviceManifestName !== undefined) { @@ -6887,7 +7382,7 @@ function _getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeN return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -6953,46 +7448,40 @@ function _getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeN } /** - * @summary Creates a Service Fabric application. - * - * Creates a Service Fabric application using the specified description. - * - * @param {object} applicationDescription Description for creating an - * application. - * - * @param {string} applicationDescription.name - * - * @param {string} applicationDescription.typeName - * - * @param {string} applicationDescription.typeVersion - * - * @param {array} [applicationDescription.parameterList] + * @summary Gets the information about a specified service type of the + * application deployed on a node in a Service Fabric cluster. * - * @param {object} [applicationDescription.applicationCapacity] + * Gets the list containing the information about a specific service type from + * the applications deployed on a node in a Service Fabric cluster. The + * response includes the name of the service type, its registration status, the + * code package that registered it and activation ID of the service package. + * Each entry represents one activation of a service type, differentiated by + * the activation ID. * - * @param {number} [applicationDescription.applicationCapacity.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} nodeName The name of the node. * - * @param {number} [applicationDescription.applicationCapacity.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 {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {array} - * [applicationDescription.applicationCapacity.applicationMetrics] + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.serviceManifestName] The name of the service + * manifest to filter the list of deployed service type information. If + * specified, the response will only contain the information about service + * types that are defined in this service manifest. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7003,13 +7492,13 @@ function _getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeN * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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 _createApplication(applicationDescription, options, callback) { +function _getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -7019,12 +7508,22 @@ function _createApplication(applicationDescription, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let serviceManifestName = (options && options.serviceManifestName !== undefined) ? options.serviceManifestName : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate try { - if (applicationDescription === null || applicationDescription === undefined) { - throw new Error('applicationDescription cannot be null or undefined.'); + if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { + throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + } + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (serviceTypeName === null || serviceTypeName === undefined || typeof serviceTypeName.valueOf() !== 'string') { + throw new Error('serviceTypeName cannot be null or undefined and it must be of type string.'); + } + if (serviceManifestName !== null && serviceManifestName !== undefined && typeof serviceManifestName.valueOf() !== 'string') { + throw new Error('serviceManifestName must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -7045,9 +7544,15 @@ function _createApplication(applicationDescription, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/$/Create'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}'; + requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + requestUrl = requestUrl.replace('{applicationId}', applicationId); + requestUrl = requestUrl.replace('{serviceTypeName}', serviceTypeName); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (serviceManifestName !== null && serviceManifestName !== undefined) { + queryParameters.push('ServiceManifestName=' + encodeURIComponent(serviceManifestName)); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -7057,7 +7562,7 @@ function _createApplication(applicationDescription, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7069,28 +7574,14 @@ function _createApplication(applicationDescription, options, callback) { } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (applicationDescription !== null && applicationDescription !== undefined) { - let requestModelMapper = new client.models['ApplicationDescription']().mapper(); - requestModel = client.serialize(requestModelMapper, applicationDescription, 'applicationDescription'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(applicationDescription, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -7119,42 +7610,96 @@ function _createApplication(applicationDescription, options, callback) { // 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeployedServiceTypeInfoElementType', + type: { + name: 'Composite', + className: 'DeployedServiceTypeInfo' + } + } + } + }; + 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 an existing Service Fabric application. + * @summary Creates a Service Fabric application. * - * Deletes an existing Service Fabric application. An application must be - * created before it can be deleted. Deleting an application will delete all - * services that are part of that application. By default Service Fabric will - * try to close service replicas in a graceful manner and then delete the - * service. However if service is having issues closing the replica gracefully, - * the delete operation may take a long time or get stuck. Use the optional - * ForceRemove flag to skip the graceful close sequence and forcefully delete - * the application and all of the its services. + * Creates a Service Fabric application using the specified description. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {object} applicationDescription Description for creating an + * application. * - * @param {object} [options] Optional Parameters. + * @param {string} applicationDescription.name The name of the application, + * including the 'fabric:' URI scheme. * - * @param {boolean} [options.forceRemove] Remove a Service Fabric application - * or service forcefully without going through the graceful shutdown sequence. - * This parameter can be used to forcefully delete an application or service - * for which delete is timing out due to issues in the service code that - * prevents graceful close of replicas. + * @param {string} applicationDescription.typeName The application type name as + * defined in the application manifest. + * + * @param {string} applicationDescription.typeVersion The version of the + * application type as defined in the application manifest. + * + * @param {array} [applicationDescription.parameterList] List of application + * parameters with overridden values from their default values specified in the + * application manifest. + * + * @param {object} [applicationDescription.applicationCapacity] Describes + * capacity information for services of this application. This description can + * be used for describing the following. + * - Reserving the capacity for the services on the nodes + * - Limiting the total number of nodes that services of this application can + * run on + * - Limiting the custom capacity metrics to limit the total consumption of + * this metric by the services of this application + * + * @param {number} [applicationDescription.applicationCapacity.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} [applicationDescription.applicationCapacity.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 {array} + * [applicationDescription.applicationCapacity.applicationMetrics] List of + * application capacity metric description. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7171,7 +7716,7 @@ function _createApplication(applicationDescription, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteApplication(applicationId, options, callback) { +function _createApplication(applicationDescription, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -7181,16 +7726,12 @@ function _deleteApplication(applicationId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let forceRemove = (options && options.forceRemove !== undefined) ? options.forceRemove : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate try { - if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { - throw new Error('applicationId cannot be null or undefined and it must be of type string.'); - } - if (forceRemove !== null && forceRemove !== undefined && typeof forceRemove !== 'boolean') { - throw new Error('forceRemove must be of type boolean.'); + if (applicationDescription === null || applicationDescription === undefined) { + throw new Error('applicationDescription cannot be null or undefined.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -7211,13 +7752,9 @@ function _deleteApplication(applicationId, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/Delete'; - requestUrl = requestUrl.replace('{applicationId}', applicationId); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/$/Create'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (forceRemove !== null && forceRemove !== undefined) { - queryParameters.push('ForceRemove=' + encodeURIComponent(forceRemove.toString())); - } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -7239,14 +7776,28 @@ function _deleteApplication(applicationId, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (applicationDescription !== null && applicationDescription !== undefined) { + let requestModelMapper = new client.models['ApplicationDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, applicationDescription, 'applicationDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(applicationDescription, 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) { + if (statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -7281,27 +7832,36 @@ function _deleteApplication(applicationId, options, callback) { } /** - * @summary Gets load information about a Service Fabric application. + * @summary Deletes an existing Service Fabric application. * - * Returns the load information about the application that was created or in - * the process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * minimum nodes, maximum nodes, the number of nodes the app is occupying - * currently, and application load metric information about the application. + * An application must be created before it can be deleted. Deleting an + * application will delete all services that are part of that application. By + * default, Service Fabric will try to close service replicas in a graceful + * manner and then delete the service. However, if a service is having issues + * closing the replica gracefully, the delete operation may take a long time or + * get stuck. Use the optional ForceRemove flag to skip the graceful close + * sequence and forcefully delete the application and all of its services. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.forceRemove] Remove a Service Fabric application + * or service forcefully without going through the graceful shutdown sequence. + * This parameter can be used to forcefully delete an application or service + * for which delete is timing out due to issues in the service code that + * prevents graceful close of replicas. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7312,14 +7872,13 @@ function _deleteApplication(applicationId, 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 ApplicationLoadInfo} 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 _getApplicationLoadInfo(applicationId, options, callback) { +function _deleteApplication(applicationId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -7329,6 +7888,7 @@ function _getApplicationLoadInfo(applicationId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let forceRemove = (options && options.forceRemove !== undefined) ? options.forceRemove : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate @@ -7336,6 +7896,9 @@ function _getApplicationLoadInfo(applicationId, options, callback) { if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { throw new Error('applicationId cannot be null or undefined and it must be of type string.'); } + if (forceRemove !== null && forceRemove !== undefined && typeof forceRemove !== 'boolean') { + throw new Error('forceRemove must be of type boolean.'); + } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -7355,10 +7918,13 @@ function _getApplicationLoadInfo(applicationId, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/GetLoadInformation'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/Delete'; requestUrl = requestUrl.replace('{applicationId}', applicationId); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (forceRemove !== null && forceRemove !== undefined) { + queryParameters.push('ForceRemove=' + encodeURIComponent(forceRemove.toString())); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -7368,7 +7934,7 @@ function _getApplicationLoadInfo(applicationId, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7387,7 +7953,150 @@ function _getApplicationLoadInfo(applicationId, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + 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['FabricError']().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); + }); +} + +/** + * @summary Gets load information about a Service Fabric application. + * + * Returns the load information about the application that was created or in + * the process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * minimum nodes, maximum nodes, the number of nodes the application is + * occupying currently, and application load metric information about the + * application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 ApplicationLoadInfo} 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 _getApplicationLoadInfo(applicationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/GetLoadInformation'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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); @@ -7440,21 +8149,23 @@ function _getApplicationLoadInfo(applicationId, options, callback) { /** * @summary Gets the list of applications created in the Service Fabric cluster - * that match filters specified as the parameter. + * that match the specified filters. * * Gets the information about the applications that were created or in the - * process of being created in the Service Fabric cluster and match filters - * specified as the parameter. The response includes the name, type, status, - * parameters and other details about the application. If the applications do - * not fit in a page, one page of results is returned as well as a continuation - * token which can be used to get the next page. + * process of being created in the Service Fabric cluster and match the + * specified filters. The response includes the name, type, status, parameters, + * and other details about the application. If the applications do not fit in a + * page, one page of results is returned as well as a continuation token, which + * can be used to get the next page. Filters ApplicationTypeName and + * ApplicationDefinitionKindFilter cannot be specified at the same time. * * @param {object} [options] Optional Parameters. * * @param {number} [options.applicationDefinitionKindFilter] Used to filter on - * ApplicationDefinitionKind for application query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationDefinitionKind value. The value is 0. + * ApplicationDefinitionKind, which is the mechanism used to define a Service + * Fabric application. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. * - All - Filter that matches input with any ApplicationDefinitionKind value. * The value is 65535. * - ServiceFabricApplicationDescription - Filter that matches input with @@ -7463,7 +8174,6 @@ function _getApplicationLoadInfo(applicationId, options, callback) { * - Compose - Filter that matches input with ApplicationDefinitionKind value * Compose. The value is 2. * - * * @param {string} [options.applicationTypeName] The application type name used * to filter the applications to query for. This value should not contain the * application type version. @@ -7472,17 +8182,25 @@ function _getApplicationLoadInfo(applicationId, options, callback) { * specifies whether application parameters will be excluded from the result. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7511,12 +8229,13 @@ function _getApplicationInfoList(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let applicationDefinitionKindFilter = (options && options.applicationDefinitionKindFilter !== undefined) ? options.applicationDefinitionKindFilter : 65535; + let applicationDefinitionKindFilter = (options && options.applicationDefinitionKindFilter !== undefined) ? options.applicationDefinitionKindFilter : 0; let applicationTypeName = (options && options.applicationTypeName !== undefined) ? options.applicationTypeName : undefined; let excludeApplicationParameters = (options && options.excludeApplicationParameters !== undefined) ? options.excludeApplicationParameters : false; let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let apiVersion = '6.1'; // Validate try { if (applicationDefinitionKindFilter !== null && applicationDefinitionKindFilter !== undefined && typeof applicationDefinitionKindFilter !== 'number') { @@ -7531,6 +8250,15 @@ function _getApplicationInfoList(options, callback) { if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { throw new Error('continuationToken must be of type string.'); } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -7565,6 +8293,9 @@ function _getApplicationInfoList(options, callback) { if (continuationToken !== null && continuationToken !== undefined) { queryParameters.push('ContinuationToken=' + continuationToken); } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -7650,13 +8381,14 @@ function _getApplicationInfoList(options, callback) { * Returns the information about the application that was created or in the * process of being created in the Service Fabric cluster and whose name * matches the one specified as the parameter. The response includes the name, - * type, status, parameters and other details about the application. + * type, status, parameters, and other details about the application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -7665,9 +8397,9 @@ function _getApplicationInfoList(options, callback) { * specifies whether application parameters will be excluded from the result. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -7816,13 +8548,14 @@ function _getApplicationInfo(applicationId, options, callback) { * * Returns the heath state of the service fabric application. The response * reports either Ok, Error or Warning health state. If the entity is not found - * in the helath store, it will return Error. + * in the health store, it will return Error. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -7833,10 +8566,10 @@ function _getApplicationInfo(applicationId, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -7850,17 +8583,16 @@ function _getApplicationInfo(applicationId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedApplicationsHealthStateFilter] Allows * filtering of the deployed applications health state objects returned in the * result of application health query based on their health state. * The possible values for this parameter include integer value of one of the * following health states. Only deployed applications that match the filter - * will be returned.\ + * will be returned. * All deployed applications are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of deployed * applications with HealthState value of OK (2) and Warning (4) are returned. * @@ -7875,7 +8607,6 @@ function _getApplicationInfo(applicationId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.servicesHealthStateFilter] Allows filtering of the * services health state objects returned in the result of services health * query based on their health state. @@ -7883,8 +8614,8 @@ function _getApplicationInfo(applicationId, options, callback) { * following health states. * Only services that match the filter are returned. All services are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of services with HealthState value of OK (2) and Warning * (4) will be returned. @@ -7900,18 +8631,16 @@ function _getApplicationInfo(applicationId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8088,8 +8817,9 @@ function _getApplicationHealth(applicationId, options, callback) { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -8100,10 +8830,10 @@ function _getApplicationHealth(applicationId, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -8117,17 +8847,16 @@ function _getApplicationHealth(applicationId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedApplicationsHealthStateFilter] Allows * filtering of the deployed applications health state objects returned in the * result of application health query based on their health state. * The possible values for this parameter include integer value of one of the * following health states. Only deployed applications that match the filter - * will be returned.\ + * will be returned. * All deployed applications are used to evaluate the aggregated health state. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. * For example, if the provided value is 6 then health state of deployed * applications with HealthState value of OK (2) and Warning (4) are returned. * @@ -8142,7 +8871,6 @@ function _getApplicationHealth(applicationId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.servicesHealthStateFilter] Allows filtering of the * services health state objects returned in the result of services health * query based on their health state. @@ -8150,8 +8878,8 @@ function _getApplicationHealth(applicationId, options, callback) { * following health states. * Only services that match the filter are returned. All services are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of services with HealthState value of OK (2) and Warning * (4) will be returned. @@ -8167,21 +8895,18 @@ function _getApplicationHealth(applicationId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -8198,9 +8923,9 @@ function _getApplicationHealth(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -8216,7 +8941,6 @@ function _getApplicationHealth(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -8231,7 +8955,6 @@ function _getApplicationHealth(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -8247,13 +8970,14 @@ function _getApplicationHealth(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8448,21 +9172,20 @@ function _getApplicationHealthUsingPolicy(applicationId, options, callback) { * To see whether the report was applied in the health store, get application * health and check that the report appears in the HealthEvents section. * - * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -8479,12 +9202,13 @@ function _getApplicationHealthUsingPolicy(applicationId, options, callback) { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -8496,7 +9220,6 @@ function _getApplicationHealthUsingPolicy(applicationId, options, callback) { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -8508,7 +9231,6 @@ function _getApplicationHealthUsingPolicy(applicationId, options, callback) { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -8516,10 +9238,9 @@ function _getApplicationHealthUsingPolicy(applicationId, options, callback) { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -8529,33 +9250,31 @@ function _getApplicationHealthUsingPolicy(applicationId, options, callback) { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8707,53 +9426,99 @@ function _reportApplicationHealth(applicationId, healthInformation, options, cal * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} applicationUpgradeDescription Parameters for an application * upgrade. * - * @param {string} applicationUpgradeDescription.name + * @param {string} applicationUpgradeDescription.name The name of the target + * application, including the 'fabric:' URI scheme. * * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion + * The target application type version (found in the application manifest) for + * the application upgrade. * - * @param {array} applicationUpgradeDescription.parameters + * @param {array} applicationUpgradeDescription.parameters List of application + * parameters with overridden values from their default values specified in the + * application manifest. * - * @param {string} applicationUpgradeDescription.upgradeKind Possible values - * include: 'Invalid', 'Rolling' + * @param {string} applicationUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} - * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [applicationUpgradeDescription.forceRestart] + * @param {boolean} [applicationUpgradeDescription.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} [applicationUpgradeDescription.monitoringPolicy] + * @param {object} [applicationUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * [applicationUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [applicationUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [applicationUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [applicationUpgradeDescription.applicationHealthPolicy] + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. * * @param {boolean} * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] @@ -8772,9 +9537,9 @@ function _reportApplicationHealth(applicationId, healthInformation, options, cal * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -8790,7 +9555,6 @@ function _reportApplicationHealth(applicationId, healthInformation, options, cal * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -8805,7 +9569,6 @@ function _reportApplicationHealth(applicationId, healthInformation, options, cal * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -8821,16 +9584,17 @@ function _reportApplicationHealth(applicationId, healthInformation, options, cal * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8975,16 +9739,17 @@ function _startApplicationUpgrade(applicationId, applicationUpgradeDescription, * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9134,20 +9899,25 @@ function _getApplicationUpgrade(applicationId, options, callback) { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} applicationUpgradeUpdateDescription Parameters for updating * an existing application upgrade. * - * @param {string} applicationUpgradeUpdateDescription.name + * @param {string} applicationUpgradeUpdateDescription.name The name of the + * application, including the 'fabric:' URI scheme. * - * @param {string} applicationUpgradeUpdateDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' + * @param {string} applicationUpgradeUpdateDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * * @param {object} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy] + * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * * @param {boolean} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] @@ -9166,9 +9936,9 @@ function _getApplicationUpgrade(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -9184,7 +9954,6 @@ function _getApplicationUpgrade(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -9199,7 +9968,6 @@ function _getApplicationUpgrade(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -9215,48 +9983,88 @@ function _getApplicationUpgrade(applicationId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [applicationUpgradeUpdateDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [applicationUpgradeUpdateDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. * * @param {string} - * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {boolean} - * [applicationUpgradeUpdateDescription.updateDescription.forceRestart] + * [applicationUpgradeUpdateDescription.updateDescription.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 {number} * [applicationUpgradeUpdateDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} - * [applicationUpgradeUpdateDescription.updateDescription.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [applicationUpgradeUpdateDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} * [applicationUpgradeUpdateDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9403,8 +10211,9 @@ function _updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescri * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} resumeApplicationUpgradeDescription Describes the parameters @@ -9416,9 +10225,9 @@ function _updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescri * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9559,24 +10368,25 @@ function _resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescri * application in the Service Fabric cluster. * * Starts rolling back the current application upgrade to the previous version. - * This API can only be used to rollback the current in-progress upgrade that + * This API can only be used to roll back the current in-progress upgrade that * is rolling forward to new version. If the application is not currently being - * upgraded use StartApplicationUpgrade API to upgrade it to desired version + * upgraded use StartApplicationUpgrade API to upgrade it to desired version, * including rolling back to a previous version. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9698,16 +10508,46 @@ function _rollbackApplicationUpgrade(applicationId, options, callback) { /** * @summary Gets the list of applications deployed on a Service Fabric node. * - * Gets the list of applications deployed on a Service Fabric node. + * Gets the list of applications deployed on a Service Fabric node. The results + * do not include information about deployed system applications unless + * explicitly queried for by ID. Results encompass deployed applications in + * active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. * * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9718,7 +10558,9 @@ function _rollbackApplicationUpgrade(applicationId, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedDeployedApplicationInfoList} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -9735,7 +10577,10 @@ function _getDeployedApplicationInfoList(nodeName, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let includeHealthState = (options && options.includeHealthState !== undefined) ? options.includeHealthState : false; + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let apiVersion = '6.1'; // Validate try { if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { @@ -9754,6 +10599,21 @@ function _getDeployedApplicationInfoList(nodeName, options, callback) { throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); } } + if (includeHealthState !== null && includeHealthState !== undefined && typeof includeHealthState !== 'boolean') { + throw new Error('includeHealthState must be of type boolean.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } } catch (error) { return callback(error); } @@ -9767,6 +10627,15 @@ function _getDeployedApplicationInfoList(nodeName, options, callback) { if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } + if (includeHealthState !== null && includeHealthState !== undefined) { + queryParameters.push('IncludeHealthState=' + encodeURIComponent(includeHealthState.toString())); + } + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9828,21 +10697,7 @@ function _getDeployedApplicationInfoList(nodeName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DeployedApplicationInfoElementType', - type: { - name: 'Composite', - className: 'DeployedApplicationInfo' - } - } - } - }; + let resultMapper = new client.models['PagedDeployedApplicationInfoList']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9861,23 +10716,37 @@ function _getDeployedApplicationInfoList(nodeName, options, callback) { * @summary Gets the information about an application deployed on a Service * Fabric node. * - * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID + * provided is for system application. Results encompass deployed applications + * in active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9907,7 +10776,8 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let includeHealthState = (options && options.includeHealthState !== undefined) ? options.includeHealthState : false; + let apiVersion = '6.1'; // Validate try { if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { @@ -9929,6 +10799,9 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); } } + if (includeHealthState !== null && includeHealthState !== undefined && typeof includeHealthState !== 'boolean') { + throw new Error('includeHealthState must be of type boolean.'); + } } catch (error) { return callback(error); } @@ -9943,6 +10816,9 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } + if (includeHealthState !== null && includeHealthState !== undefined) { + queryParameters.push('IncludeHealthState=' + encodeURIComponent(includeHealthState.toString())); + } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10034,8 +10910,9 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -10046,10 +10923,10 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -10063,7 +10940,6 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows * filtering of the deployed service package health state objects returned in * the result of deployed application health query based on their health state. @@ -10073,8 +10949,8 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) * deployed service packages are used to evaluate the aggregated health state * of the deployed application. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. * For example, if the provided value is 6 then health state of service * packages with HealthState value of OK (2) and Warning (4) are returned. * @@ -10089,18 +10965,16 @@ function _getDeployedApplicationInfo(nodeName, applicationId, options, callback) * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10278,14 +11152,14 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * the ApplicationHealthPolicy. The rest of the fields are ignored while * evaluating the health of the deployed application. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -10296,10 +11170,10 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -10313,7 +11187,6 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows * filtering of the deployed service package health state objects returned in * the result of deployed application health query based on their health state. @@ -10323,8 +11196,8 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * deployed service packages are used to evaluate the aggregated health state * of the deployed application. * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. * For example, if the provided value is 6 then health state of service * packages with HealthState value of OK (2) and Warning (4) are returned. * @@ -10339,14 +11212,12 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -10363,9 +11234,9 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -10381,7 +11252,6 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -10396,7 +11266,6 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -10412,8 +11281,9 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -10421,11 +11291,10 @@ function _getDeployedApplicationHealth(nodeName, applicationId, options, callbac * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10620,23 +11489,22 @@ function _getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, optio * application health and check that the report appears in the HealthEvents * section. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -10653,12 +11521,13 @@ function _getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, optio * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -10670,7 +11539,6 @@ function _getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, optio * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -10682,7 +11550,6 @@ function _getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, optio * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -10690,10 +11557,9 @@ function _getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, optio * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -10703,33 +11569,31 @@ function _getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, optio * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10879,8 +11743,7 @@ function _reportDeployedApplicationHealth(nodeName, applicationId, healthInforma /** * @summary Gets the manifest describing an application type. * - * Gets the manifest describing an application type. The response contains the - * application manifest XML as a string. + * The response contains the application manifest XML as a string. * * @param {string} applicationTypeName The name of the application type. * @@ -10889,9 +11752,9 @@ function _reportDeployedApplicationHealth(nodeName, applicationId, healthInforma * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11035,16 +11898,17 @@ function _getApplicationManifest(applicationTypeName, applicationTypeVersion, op /** * @summary Gets the information about all services belonging to the - * application specified by the application id. + * application specified by the application ID. * * Returns the information about all services belonging to the application - * specified by the application id. + * specified by the application ID. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -11053,17 +11917,17 @@ function _getApplicationManifest(applicationTypeName, applicationTypeVersion, op * filter the services to query for. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11215,32 +12079,34 @@ function _getServiceInfoList(applicationId, options, callback) { } /** - * @summary Gets the information about the specific service belonging to a + * @summary Gets the information about the specific service belonging to the * Service Fabric application. * - * Returns the information about specified service belonging to the specified - * Service Fabric application. + * Returns the information about the specified service belonging to the + * specified Service Fabric application. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11384,22 +12250,24 @@ function _getServiceInfo(applicationId, serviceId, options, callback) { /** * @summary Gets the name of the Service Fabric application for a service. * - * The GetApplicationName endpoint returns the name of the application for the - * specified service. + * Gets the name of the application for the specified service. A 404 + * FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the + * provided service ID does not exist. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11537,29 +12405,40 @@ function _getApplicationNameInfo(serviceId, options, callback) { } /** - * @summary Creates the specified service. + * @summary Creates the specified Service Fabric service. * - * Creates the specified service. + * This api allows creating a new Service Fabric stateless or stateful service + * under a specified Service Fabric application. The description for creating + * the service includes partitioning information and optional properties for + * placement and load balancing. Some of the properties can later be modified + * using `UpdateService` API. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} serviceDescription The information necessary to create a * service. * - * @param {string} [serviceDescription.applicationName] + * @param {string} [serviceDescription.applicationName] The name of the + * application, including the 'fabric:' URI scheme. * - * @param {string} serviceDescription.serviceName + * @param {string} serviceDescription.serviceName The full name of the service + * with 'fabric:' URI scheme. * - * @param {string} serviceDescription.serviceTypeName + * @param {string} serviceDescription.serviceTypeName Name of the service type + * as specified in the service manifest. * - * @param {array} [serviceDescription.initializationData] + * @param {array} [serviceDescription.initializationData] The initialization + * data as an array of bytes. Initialization data is passed to service + * instances or replicas when they are created. * - * @param {object} serviceDescription.partitionDescription + * @param {object} serviceDescription.partitionDescription The partition + * description as an object. * * @param {string} serviceDescription.partitionDescription.partitionScheme * Polymorphic Discriminator @@ -11570,33 +12449,40 @@ function _getApplicationNameInfo(serviceId, options, callback) { * based on the service requirements. For example, to place a service on nodes * where NodeType is blue specify the following: "NodeColor == blue)". * - * @param {array} [serviceDescription.correlationScheme] + * @param {array} [serviceDescription.correlationScheme] The correlation + * scheme. * - * @param {array} [serviceDescription.serviceLoadMetrics] + * @param {array} [serviceDescription.serviceLoadMetrics] The service load + * metrics. * - * @param {array} [serviceDescription.servicePlacementPolicies] + * @param {array} [serviceDescription.servicePlacementPolicies] The service + * placement policies. * - * @param {string} [serviceDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {string} [serviceDescription.defaultMoveCost] The move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * * @param {boolean} [serviceDescription.isDefaultMoveCostSpecified] Indicates * if the DefaultMoveCost property is specified. * - * @param {string} [serviceDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * @param {string} [serviceDescription.servicePackageActivationMode] The + * activation mode of service package to be used for a service. Possible values + * include: 'SharedProcess', 'ExclusiveProcess' * * @param {string} [serviceDescription.serviceDnsName] The DNS name of the * service. It requires the DNS system service to be enabled in Service Fabric * cluster. * + * @param {array} [serviceDescription.scalingPolicies] Scaling policies for + * this service. + * * @param {string} serviceDescription.serviceKind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11733,33 +12619,41 @@ function _createService(applicationId, serviceDescription, options, callback) { } /** - * @summary Creates a Service Fabric service from the service template defined - * in the application manifest. + * @summary Creates a Service Fabric service from the service template. * * Creates a Service Fabric service from the service template defined in the - * application manifest. + * application manifest. A service template contains the properties that will + * be same for the service instance of the same type. The API allows overriding + * the properties that are usually different for different services of the same + * service type. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} serviceFromTemplateDescription Describes the service that * needs to be created from the template defined in the application manifest. * - * @param {string} serviceFromTemplateDescription.applicationName + * @param {string} serviceFromTemplateDescription.applicationName The name of + * the application, including the 'fabric:' URI scheme. * - * @param {string} serviceFromTemplateDescription.serviceName + * @param {string} serviceFromTemplateDescription.serviceName The full name of + * the service with 'fabric:' URI scheme. * - * @param {string} serviceFromTemplateDescription.serviceTypeName + * @param {string} serviceFromTemplateDescription.serviceTypeName Name of the + * service type as specified in the service manifest. * - * @param {array} [serviceFromTemplateDescription.initializationData] + * @param {array} [serviceFromTemplateDescription.initializationData] The + * initialization data for the newly created service instance. * * @param {string} - * [serviceFromTemplateDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * [serviceFromTemplateDescription.servicePackageActivationMode] The activation + * mode of service package to be used for a service. Possible values include: + * 'SharedProcess', 'ExclusiveProcess' * * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name * of the service. It requires the DNS system service to be enabled in Service @@ -11768,9 +12662,9 @@ function _createService(applicationId, serviceDescription, options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -11909,17 +12803,18 @@ function _createServiceFromTemplate(applicationId, serviceFromTemplateDescriptio /** * @summary Deletes an existing Service Fabric service. * - * Deletes an existing Service Fabric service. A service must be created before - * it can be deleted. By default Service Fabric will try to close service - * replicas in a graceful manner and then delete the service. However if - * service is having issues closing the replica gracefully, the delete - * operation may take a long time or get stuck. Use the optional ForceRemove - * flag to skip the graceful close sequence and forcefully delete the service. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * A service must be created before it can be deleted. By default, Service + * Fabric will try to close service replicas in a graceful manner and then + * delete the service. However, if the service is having issues closing the + * replica gracefully, the delete operation may take a long time or get stuck. + * Use the optional ForceRemove flag to skip the graceful close sequence and + * forcefully delete the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -11932,9 +12827,9 @@ function _createServiceFromTemplate(applicationId, serviceFromTemplateDescriptio * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -12061,14 +12956,24 @@ function _deleteService(serviceId, options, callback) { } /** - * @summary Updates the specified service using the given update description. - * - * Updates the specified service using the given update description. + * @summary Updates a Service Fabric service using the specified update + * description. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * This API allows updating properties of a running Service Fabric service. The + * set of properties that can be updated are a subset of the properties that + * were specified at the time of creating the service. The current set of + * properties can be obtained using `GetServiceDescription` API. Note that + * updating the properties of a running service is different than upgrading + * your application using `StartApplicationUpgrade` API. The upgrade is a long + * running background operation that involves moving the application from one + * version to another, one upgrade domain at a time, whereas update applies the + * new properties immediately to the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -12106,7 +13011,8 @@ function _deleteService(serviceId, options, callback) { * 256. * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value * is 512. - * + * - ScalingPolicy - Indicates the ScalingPolicies property is set. The value + * is 1024. * * @param {string} [serviceUpdateDescription.placementConstraints] The * placement constraints as a string. Placement constraints are boolean @@ -12115,14 +13021,20 @@ function _deleteService(serviceId, options, callback) { * service on nodes where NodeType is blue specify the following: "NodeColor == * blue)". * - * @param {array} [serviceUpdateDescription.correlationScheme] + * @param {array} [serviceUpdateDescription.correlationScheme] The correlation + * scheme. + * + * @param {array} [serviceUpdateDescription.loadMetrics] The service load + * metrics. * - * @param {array} [serviceUpdateDescription.loadMetrics] + * @param {array} [serviceUpdateDescription.servicePlacementPolicies] The + * service placement policies. * - * @param {array} [serviceUpdateDescription.servicePlacementPolicies] + * @param {string} [serviceUpdateDescription.defaultMoveCost] The move cost for + * the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * - * @param {string} [serviceUpdateDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {array} [serviceUpdateDescription.scalingPolicies] Scaling policies + * for this service. * * @param {string} serviceUpdateDescription.serviceKind Polymorphic * Discriminator @@ -12130,9 +13042,9 @@ function _deleteService(serviceId, options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -12274,19 +13186,20 @@ function _updateService(serviceId, serviceUpdateDescription, options, callback) * Gets the description of an existing Service Fabric service. A service must * be created before its description can be obtained. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -12432,13 +13345,13 @@ function _getServiceDescription(serviceId, options, callback) { * Use PartitionsHealthStateFilter to filter the collection of partitions * returned. * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. - * + * request returns an error. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -12450,10 +13363,10 @@ function _getServiceDescription(serviceId, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -12467,7 +13380,6 @@ function _getServiceDescription(serviceId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.partitionsHealthStateFilter] Allows filtering of * the partitions health state objects returned in the result of service health * query based on their health state. @@ -12475,7 +13387,7 @@ function _getServiceDescription(serviceId, options, callback) { * following health states. * Only partitions that match the filter are returned. All partitions are used * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based + * If not specified, all entries are returned. The state values are flag-based * enumeration, so the value could be a combination of these value * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of partitions with HealthState value of OK (2) and @@ -12492,18 +13404,16 @@ function _getServiceDescription(serviceId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by * default. * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -12676,13 +13586,13 @@ function _getServiceHealth(serviceId, options, callback) { * Use PartitionsHealthStateFilter to filter the collection of partitions * returned. * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. + * request returns an error. * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -12694,10 +13604,10 @@ function _getServiceHealth(serviceId, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -12711,7 +13621,6 @@ function _getServiceHealth(serviceId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.partitionsHealthStateFilter] Allows filtering of * the partitions health state objects returned in the result of service health * query based on their health state. @@ -12719,7 +13628,7 @@ function _getServiceHealth(serviceId, options, callback) { * following health states. * Only partitions that match the filter are returned. All partitions are used * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based + * If not specified, all entries are returned. The state values are flag-based * enumeration, so the value could be a combination of these value * obtained using bitwise 'OR' operator. For example, if the provided value is * 6 then health state of partitions with HealthState value of OK (2) and @@ -12736,14 +13645,12 @@ function _getServiceHealth(serviceId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -12760,9 +13667,9 @@ function _getServiceHealth(serviceId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -12778,7 +13685,6 @@ function _getServiceHealth(serviceId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -12793,7 +13699,6 @@ function _getServiceHealth(serviceId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -12809,8 +13714,9 @@ function _getServiceHealth(serviceId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -12818,11 +13724,10 @@ function _getServiceHealth(serviceId, options, callback) { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13011,11 +13916,11 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * GetServiceHealth and check that the report appears in the HealthEvents * section. * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -13023,9 +13928,8 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -13042,12 +13946,13 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -13059,7 +13964,6 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -13071,7 +13975,6 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -13079,10 +13982,9 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -13092,33 +13994,31 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13264,13 +14164,14 @@ function _reportServiceHealth(serviceId, healthInformation, options, callback) { /** * @summary Resolve a Service Fabric partition. * - * Resolve a Service Fabric service partition, to get the endpoints of the + * Resolve a Service Fabric service partition to get the endpoints of the * service replicas. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -13279,28 +14180,27 @@ function _reportServiceHealth(serviceId, healthInformation, options, callback) { * @param {number} [options.partitionKeyType] Key type for the partition. This * parameter is required if the partition scheme for the service is Int64Range * or Named. The possible values are following. - * - None (1) - Indicates that the the PartitionKeyValue parameter is not + * - None (1) - Indicates that the PartitionKeyValue parameter is not * specified. This is valid for the partitions with partitioning scheme as * Singleton. This is the default value. The value is 1. - * - Int64Range (2) - Indicates that the the PartitionKeyValue parameter is an + * - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an * int64 partition key. This is valid for the partitions with partitioning * scheme as Int64Range. The value is 2. - * - Named (3) - Indicates that the the PartitionKeyValue parameter is a name - * of the partition. This is valid for the partitions with partitioning scheme - * as Named. The value is 3. - * + * - Named (3) - Indicates that the PartitionKeyValue parameter is a name of + * the partition. This is valid for the partitions with partitioning scheme as + * Named. The value is 3. * * @param {string} [options.partitionKeyValue] Partition key. This is required * if the partition scheme for the service is Int64Range or Named. * * @param {string} [options.previousRspVersion] The value in the Version field * of the response that was received previously. This is required if the user - * knows that the result that was got previously is stale. + * knows that the result that was gotten previously is stale. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13462,31 +14362,32 @@ function _resolveService(serviceId, options, callback) { /** * @summary Gets the list of partitions of a Service Fabric service. * - * Gets the list of partitions of a Service Fabric service. The response - * include the partition id, partitioning scheme information, keys supported by - * the partition, status, health and other details about the partition. + * The response includes the partition ID, partitioning scheme information, + * keys supported by the partition, status, health, and other details about the + * partition. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13634,19 +14535,18 @@ function _getPartitionInfoList(serviceId, options, callback) { /** * @summary Gets the information about a Service Fabric partition. * - * The Partitions endpoint returns information about the specified partition. - * The response include the partition id, partitioning scheme information, keys - * supported by the partition, status, health and other details about the - * partition. + * Gets the information about the specified partition. The response includes + * the partition ID, partitioning scheme information, keys supported by the + * partition, status, health, and other details about the partition. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13786,17 +14686,17 @@ function _getPartitionInfo(partitionId, options, callback) { /** * @summary Gets the name of the Service Fabric service for a partition. * - * The GetServiceName endpoint returns the name of the service for the - * specified partition. + * Gets name of the service for the specified partition. A 404 error is + * returned if the partition ID does not exist in the cluster. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13936,14 +14836,247 @@ function _getServiceNameInfo(partitionId, options, callback) { /** * @summary Gets the health of the specified Service Fabric partition. * - * Gets the health information of the specified partition. * Use EventsHealthStateFilter to filter the collection of health events * reported on the service based on the health state. * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState * objects on the partition. * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. + * request returns an error. * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.replicasHealthStateFilter] Allows filtering the + * collection of ReplicaHealthState objects on the partition. The value can be + * obtained from members or bitwise operations on members of HealthStateFilter. + * Only replicas that match the filter will be returned. All replicas will be + * used to evaluate the aggregated health state. If not specified, all entries + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. + * For example, If the provided value is 6 then all of the events with + * HealthState value of OK (2) and Warning (4) will be returned. The possible + * values for this parameter include integer value of one of the following + * health states. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PartitionHealth} 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 _getPartitionHealth(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let eventsHealthStateFilter = (options && options.eventsHealthStateFilter !== undefined) ? options.eventsHealthStateFilter : 0; + let replicasHealthStateFilter = (options && options.replicasHealthStateFilter !== undefined) ? options.replicasHealthStateFilter : 0; + let excludeHealthStatistics = (options && options.excludeHealthStatistics !== undefined) ? options.excludeHealthStatistics : false; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined && typeof eventsHealthStateFilter !== 'number') { + throw new Error('eventsHealthStateFilter must be of type number.'); + } + if (replicasHealthStateFilter !== null && replicasHealthStateFilter !== undefined && typeof replicasHealthStateFilter !== 'number') { + throw new Error('replicasHealthStateFilter must be of type number.'); + } + if (excludeHealthStatistics !== null && excludeHealthStatistics !== undefined && typeof excludeHealthStatistics !== 'boolean') { + throw new Error('excludeHealthStatistics must be of type boolean.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetHealth'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined) { + queryParameters.push('EventsHealthStateFilter=' + encodeURIComponent(eventsHealthStateFilter.toString())); + } + if (replicasHealthStateFilter !== null && replicasHealthStateFilter !== undefined) { + queryParameters.push('ReplicasHealthStateFilter=' + encodeURIComponent(replicasHealthStateFilter.toString())); + } + if (excludeHealthStatistics !== null && excludeHealthStatistics !== undefined) { + queryParameters.push('ExcludeHealthStatistics=' + encodeURIComponent(excludeHealthStatistics.toString())); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PartitionHealth']().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 Gets the health of the specified Service Fabric partition, by using + * the specified health policy. + * + * Gets the health information of the specified partition. + * If the application health policy is specified, the health evaluation uses it + * to get the aggregated health state. + * If the policy is not specified, the health evaluation uses the application + * health policy defined in the application manifest, or the default health + * policy, if no policy is defined in the manifest. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the partition based on the health state. + * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState + * objects on the partition. Use ApplicationHealthPolicy in the POST body to + * override the health policies used to evaluate the health. + * If you specify a partition that does not exist in the health store, this + * request returns an error. * * @param {uuid} partitionId The identity of the partition. * @@ -13955,10 +15088,10 @@ function _getServiceNameInfo(partitionId, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -13972,253 +15105,13 @@ function _getServiceNameInfo(partitionId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * - * @param {number} [options.replicasHealthStateFilter] Allows filtering the - * collection of ReplicaHealthState objects on the partition. The value can be - * obtained from members or bitwise operations on members of HealthStateFilter. - * Only replicas that match the filter will be returned. All replicas will be - * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. - * For example, If the provided value is 6 then all of the events with - * HealthState value of OK (2) and Warning (4) will be returned. The possible - * values for this parameter include integer value of one of the following - * health states. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. - * - * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * - * @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 PartitionHealth} 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 _getPartitionHealth(partitionId, options, callback) { - /* jshint validthis: true */ - let client = this; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let eventsHealthStateFilter = (options && options.eventsHealthStateFilter !== undefined) ? options.eventsHealthStateFilter : 0; - let replicasHealthStateFilter = (options && options.replicasHealthStateFilter !== undefined) ? options.replicasHealthStateFilter : 0; - let excludeHealthStatistics = (options && options.excludeHealthStatistics !== undefined) ? options.excludeHealthStatistics : false; - let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; - // Validate - try { - if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { - throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); - } - if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined && typeof eventsHealthStateFilter !== 'number') { - throw new Error('eventsHealthStateFilter must be of type number.'); - } - if (replicasHealthStateFilter !== null && replicasHealthStateFilter !== undefined && typeof replicasHealthStateFilter !== 'number') { - throw new Error('replicasHealthStateFilter must be of type number.'); - } - if (excludeHealthStatistics !== null && excludeHealthStatistics !== undefined && typeof excludeHealthStatistics !== 'boolean') { - throw new Error('excludeHealthStatistics must be of type boolean.'); - } - if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { - throw new Error('timeout must be of type number.'); - } - if (timeout !== null && timeout !== undefined) { - if (timeout > 4294967295) - { - throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); - } - if (timeout < 1) - { - throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetHealth'; - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined) { - queryParameters.push('EventsHealthStateFilter=' + encodeURIComponent(eventsHealthStateFilter.toString())); - } - if (replicasHealthStateFilter !== null && replicasHealthStateFilter !== undefined) { - queryParameters.push('ReplicasHealthStateFilter=' + encodeURIComponent(replicasHealthStateFilter.toString())); - } - if (excludeHealthStatistics !== null && excludeHealthStatistics !== undefined) { - queryParameters.push('ExcludeHealthStatistics=' + encodeURIComponent(excludeHealthStatistics.toString())); - } - if (timeout !== null && timeout !== undefined) { - queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); - } - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if(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['FabricError']().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['PartitionHealth']().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 Gets the health of the specified Service Fabric partition, by using - * the specified health policy. - * - * Gets the health information of the specified partition. - * If the application health policy is specified, the health evaluation uses it - * to get the aggregated health state. - * If the policy is not specified, the health evaluation uses the application - * health policy defined in the application manifest, or the default health - * policy, if no policy is defined in the manifest. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the partition based on the health state. - * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState - * objects on the partition. Use ApplicationHealthPolicy in the POST body to - * override the health policies used to evaluate the health. - * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. - * - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * * @param {number} [options.replicasHealthStateFilter] Allows filtering the * collection of ReplicaHealthState objects on the partition. The value can be * obtained from members or bitwise operations on members of HealthStateFilter. * Only replicas that match the filter will be returned. All replicas will be * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. * For example, If the provided value is 6 then all of the events with * HealthState value of OK (2) and Warning (4) will be returned. The possible * values for this parameter include integer value of one of the following @@ -14235,14 +15128,12 @@ function _getPartitionHealth(partitionId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -14259,9 +15150,9 @@ function _getPartitionHealth(partitionId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -14277,7 +15168,6 @@ function _getPartitionHealth(partitionId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -14292,7 +15182,6 @@ function _getPartitionHealth(partitionId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -14308,8 +15197,9 @@ function _getPartitionHealth(partitionId, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} [options.excludeHealthStatistics] Indicates whether the * health statistics should be returned as part of the query result. False by @@ -14317,11 +15207,10 @@ function _getPartitionHealth(partitionId, options, callback) { * The statistics show the number of children entities in health state Ok, * Warning, and Error. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14510,16 +15399,14 @@ function _getPartitionHealthUsingPolicy(partitionId, options, callback) { * GetPartitionHealth and check that the report appears in the HealthEvents * section. * - * * @param {uuid} partitionId The identity of the partition. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -14536,12 +15423,13 @@ function _getPartitionHealthUsingPolicy(partitionId, options, callback) { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -14553,7 +15441,6 @@ function _getPartitionHealthUsingPolicy(partitionId, options, callback) { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -14565,7 +15452,6 @@ function _getPartitionHealthUsingPolicy(partitionId, options, callback) { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -14573,10 +15459,9 @@ function _getPartitionHealthUsingPolicy(partitionId, options, callback) { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -14586,33 +15471,31 @@ function _getPartitionHealthUsingPolicy(partitionId, options, callback) { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14756,22 +15639,22 @@ function _reportPartitionHealth(partitionId, healthInformation, options, callbac } /** - * @summary Gets the load of the specified Service Fabric partition. + * @summary Gets the load information of the specified Service Fabric + * partition. * - * Returns information about the specified partition. - * The response includes a list of load information. - * Each information includes load metric name, value and last reported time in + * Returns information about the load of a specified partition. + * The response includes a list of load reports for a Service Fabric partition. + * Each report includes the load metric name, value, and last reported time in * UTC. * - * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14920,9 +15803,9 @@ function _getPartitionLoadInformation(partitionId, options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15043,22 +15926,20 @@ function _resetPartitionLoad(partitionId, options, callback) { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover a specific partition which is currently stuck in quorum loss. + * recover a specific partition that is currently stuck in quorum loss. * - * Indicates to the Service Fabric cluster that it should attempt to recover a - * specific partition which is currently stuck in quorum loss. This operation - * should only be performed if it is known that the replicas that are down - * cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15179,27 +16060,28 @@ function _recoverPartition(partitionId, options, callback) { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the specified service which is currently stuck in quorum loss. + * recover the specified service that is currently stuck in quorum loss. * * Indicates to the Service Fabric cluster that it should attempt to recover - * the specified service which is currently stuck in quorum loss. This - * operation should only be performed if it is known that the replicas that are - * down cannot be recovered. Incorrect use of this API can cause potential data + * the specified service that is currently stuck in quorum loss. This operation + * should only be performed if it is known that the replicas that are down + * cannot be recovered. Incorrect use of this API can cause potential data * loss. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15320,10 +16202,10 @@ function _recoverServicePartitions(serviceId, options, callback) { /** * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the system services which are currently stuck in quorum loss. + * recover the system services that are currently stuck in quorum loss. * * Indicates to the Service Fabric cluster that it should attempt to recover - * the system services which are currently stuck in quorum loss. This operation + * the system services that are currently stuck in quorum loss. This operation * should only be performed if it is known that the replicas that are down * cannot be recovered. Incorrect use of this API can cause potential data * loss. @@ -15331,9 +16213,9 @@ function _recoverServicePartitions(serviceId, options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15453,18 +16335,16 @@ function _recoverSystemPartitions(options, callback) { * recover any services (including system services) which are currently stuck * in quorum loss. * - * Indicates to the Service Fabric cluster that it should attempt to recover - * any services (including system services) which are currently stuck in quorum - * loss. This operation should only be performed if it is known that the - * replicas that are down cannot be recovered. Incorrect use of this API can - * cause potential data loss. + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15599,7 +16479,6 @@ function _recoverAllPartitions(options, callback) { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTask Describes the repair task to be created or * updated. * @@ -15614,32 +16493,14 @@ function _recoverAllPartitions(options, callback) { * update will only succeed if the actual current version of the repair task * matches this value. * - * * @param {string} [repairTask.description] A description of the purpose of the * repair task, or other informational details. * May be set when the repair task is created, and is immutable once set. * - * * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' * * @param {number} [repairTask.flags] A bitwise-OR of the following values, * which gives additional details about the status of the repair task. @@ -15647,12 +16508,13 @@ function _recoverAllPartitions(options, callback) { * - 2 - Abort of the repair has been requested * - 4 - Approval of the repair was forced via client request * - * * @param {string} repairTask.action The requested repair action. Must be * specified when the repair task is created, and is immutable once set. * - * - * @param {object} [repairTask.target] + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. * * @param {string} repairTask.target.kind Polymorphic Discriminator * @@ -15662,43 +16524,32 @@ function _recoverAllPartitions(options, callback) { * @param {string} [repairTask.executorData] A data string that the repair * executor can use to store its internal state. * - * @param {object} [repairTask.impact] + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. * * @param {string} repairTask.impact.kind Polymorphic Discriminator * * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' * * @param {number} [repairTask.resultCode] A numeric value providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * * @param {string} [repairTask.resultDetails] A string providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * - * @param {object} [repairTask.history] + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. * * @param {date} [repairTask.history.createdUtcTimestamp] The time when the * repair task entered the Created state. @@ -15733,11 +16584,15 @@ function _recoverAllPartitions(options, callback) { * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The * time when the repair task completed the health check in the Restoring state. * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * * @param {boolean} [repairTask.performPreparingHealthCheck] A value to * determine if health checks will be performed when the repair task enters the @@ -15886,7 +16741,6 @@ function _createRepairTask(repairTask, options, callback) { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskCancelDescription Describes the repair task to be * cancelled. * @@ -15896,12 +16750,12 @@ function _createRepairTask(repairTask, options, callback) { * @param {string} [repairTaskCancelDescription.version] The current version * number of the repair task. If non-zero, then the request will only succeed * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * zero, then no version check is performed. * * @param {boolean} [repairTaskCancelDescription.requestAbort] _True_ if the * repair should be stopped as soon as possible even if it has already started * executing. _False_ if the repair should be cancelled only if execution has - * not yet started. + * not yet started. * * @param {object} [options] Optional Parameters. * @@ -16042,7 +16896,6 @@ function _cancelRepairTask(repairTaskCancelDescription, options, callback) { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskDeleteDescription Describes the repair task to be * deleted. * @@ -16175,7 +17028,6 @@ function _deleteRepairTask(repairTaskDeleteDescription, options, callback) { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} [options] Optional Parameters. * * @param {string} [options.taskIdFilter] The repair task ID prefix to be @@ -16183,6 +17035,7 @@ function _deleteRepairTask(repairTaskDeleteDescription, options, callback) { * * @param {number} [options.stateFilter] A bitwise-OR of the following values, * specifying which task states should be included in the result list. + * * - 1 - Created * - 2 - Claimed * - 4 - Preparing @@ -16191,7 +17044,6 @@ function _deleteRepairTask(repairTaskDeleteDescription, options, callback) { * - 32 - Restoring * - 64 - Completed * - * * @param {string} [options.executorFilter] The name of the repair executor * whose claimed tasks should be included in the list. * @@ -16349,7 +17201,6 @@ function _getRepairTaskList(options, callback) { * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskApproveDescription Describes the repair task to be * approved. * @@ -16359,7 +17210,7 @@ function _getRepairTaskList(options, callback) { * @param {string} [repairTaskApproveDescription.version] The current version * number of the repair task. If non-zero, then the request will only succeed * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * zero, then no version check is performed. * * @param {object} [options] Optional Parameters. * @@ -16500,7 +17351,6 @@ function _forceApproveRepairTask(repairTaskApproveDescription, options, callback * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTaskUpdateHealthPolicyDescription Describes the repair * task healthy policy to be updated. * @@ -16663,7 +17513,6 @@ function _updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, * This API supports the Service Fabric platform; it is not meant to be used * directly from your code. * - * * @param {object} repairTask Describes the repair task to be created or * updated. * @@ -16678,32 +17527,14 @@ function _updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, * update will only succeed if the actual current version of the repair task * matches this value. * - * * @param {string} [repairTask.description] A description of the purpose of the * repair task, or other informational details. * May be set when the repair task is created, and is immutable once set. * - * * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' * * @param {number} [repairTask.flags] A bitwise-OR of the following values, * which gives additional details about the status of the repair task. @@ -16711,12 +17542,13 @@ function _updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, * - 2 - Abort of the repair has been requested * - 4 - Approval of the repair was forced via client request * - * * @param {string} repairTask.action The requested repair action. Must be * specified when the repair task is created, and is immutable once set. * - * - * @param {object} [repairTask.target] + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. * * @param {string} repairTask.target.kind Polymorphic Discriminator * @@ -16726,43 +17558,32 @@ function _updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, * @param {string} [repairTask.executorData] A data string that the repair * executor can use to store its internal state. * - * @param {object} [repairTask.impact] + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. * * @param {string} repairTask.impact.kind Polymorphic Discriminator * * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' * * @param {number} [repairTask.resultCode] A numeric value providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * * @param {string} [repairTask.resultDetails] A string providing additional * details about the result of the repair task execution. * May be specified in the Restoring and later states, and is immutable once * set. * - * - * @param {object} [repairTask.history] + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. * * @param {date} [repairTask.history.createdUtcTimestamp] The time when the * repair task entered the Created state. @@ -16797,11 +17618,15 @@ function _updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The * time when the repair task completed the health check in the Restoring state. * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' * * @param {boolean} [repairTask.performPreparingHealthCheck] A value to * determine if health checks will be performed when the repair task enters the @@ -16949,25 +17774,25 @@ function _updateRepairExecutionState(repairTask, options, callback) { * partition. * * The GetReplicas endpoint returns information about the replicas of the - * specified partition. The respons include the id, role, status, health, node - * name, uptime, and other details about the replica. + * specified partition. The response includes the ID, role, status, health, + * node name, uptime, and other details about the replica. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17114,7 +17939,7 @@ function _getReplicaInfoList(partitionId, options, callback) { /** * @summary Gets the information about a replica of a Service Fabric partition. * - * The respons include the id, role, status, health, node name, uptime, and + * The response includes the ID, role, status, health, node name, uptime, and * other details about the replica. * * @param {uuid} partitionId The identity of the partition. @@ -17123,18 +17948,10 @@ function _getReplicaInfoList(partitionId, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17162,7 +17979,6 @@ function _getReplicaInfo(partitionId, replicaId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate @@ -17173,9 +17989,6 @@ function _getReplicaInfo(partitionId, replicaId, options, callback) { if (replicaId === null || replicaId === undefined || typeof replicaId.valueOf() !== 'string') { throw new Error('replicaId cannot be null or undefined and it must be of type string.'); } - if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { - throw new Error('continuationToken must be of type string.'); - } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -17200,9 +18013,6 @@ function _getReplicaInfo(partitionId, replicaId, options, callback) { requestUrl = requestUrl.replace('{replicaId}', replicaId); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (continuationToken !== null && continuationToken !== undefined) { - queryParameters.push('ContinuationToken=' + continuationToken); - } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -17290,6 +18100,198 @@ function _getReplicaInfo(partitionId, replicaId, options, callback) { * Use EventsHealthStateFilter to filter the collection of health events * reported on the replica based on the health state. * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 ReplicaHealth} 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 _getReplicaHealth(partitionId, replicaId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let eventsHealthStateFilter = (options && options.eventsHealthStateFilter !== undefined) ? options.eventsHealthStateFilter : 0; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (replicaId === null || replicaId === undefined || typeof replicaId.valueOf() !== 'string') { + throw new Error('replicaId cannot be null or undefined and it must be of type string.'); + } + if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined && typeof eventsHealthStateFilter !== 'number') { + throw new Error('eventsHealthStateFilter must be of type number.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + requestUrl = requestUrl.replace('{replicaId}', replicaId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined) { + queryParameters.push('EventsHealthStateFilter=' + encodeURIComponent(eventsHealthStateFilter.toString())); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['ReplicaHealth']().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 Gets the health of a Service Fabric stateful service replica or + * stateless service instance using the specified policy. + * + * Gets the health of a Service Fabric stateful service replica or stateless + * service instance. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the cluster based on the health state. + * Use ApplicationHealthPolicy to optionally override the health policies used + * to evaluate the health. This API only uses 'ConsiderWarningAsError' field of + * the ApplicationHealthPolicy. The rest of the fields are ignored while + * evaluating the health of the replica. * * @param {uuid} partitionId The identity of the partition. * @@ -17303,10 +18305,10 @@ function _getReplicaInfo(partitionId, replicaId, options, callback) { * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -17320,11 +18322,83 @@ function _getReplicaInfo(partitionId, replicaId, options, callback) { * - All - Filter that matches input with any HealthState value. The value is * 65535. * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. + * + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.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. + * + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17342,7 +18416,7 @@ function _getReplicaInfo(partitionId, replicaId, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getReplicaHealth(partitionId, replicaId, options, callback) { +function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -17353,277 +18427,7 @@ function _getReplicaHealth(partitionId, replicaId, options, callback) { throw new Error('callback cannot be null.'); } let eventsHealthStateFilter = (options && options.eventsHealthStateFilter !== undefined) ? options.eventsHealthStateFilter : 0; - let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; - // Validate - try { - if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { - throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); - } - if (replicaId === null || replicaId === undefined || typeof replicaId.valueOf() !== 'string') { - throw new Error('replicaId cannot be null or undefined and it must be of type string.'); - } - if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined && typeof eventsHealthStateFilter !== 'number') { - throw new Error('eventsHealthStateFilter must be of type number.'); - } - if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { - throw new Error('timeout must be of type number.'); - } - if (timeout !== null && timeout !== undefined) { - if (timeout > 4294967295) - { - throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); - } - if (timeout < 1) - { - throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth'; - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); - requestUrl = requestUrl.replace('{replicaId}', replicaId); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (eventsHealthStateFilter !== null && eventsHealthStateFilter !== undefined) { - queryParameters.push('EventsHealthStateFilter=' + encodeURIComponent(eventsHealthStateFilter.toString())); - } - if (timeout !== null && timeout !== undefined) { - queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); - } - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if(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['FabricError']().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['ReplicaHealth']().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 Gets the health of a Service Fabric stateful service replica or - * stateless service instance using the specified policy. - * - * Gets the health of a Service Fabric stateful service replica or stateless - * service instance. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the cluster based on the health state. - * Use ApplicationHealthPolicy to optionally override the health policies used - * to evaluate the health. This API only uses 'ConsiderWarningAsError' field of - * the ApplicationHealthPolicy. The rest of the fields are ignored while - * evaluating the health of the replica. - * - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {string} replicaId The identifier of the replica. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. - * - * - * @param {number} - * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * - * @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 ReplicaHealth} 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 _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) { - /* jshint validthis: true */ - let client = this; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let eventsHealthStateFilter = (options && options.eventsHealthStateFilter !== undefined) ? options.eventsHealthStateFilter : 0; - let applicationHealthPolicy = (options && options.applicationHealthPolicy !== undefined) ? options.applicationHealthPolicy : undefined; + let applicationHealthPolicy = (options && options.applicationHealthPolicy !== undefined) ? options.applicationHealthPolicy : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate @@ -17773,27 +18577,20 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * GetReplicaHealth and check that the report appears in the HealthEvents * section. * - * * @param {uuid} partitionId The identity of the partition. * * @param {string} replicaId The identifier of the replica. * - * @param {string} serviceKind The kind of service replica (Stateless or - * Stateful) for which the health is being reported. Following are the possible - * values. - * - Stateless - Does not use Service Fabric to make its state highly available - * or reliable. The value is 1 - * - Stateful - Uses Service Fabric to make its state or part of its state - * highly available and reliable. The value is 2. - * . Possible values include: 'Stateless', 'Stateful' + * @param {string} replicaHealthReportServiceKind The kind of service replica + * (Stateless or Stateful) for which the health is being reported. Following + * are the possible values. Possible values include: 'Stateless', 'Stateful' * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -17810,12 +18607,13 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -17827,7 +18625,6 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -17839,7 +18636,6 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -17847,10 +18643,9 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -17860,33 +18655,31 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17903,7 +18696,7 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _reportReplicaHealth(partitionId, replicaId, serviceKind, healthInformation, options, callback) { +function _reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -17924,8 +18717,8 @@ function _reportReplicaHealth(partitionId, replicaId, serviceKind, healthInforma if (replicaId === null || replicaId === undefined || typeof replicaId.valueOf() !== 'string') { throw new Error('replicaId cannot be null or undefined and it must be of type string.'); } - if (serviceKind === null || serviceKind === undefined || typeof serviceKind.valueOf() !== 'string') { - throw new Error('serviceKind cannot be null or undefined and it must be of type string.'); + if (replicaHealthReportServiceKind === null || replicaHealthReportServiceKind === undefined || typeof replicaHealthReportServiceKind.valueOf() !== 'string') { + throw new Error('replicaHealthReportServiceKind cannot be null or undefined and it must be of type string.'); } if (healthInformation === null || healthInformation === undefined) { throw new Error('healthInformation cannot be null or undefined.'); @@ -17957,7 +18750,7 @@ function _reportReplicaHealth(partitionId, replicaId, serviceKind, healthInforma requestUrl = requestUrl.replace('{replicaId}', replicaId); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('ServiceKind=' + encodeURIComponent(serviceKind)); + queryParameters.push('ReplicaHealthReportServiceKind=' + encodeURIComponent(replicaHealthReportServiceKind)); if (immediate !== null && immediate !== undefined) { queryParameters.push('Immediate=' + encodeURIComponent(immediate.toString())); } @@ -18041,8 +18834,8 @@ function _reportReplicaHealth(partitionId, replicaId, serviceKind, healthInforma * @summary Gets the list of replicas deployed on a Service Fabric node. * * Gets the list containing the information about replicas deployed on a - * Service Fabric node. The information include partition id, replica id, - * status of the replica, name of the service, name of the service type and + * Service Fabric node. The information include partition ID, replica ID, + * status of the replica, name of the service, name of the service type, and * other information. Use PartitionId or ServiceManifestName query parameters * to return information about the deployed replicas matching the specified * values for those parameters. @@ -18052,8 +18845,9 @@ function _reportReplicaHealth(partitionId, replicaId, serviceKind, healthInforma * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -18064,9 +18858,9 @@ function _reportReplicaHealth(partitionId, replicaId, serviceKind, healthInforma * registered as part of an application type in a Service Fabric cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18243,9 +19037,9 @@ function _getDeployedServiceReplicaInfoList(nodeName, applicationId, options, ca * @summary Gets the details of replica deployed on a Service Fabric node. * * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * * @param {string} nodeName The name of the node. * @@ -18256,9 +19050,9 @@ function _getDeployedServiceReplicaInfoList(nodeName, applicationId, options, ca * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18408,9 +19202,9 @@ function _getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, * @summary Gets the details of replica deployed on a Service Fabric node. * * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * * @param {string} nodeName The name of the node. * @@ -18419,9 +19213,9 @@ function _getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18580,9 +19374,9 @@ function _getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18718,7 +19512,7 @@ function _restartReplica(nodeName, partitionId, replicaId, options, callback) { * of the replica from the cluster. This API tests the replica state removal * path, and simulates the report fault permanent path through client APIs. * Warning - There are no safety checks performed when this API is used. - * Incorrect use of this API can lead to data loss for stateful services.In + * Incorrect use of this API can lead to data loss for stateful services. In * addition, the forceRemove flag impacts all other replicas hosted in the same * process. * @@ -18737,9 +19531,9 @@ function _restartReplica(nodeName, partitionId, replicaId, options, callback) { * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18885,16 +19679,17 @@ function _removeReplica(nodeName, partitionId, replicaId, options, callback) { * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19062,8 +19857,9 @@ function _getDeployedServicePackageInfoList(nodeName, applicationId, options, ca * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -19071,9 +19867,9 @@ function _getDeployedServicePackageInfoList(nodeName, applicationId, options, ca * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19196,7 +19992,7 @@ function _getDeployedServicePackageInfoListByName(nodeName, applicationId, servi let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 204) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -19232,10 +20028,10 @@ function _getDeployedServicePackageInfoListByName(nodeName, applicationId, servi } /** - * @summary Gets the information about health of an service package for a + * @summary Gets the information about health of a service package for a * specific application deployed for a Service Fabric node and application. * - * Gets the information about health of service package for a specific + * Gets the information about health of a service package for a specific * application deployed on a Service Fabric node. Use EventsHealthStateFilter * to optionally filter for the collection of HealthEvent objects reported on * the deployed service package based on health state. @@ -19245,8 +20041,9 @@ function _getDeployedServicePackageInfoListByName(nodeName, applicationId, servi * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -19259,10 +20056,10 @@ function _getDeployedServicePackageInfoListByName(nodeName, applicationId, servi * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -19276,11 +20073,10 @@ function _getDeployedServicePackageInfoListByName(nodeName, applicationId, servi * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19437,7 +20233,7 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * @summary Gets the information about health of service package for a specific * application deployed on a Service Fabric node using the specified policy. * - * Gets the information about health of an service package for a specific + * Gets the information about health of a service package for a specific * application deployed on a Service Fabric node. using the specified policy. * Use EventsHealthStateFilter to optionally filter for the collection of * HealthEvent objects reported on the deployed service package based on health @@ -19447,14 +20243,14 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * the fields are ignored while evaluating the health of the deployed service * package. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -19467,10 +20263,10 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * following health states. * Only events that match the filter are returned. All events are used to * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are * returned. * * - Default - Default value. Matches any HealthState. The value is zero. @@ -19484,14 +20280,12 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * - All - Filter that matches input with any HealthState value. The value is * 65535. * - * * @param {object} [options.applicationHealthPolicy] Describes the health * policies used to evaluate the health of an application or one of its * children. * If not present, the health evaluation uses the health policy from * application manifest or the default health policy. * - * * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @@ -19508,9 +20302,9 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -19526,7 +20320,6 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -19541,7 +20334,6 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -19557,13 +20349,14 @@ function _getDeployedServicePackageHealth(nodeName, applicationId, servicePackag * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19748,14 +20541,14 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * service package health and check that the report appears in the HealthEvents * section. * - * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {string} servicePackageName The name of the service package. @@ -19764,9 +20557,8 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -19783,12 +20575,13 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -19800,7 +20593,6 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -19812,7 +20604,6 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -19820,10 +20611,9 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -19833,33 +20623,31 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20011,12 +20799,15 @@ function _reportDeployedServicePackageHealth(nodeName, applicationId, servicePac } /** - * @summary Downloads packages associated with specified service manifest to - * image cache on specified node. - * - * Downloads packages associated with specified service manifest to image cache - * on specified node. + * @summary Downloads all of the code packages associated with specified + * service manifest on the specified node. * + * This API provides a way to download code packages including the container + * images on a specific node outside of the normal application deployment and + * upgrade path. This is useful for the large code packages and container + * images to be present on the node before the actual application deployment + * and upgrade, thus significantly reducing the total time required for the + * deployment or upgrade. * * @param {string} nodeName The name of the node. * @@ -20024,21 +20815,26 @@ function _reportDeployedServicePackageHealth(nodeName, applicationId, servicePac * for deploying a service package to a Service Fabric node. * * @param {string} deployServicePackageToNodeDescription.serviceManifestName + * The name of service manifest whose packages need to be downloaded. * * @param {string} deployServicePackageToNodeDescription.applicationTypeName + * The application type name as defined in the application manifest. * * @param {string} deployServicePackageToNodeDescription.applicationTypeVersion + * The version of the application type as defined in the application manifest. * - * @param {string} deployServicePackageToNodeDescription.nodeName + * @param {string} deployServicePackageToNodeDescription.nodeName The name of a + * Service Fabric node. * * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] + * List of package sharing policy information. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20055,7 +20851,7 @@ function _reportDeployedServicePackageHealth(nodeName, applicationId, servicePac * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deployedServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, callback) { +function _deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -20185,8 +20981,9 @@ function _deployedServicePackageToNode(nodeName, deployServicePackageToNodeDescr * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. @@ -20199,9 +20996,9 @@ function _deployedServicePackageToNode(nodeName, deployServicePackageToNodeDescr * Fabric cluster. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20382,28 +21179,46 @@ function _getDeployedCodePackageInfoList(nodeName, applicationId, options, callb * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} restartDeployedCodePackageDescription Describes the deployed * code package on Service Fabric node to restart. * * @param {string} restartDeployedCodePackageDescription.serviceManifestName + * The name of service manifest that specified this code package. * * @param {string} - * [restartDeployedCodePackageDescription.servicePackageActivationId] + * [restartDeployedCodePackageDescription.servicePackageActivationId] The + * ActivationId of a deployed service package. If ServicePackageActivationMode + * specified at the time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. * - * @param {string} restartDeployedCodePackageDescription.codePackageName + * @param {string} restartDeployedCodePackageDescription.codePackageName The + * name of the code package defined in the service manifest. * * @param {string} restartDeployedCodePackageDescription.codePackageInstanceId + * The instance ID for currently running entry point. For a code package setup + * entry point (if specified) runs first and after it finishes main entry point + * is started. + * Each time entry point executable is run, its instance ID will change. If 0 + * is passed in as the code package instance ID, the API will restart the code + * package with whatever instance ID it is currently running. + * If an instance ID other than 0 is passed in, the API will restart the code + * package only if the current Instance ID matches the passed in instance ID. + * Note, passing in the exact instance ID (not 0) in the API is safer, because + * if ensures at most one restart of the code package. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20544,38 +21359,41 @@ function _restartDeployedCodePackage(nodeName, applicationId, restartDeployedCod } /** - * @summary Creates a Service Fabric compose deployment. + * @summary Gets the container logs for container deployed on a Service Fabric + * node. * - * Creates a Service Fabric compose deployment. + * Gets the container logs for container deployed on a Service Fabric node for + * the given code package. * - * @param {object} createComposeDeploymentDescription Describes the compose - * deployment that needs to be created. - * - * @param {string} createComposeDeploymentDescription.deploymentName + * @param {string} nodeName The name of the node. * - * @param {string} createComposeDeploymentDescription.composeFileContent The - * content of the compose file that describes the deployment to create. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {object} [createComposeDeploymentDescription.registryCredential] + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryUserName] The - * user name to connect to container registry. + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryPassword] The - * password for supplied username to connect to container registry. + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] - * Indicates that supplied container registry password is encrypted. + * @param {string} [options.tail] Number of lines to show from the end of the + * logs. Default is 100. 'all' to show the complete logs. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.previous] Specifies whether to get container logs + * from exited/dead containers of the code package instance. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20586,13 +21404,14 @@ function _restartDeployedCodePackage(nodeName, applicationId, restartDeployedCod * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerLogs} 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 _createComposeDeployment(createComposeDeploymentDescription, options, callback) { +function _getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -20602,12 +21421,29 @@ function _createComposeDeployment(createComposeDeploymentDescription, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let tail = (options && options.tail !== undefined) ? options.tail : undefined; + let previous = (options && options.previous !== undefined) ? options.previous : false; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0-preview'; + let apiVersion = '6.2'; // Validate try { - if (createComposeDeploymentDescription === null || createComposeDeploymentDescription === undefined) { - throw new Error('createComposeDeploymentDescription cannot be null or undefined.'); + if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { + throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + } + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (serviceManifestName === null || serviceManifestName === undefined || typeof serviceManifestName.valueOf() !== 'string') { + throw new Error('serviceManifestName cannot be null or undefined and it must be of type string.'); + } + if (codePackageName === null || codePackageName === undefined || typeof codePackageName.valueOf() !== 'string') { + throw new Error('codePackageName cannot be null or undefined and it must be of type string.'); + } + if (tail !== null && tail !== undefined && typeof tail.valueOf() !== 'string') { + throw new Error('tail must be of type string.'); + } + if (previous !== null && previous !== undefined && typeof previous !== 'boolean') { + throw new Error('previous must be of type boolean.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -20628,9 +21464,19 @@ function _createComposeDeployment(createComposeDeploymentDescription, options, c // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ComposeDeployments/$/Create'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs'; + requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + requestUrl = requestUrl.replace('{applicationId}', applicationId); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('ServiceManifestName=' + encodeURIComponent(serviceManifestName)); + queryParameters.push('CodePackageName=' + encodeURIComponent(codePackageName)); + if (tail !== null && tail !== undefined) { + queryParameters.push('Tail=' + encodeURIComponent(tail)); + } + if (previous !== null && previous !== undefined) { + queryParameters.push('Previous=' + encodeURIComponent(previous.toString())); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -20640,7 +21486,7 @@ function _createComposeDeployment(createComposeDeploymentDescription, options, c // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20652,28 +21498,14 @@ function _createComposeDeployment(createComposeDeploymentDescription, options, c } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (createComposeDeploymentDescription !== null && createComposeDeploymentDescription !== undefined) { - let requestModelMapper = new client.models['CreateComposeDeploymentDescription']().mapper(); - requestModel = client.serialize(requestModelMapper, createComposeDeploymentDescription, 'createComposeDeploymentDescription'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(createComposeDeploymentDescription, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20702,27 +21534,76 @@ function _createComposeDeployment(createComposeDeploymentDescription, options, c // 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['ContainerLogs']().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 Gets information about a Service Fabric compose deployment. + * @summary Invoke container API on a container deployed on a Service Fabric + * node. * - * Returns the status of the compose deployment that was created or in the - * process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * status and other details about the deployment. + * Invoke container API on a container deployed on a Service Fabric node for + * the given code package. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. + * + * @param {string} codePackageInstanceId ID that uniquely identifies a code + * package instance deployed on a service fabric node. + * + * @param {object} containerApiRequestBody Parameters for making container API + * call + * + * @param {string} [containerApiRequestBody.httpVerb] HTTP verb of container + * REST API, defaults to "GET" + * + * @param {string} containerApiRequestBody.uriPath URI path of container REST + * API + * + * @param {string} [containerApiRequestBody.contentType] Content type of + * container REST API request, defaults to "application/json" + * + * @param {string} [containerApiRequestBody.body] HTTP request body of + * container REST API * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20734,14 +21615,13 @@ function _createComposeDeployment(createComposeDeploymentDescription, options, c * {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 ComposeDeploymentStatusInfo} for more - * information. + * See {@link ContainerApiResponse} 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 _getComposeDeploymentStatus(deploymentName, options, callback) { +function _invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -20752,11 +21632,23 @@ function _getComposeDeploymentStatus(deploymentName, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0-preview'; + let apiVersion = '6.2'; // Validate try { - if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { - throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { + throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + } + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (serviceManifestName === null || serviceManifestName === undefined || typeof serviceManifestName.valueOf() !== 'string') { + throw new Error('serviceManifestName cannot be null or undefined and it must be of type string.'); + } + if (codePackageName === null || codePackageName === undefined || typeof codePackageName.valueOf() !== 'string') { + throw new Error('codePackageName cannot be null or undefined and it must be of type string.'); + } + if (codePackageInstanceId === null || codePackageInstanceId === undefined || typeof codePackageInstanceId.valueOf() !== 'string') { + throw new Error('codePackageInstanceId cannot be null or undefined and it must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -20771,16 +21663,23 @@ function _getComposeDeploymentStatus(deploymentName, options, callback) { throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); } } + if (containerApiRequestBody === null || containerApiRequestBody === undefined) { + throw new Error('containerApiRequestBody cannot be null or undefined.'); + } } catch (error) { return callback(error); } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ComposeDeployments/{deploymentName}'; - requestUrl = requestUrl.replace('{deploymentName}', deploymentName); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi'; + requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + requestUrl = requestUrl.replace('{applicationId}', applicationId); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('ServiceManifestName=' + encodeURIComponent(serviceManifestName)); + queryParameters.push('CodePackageName=' + encodeURIComponent(codePackageName)); + queryParameters.push('CodePackageInstanceId=' + encodeURIComponent(codePackageInstanceId)); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -20790,7 +21689,7 @@ function _getComposeDeploymentStatus(deploymentName, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20802,7 +21701,21 @@ function _getComposeDeploymentStatus(deploymentName, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (containerApiRequestBody !== null && containerApiRequestBody !== undefined) { + let requestModelMapper = new client.models['ContainerApiRequestBody']().mapper(); + requestModel = client.serialize(requestModelMapper, containerApiRequestBody, 'containerApiRequestBody'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(containerApiRequestBody, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -20845,7 +21758,7 @@ function _getComposeDeploymentStatus(deploymentName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ComposeDeploymentStatusInfo']().mapper(); + let resultMapper = new client.models['ContainerApiResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20861,38 +21774,43 @@ function _getComposeDeploymentStatus(deploymentName, options, callback) { } /** - * @summary Gets the list of compose deployments created in the Service Fabric - * cluster. + * @summary Creates a Service Fabric compose deployment. * - * Gets the status about the compose deployments that were created or in the - * process of being created in the Service Fabric cluster. The response - * includes the name, status and other details about the compose deployments. - * If the list of deployments do not fit in a page, one page of results is - * returned as well as a continuation token which can be used to get the next - * page. + * Compose is a file format that describes multi-container applications. This + * API allows deploying container based applications defined in compose format + * in a Service Fabric cluster. Once the deployment is created, its status can + * be tracked via the `GetComposeDeploymentStatus` API. * - * @param {object} [options] Optional Parameters. + * @param {object} createComposeDeploymentDescription Describes the compose + * deployment that needs to be created. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {string} createComposeDeploymentDescription.deploymentName The name + * of the deployment. * - * @param {number} [options.maxResults] The maximum number of results to be - * returned as part of the paged queries. This parameter defines the upper - * bound on the number of results returned. The results returned can be less - * than the specified maximum results if they do not fit in the message as per - * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * @param {string} createComposeDeploymentDescription.composeFileContent The + * content of the compose file that describes the deployment to create. + * + * @param {object} [createComposeDeploymentDescription.registryCredential] + * Credential information to connect to container registry. + * + * @param {string} + * [createComposeDeploymentDescription.registryCredential.registryUserName] The + * user name to connect to container registry. + * + * @param {string} + * [createComposeDeploymentDescription.registryCredential.registryPassword] The + * password for supplied username to connect to container registry. + * + * @param {boolean} + * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] + * Indicates that supplied container registry password is encrypted. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20903,15 +21821,13 @@ function _getComposeDeploymentStatus(deploymentName, 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 PagedComposeDeploymentStatusInfoList} 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 _getComposeDeploymentStatusList(options, callback) { +function _createComposeDeployment(createComposeDeploymentDescription, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -20921,23 +21837,12 @@ function _getComposeDeploymentStatusList(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; - let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0-preview'; // Validate try { - if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { - throw new Error('continuationToken must be of type string.'); - } - if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { - throw new Error('maxResults must be of type number.'); - } - if (maxResults !== null && maxResults !== undefined) { - if (maxResults < 0) - { - throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); - } + if (createComposeDeploymentDescription === null || createComposeDeploymentDescription === undefined) { + throw new Error('createComposeDeploymentDescription cannot be null or undefined.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -20958,15 +21863,9 @@ function _getComposeDeploymentStatusList(options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ComposeDeployments'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ComposeDeployments/$/Create'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (continuationToken !== null && continuationToken !== undefined) { - queryParameters.push('ContinuationToken=' + continuationToken); - } - if (maxResults !== null && maxResults !== undefined) { - queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); - } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -20976,7 +21875,7 @@ function _getComposeDeploymentStatusList(options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20988,14 +21887,28 @@ function _getComposeDeploymentStatusList(options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (createComposeDeploymentDescription !== null && createComposeDeploymentDescription !== undefined) { + let requestModelMapper = new client.models['CreateComposeDeploymentDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, createComposeDeploymentDescription, 'createComposeDeploymentDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(createComposeDeploymentDescription, 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) { + if (statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21024,43 +21937,27 @@ function _getComposeDeploymentStatusList(options, callback) { // 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['PagedComposeDeploymentStatusInfoList']().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 Gets details for the latest upgrade performed on this Service - * Fabric compose deployment. + * @summary Gets information about a Service Fabric compose deployment. * - * Returns the information about the state of the compose deployment upgrade - * along with details to aid debugging application health issues. + * Returns the status of the compose deployment that was created or in the + * process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * status, and other details about the deployment. * * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21072,14 +21969,352 @@ function _getComposeDeploymentStatusList(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 ComposeDeploymentUpgradeProgressInfo} for - * more information. + * See {@link ComposeDeploymentStatusInfo} 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 _getComposeDeploymentUpgradeProgress(deploymentName, options, callback) { +function _getComposeDeploymentStatus(deploymentName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0-preview'; + // Validate + try { + if (deploymentName === null || deploymentName === undefined || typeof deploymentName.valueOf() !== 'string') { + throw new Error('deploymentName cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ComposeDeployments/{deploymentName}'; + requestUrl = requestUrl.replace('{deploymentName}', deploymentName); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['ComposeDeploymentStatusInfo']().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 Gets the list of compose deployments created in the Service Fabric + * cluster. + * + * Gets the status about the compose deployments that were created or in the + * process of being created in the Service Fabric cluster. The response + * includes the name, status, and other details about the compose deployments. + * If the list of deployments do not fit in a page, one page of results is + * returned as well as a continuation token, which can be used to get the next + * page. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PagedComposeDeploymentStatusInfoList} 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 _getComposeDeploymentStatusList(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0-preview'; + // Validate + try { + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ComposeDeployments'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedComposeDeploymentStatusInfoList']().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 Gets details for the latest upgrade performed on this Service + * Fabric compose deployment. + * + * Returns the information about the state of the compose deployment upgrade + * along with details to aid debugging application health issues. + * + * @param {string} deploymentName The identity of the deployment. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 ComposeDeploymentUpgradeProgressInfo} 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 _getComposeDeploymentUpgradeProgress(deploymentName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -21208,9 +22443,9 @@ function _getComposeDeploymentUpgradeProgress(deploymentName, options, callback) * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21341,12 +22576,14 @@ function _removeComposeDeployment(deploymentName, options, callback) { * @param {object} composeDeploymentUpgradeDescription Parameters for upgrading * compose deployment. * - * @param {string} composeDeploymentUpgradeDescription.deploymentName + * @param {string} composeDeploymentUpgradeDescription.deploymentName The name + * of the deployment. * * @param {string} composeDeploymentUpgradeDescription.composeFileContent The * content of the compose file that describes the deployment to create. * * @param {object} [composeDeploymentUpgradeDescription.registryCredential] + * Credential information to connect to container registry. * * @param {string} * [composeDeploymentUpgradeDescription.registryCredential.registryUserName] @@ -21360,41 +22597,81 @@ function _removeComposeDeployment(deploymentName, options, callback) { * [composeDeploymentUpgradeDescription.registryCredential.passwordEncrypted] * Indicates that supplied container registry password is encrypted. * - * @param {string} composeDeploymentUpgradeDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' + * @param {string} composeDeploymentUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' * * @param {number} * [composeDeploymentUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * 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} [composeDeploymentUpgradeDescription.forceRestart] + * @param {boolean} [composeDeploymentUpgradeDescription.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} [composeDeploymentUpgradeDescription.monitoringPolicy] + * Describes the parameters for monitoring an upgrade in Monitored mode. * * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy] + * [composeDeploymentUpgradeDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * * @param {boolean} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.considerWarningAsError] @@ -21413,9 +22690,9 @@ function _removeComposeDeployment(deploymentName, options, callback) { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * - * * @param {object} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] @@ -21431,7 +22708,6 @@ function _removeComposeDeployment(deploymentName, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * partitions. Default percentage is zero. * - * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed @@ -21446,7 +22722,6 @@ function _removeComposeDeployment(deploymentName, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * replicas. Default percentage is zero. * - * * @param {number} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum maximum allowed percentage of unhealthy services. Allowed values @@ -21462,16 +22737,17 @@ function _removeComposeDeployment(deploymentName, options, callback) { * The computation rounds up to tolerate one failure on small numbers of * services. Default percentage is zero. * - * * @param {array} * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21607,6 +22883,151 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade }); } +/** + * @summary Get the status of Chaos. + * + * Get the status of Chaos indicating whether or not Chaos is running, the + * Chaos parameters used for running Chaos and the status of the Chaos + * Schedule. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 Chaos} 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 _getChaos(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Tools/Chaos'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['Chaos']().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 Starts Chaos in the cluster. * @@ -21614,11 +23035,10 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade * passed in Chaos parameters. * If Chaos is already running when this call is made, the call fails with the * error code FABRIC_E_CHAOS_ALREADY_RUNNING. - * Please refer to the article [Induce controlled Chaos in Service Fabric - * clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) + * Refer to the article [Induce controlled Chaos in Service Fabric + * clusters](https://docs.microsoft.com/azure/service-fabric/service-fabric-controlled-chaos) * for more details. * - * * @param {object} chaosParameters Describes all the parameters to configure a * Chaos run. * @@ -21626,7 +23046,6 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade * for which Chaos will run before automatically stopping. The maximum allowed * value is 4,294,967,295 (System.UInt32.MaxValue). * - * * @param {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] * The maximum amount of time to wait for all cluster entities to become stable * and healthy. Chaos executes in iterations and at the start of each iteration @@ -21635,21 +23054,18 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed * event. * - * * @param {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults is * the maximum number of concurrent faults induced per iteration. * Chaos executes in iterations and two consecutive iterations are separated by * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. * The recommendation is to start with a value of 2 or 3 and to exercise * caution while moving up. * - * * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or * disables the move primary and move secondary faults. * - * * @param {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait time * (in seconds) between consecutive faults within a single iteration. * The larger the value, the lower the overlapping between faults and the @@ -21657,13 +23073,15 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade * The recommendation is to start with a value between 1 and 5 and exercise * caution while moving up. * - * * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] * Time-separation (in seconds) between two consecutive iterations of Chaos. * The larger the value, the lower the fault injection rate. * - * - * @param {object} [chaosParameters.clusterHealthPolicy] + * @param {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected exception + * happens during fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. * * @param {boolean} * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates @@ -21686,7 +23104,6 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade * In large clusters, some nodes will always be down or out for repairs, so * this percentage should be configured to tolerate that. * - * * @param {number} * [chaosParameters.clusterHealthPolicy.maxPercentUnhealthyApplications] The * maximum allowed percentage of unhealthy applications before reporting an @@ -21704,20 +23121,88 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade * The computation rounds up to tolerate one failure on small numbers of * applications. Default percentage is zero. * - * * @param {array} - * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * - * @param {object} [chaosParameters.context] - * - * @param {object} [chaosParameters.context.map] + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used to + * record information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * + * @param {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. + * + * @param {object} [chaosParameters.chaosTargetFilter] List of cluster entities + * to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * + * @param {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] A + * list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * + * @param {array} [chaosParameters.chaosTargetFilter.applicationInclusionList] + * A list of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21850,18 +23335,22 @@ function _startChaos(chaosParameters, options, callback) { } /** - * @summary Stops Chaos in the cluster if it is already running, otherwise it - * does nothing. + * @summary Stops Chaos if it is running in the cluster and put the Chaos + * Schedule in a stopped state. * - * Stops Chaos from scheduling further faults; but, the in-flight faults are - * not affected. + * Stops Chaos from executing new faults. In-flight faults will continue to + * execute until they are complete. The current Chaos Schedule is put into a + * stopped state. + * Once a schedule is stopped, it will stay in the stopped state and not be + * used to Chaos Schedule new runs of Chaos. A new Chaos Schedule must be set + * in order to resume scheduling. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21977,43 +23466,53 @@ function _stopChaos(options, callback) { } /** - * @summary Gets the next segment of the Chaos report based on the passed-in - * continuation token or the passed-in time-range. - * - * You can either specify the ContinuationToken to get the next segment of the - * Chaos report or you can specify the time-range - * through StartTimeUtc and EndTimeUtc, but you cannot specify both the - * ContinuationToken and the time-range in the same call. - * When there are more than 100 Chaos events, the Chaos report is returned in - * segments where a segment contains no more than 100 Chaos events. - * + * @summary Gets the next segment of the Chaos events based on the continuation + * token or the time range. + * + * To get the next segment of the Chaos events, you can specify the + * ContinuationToken. To get the start of a new segment of Chaos events, you + * can specify the time range + * through StartTimeUtc and EndTimeUtc. You cannot specify both the + * ContinuationToken and the time range in the same call. + * When there are more than 100 Chaos events, the Chaos events are returned in + * multiple segments where a segment contains no more than 100 Chaos events and + * to get the next segment you make a call to this API with the continuation + * token. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * - * @param {string} [options.startTimeUtc] The count of ticks representing the - * start time of the time range for which a Chaos report is to be generated. - * Please consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {string} [options.startTimeUtc] The Windows file time representing + * the start time of the time range for which a Chaos report is to be + * generated. Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. * - * @param {string} [options.endTimeUtc] The count of ticks representing the end - * time of the time range for which a Chaos report is to be generated. Please - * consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {string} [options.endTimeUtc] The Windows file time representing the + * end time of the time range for which a Chaos report is to be generated. + * Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22025,13 +23524,13 @@ function _stopChaos(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 ChaosReport} for more information. + * See {@link ChaosEventsSegment} 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 _getChaosReport(options, callback) { +function _getChaosEvents(options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -22044,8 +23543,9 @@ function _getChaosReport(options, callback) { let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; let startTimeUtc = (options && options.startTimeUtc !== undefined) ? options.startTimeUtc : undefined; let endTimeUtc = (options && options.endTimeUtc !== undefined) ? options.endTimeUtc : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let apiVersion = '6.2'; // Validate try { if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { @@ -22057,6 +23557,15 @@ function _getChaosReport(options, callback) { if (endTimeUtc !== null && endTimeUtc !== undefined && typeof endTimeUtc.valueOf() !== 'string') { throw new Error('endTimeUtc must be of type string.'); } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -22076,7 +23585,7 @@ function _getChaosReport(options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Tools/Chaos/$/Report'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Tools/Chaos/Events'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (continuationToken !== null && continuationToken !== undefined) { @@ -22088,6 +23597,9 @@ function _getChaosReport(options, callback) { if (endTimeUtc !== null && endTimeUtc !== undefined) { queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -22152,7 +23664,7 @@ function _getChaosReport(options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ChaosReport']().mapper(); + let resultMapper = new client.models['ChaosEventsSegment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22168,30 +23680,340 @@ function _getChaosReport(options, callback) { } /** - * @summary Uploads contents of the file to the image store. - * - * Uploads contents of the file to the image store. Use this API if the file is - * small enough to upload again if the connection fails. The file's data needs - * to be added to the request body. The contents will be uploaded to the - * specified path. Image store service uses a mark file to indicate the - * availability of the folder. The mark file is an empty file named "_.dir". - * The mark file is generated by the image store service when all files in a - * folder are uploaded. When using File-by-File approach to upload application - * package in REST, the image store service isn't aware of the file hierarchy - * of the application package; you need to create a mark file per folder and - * upload it last, to let the image store service know that the folder is - * complete. - * + * @summary Get the Chaos Schedule defining when and how to run Chaos. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that + * defines when and how to run Chaos. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 ChaosScheduleDescription} 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 _getChaosSchedule(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Tools/Chaos/Schedule'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['ChaosScheduleDescription']().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 Set the schedule used by Chaos. + * + * Chaos will automatically schedule runs based on the Chaos Schedule. + * The Chaos Schedule will be updated if the provided version matches the + * version on the server. + * When updating the Chaos Schedule, the version on the server is incremented + * by 1. + * The version on the server will wrap back to 0 after reaching a large number. + * If Chaos is running when this call is made, the call will fail. + * + * @param {object} chaosSchedule Describes the schedule used by Chaos. + * + * @param {number} [chaosSchedule.version] The version number of the Schedule. + * + * @param {object} [chaosSchedule.schedule] Defines the schedule used by Chaos. + * + * @param {date} [chaosSchedule.schedule.startDate] The date and time Chaos + * will start using this schedule. + * + * @param {date} [chaosSchedule.schedule.expiryDate] The date and time Chaos + * will continue to use this schedule until. + * + * @param {array} [chaosSchedule.schedule.chaosParametersDictionary] A mapping + * of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * + * @param {array} [chaosSchedule.schedule.jobs] A list of all Chaos Schedule + * Jobs that will be automated by the schedule. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _postChaosSchedule(chaosSchedule, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (chaosSchedule === null || chaosSchedule === undefined) { + throw new Error('chaosSchedule cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Tools/Chaos/Schedule'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (chaosSchedule !== null && chaosSchedule !== undefined) { + let requestModelMapper = new client.models['ChaosScheduleDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, chaosSchedule, 'chaosSchedule'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(chaosSchedule, 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['FabricError']().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); + }); +} + +/** + * @summary Uploads contents of the file to the image store. + * + * Uploads contents of the file to the image store. Use this API if the file is + * small enough to upload again if the connection fails. The file's data needs + * to be added to the request body. The contents will be uploaded to the + * specified path. Image store service uses a mark file to indicate the + * availability of the folder. The mark file is an empty file named "_.dir". + * The mark file is generated by the image store service when all files in a + * folder are uploaded. When using File-by-File approach to upload application + * package in REST, the image store service isn't aware of the file hierarchy + * of the application package; you need to create a mark file per folder and + * upload it last, to let the image store service know that the folder is + * complete. + * + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22314,7 +24136,7 @@ function _uploadFile(contentPath, options, callback) { * @summary Gets the image store content information. * * Returns the information about the image store content at the specified - * contentPath relative to the root of the image store. + * contentPath. The contentPath is relative to the root of the image store. * * @param {string} contentPath Relative path to file or folder in the image * store from its root. @@ -22322,9 +24144,9 @@ function _uploadFile(contentPath, options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22353,7 +24175,7 @@ function _getImageStoreContent(contentPath, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let apiVersion = '6.2'; // Validate try { if (contentPath === null || contentPath === undefined || typeof contentPath.valueOf() !== 'string') { @@ -22474,9 +24296,9 @@ function _getImageStoreContent(contentPath, options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22604,9 +24426,9 @@ function _deleteImageStoreContent(contentPath, options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22766,9 +24588,9 @@ function _getImageStoreRootContent(options, callback) { * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22901,37 +24723,21 @@ function _copyImageStoreContent(imageStoreCopyDescription, options, callback) { } /** - * @summary Invokes an administrative command on the given Infrastructure - * Service instance. + * @summary Cancels an image store upload session. * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific commands to a - * particular - * instance of the Infrastructure Service. + * The DELETE request will cause the existing upload session to expire and + * remove any previously uploaded file chunks. * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22942,13 +24748,13 @@ function _copyImageStoreContent(imageStoreCopyDescription, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {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 _invokeInfrastructureCommand(command, options, callback) { +function _deleteImageStoreUploadSession(sessionId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -22958,16 +24764,12 @@ function _invokeInfrastructureCommand(command, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let serviceId = (options && options.serviceId !== undefined) ? options.serviceId : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate try { - if (command === null || command === undefined || typeof command.valueOf() !== 'string') { - throw new Error('command cannot be null or undefined and it must be of type string.'); - } - if (serviceId !== null && serviceId !== undefined && typeof serviceId.valueOf() !== 'string') { - throw new Error('serviceId must be of type string.'); + if (sessionId === null || sessionId === undefined || typeof sessionId.valueOf() !== 'string' || !msRest.isValidUuid(sessionId)) { + throw new Error('sessionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -22988,13 +24790,10 @@ function _invokeInfrastructureCommand(command, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/InvokeInfrastructureCommand'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ImageStore/$/DeleteUploadSession'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('Command=' + encodeURIComponent(command)); - if (serviceId !== null && serviceId !== undefined) { - queryParameters.push('ServiceId=' + encodeURIComponent(serviceId)); - } + queryParameters.push('session-id=' + encodeURIComponent(sessionId.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -23004,7 +24803,7 @@ function _invokeInfrastructureCommand(command, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -23052,66 +24851,29 @@ function _invokeInfrastructureCommand(command, options, callback) { // 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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 Invokes a read-only query on the given infrastructure service - * instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific queries to a - * particular - * instance of the Infrastructure Service. + * @summary Commit an image store upload session. * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. + * When all file chunks have been uploaded, the upload session needs to be + * committed explicitly to complete the upload. Image store preserves the + * upload session until the expiration time, which is 30 minutes after the last + * chunk received. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23122,13 +24884,13 @@ function _invokeInfrastructureCommand(command, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {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 _invokeInfrastructureQuery(command, options, callback) { +function _commitImageStoreUploadSession(sessionId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -23138,16 +24900,12 @@ function _invokeInfrastructureQuery(command, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let serviceId = (options && options.serviceId !== undefined) ? options.serviceId : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate try { - if (command === null || command === undefined || typeof command.valueOf() !== 'string') { - throw new Error('command cannot be null or undefined and it must be of type string.'); - } - if (serviceId !== null && serviceId !== undefined && typeof serviceId.valueOf() !== 'string') { - throw new Error('serviceId must be of type string.'); + if (sessionId === null || sessionId === undefined || typeof sessionId.valueOf() !== 'string' || !msRest.isValidUuid(sessionId)) { + throw new Error('sessionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -23168,13 +24926,10 @@ function _invokeInfrastructureQuery(command, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/InvokeInfrastructureQuery'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ImageStore/$/CommitUploadSession'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('Command=' + encodeURIComponent(command)); - if (serviceId !== null && serviceId !== undefined) { - queryParameters.push('ServiceId=' + encodeURIComponent(serviceId)); - } + queryParameters.push('session-id=' + encodeURIComponent(sessionId.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -23184,7 +24939,7 @@ function _invokeInfrastructureQuery(command, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -23232,88 +24987,27 @@ function _invokeInfrastructureQuery(command, options, callback) { // 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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 This API will induce data loss for the specified partition. It will - * trigger a call to the OnDataLossAsync API of the partition. - * - * This API will induce data loss for the specified partition. It will trigger - * a call to the OnDataLoss API of the partition. - * Actual data loss will depend on the specified DataLossMode - * PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is - * triggered for the partition but actual data loss depends on the presence of - * in-flight replication. - * FullDataLoss - All replicas are removed hence all data is lost and - * OnDataLoss is triggered. + * @summary Get the image store upload session by ID. * - * This API should only be called with a stateful service as the target. - * - * Calling this API with a system service as the target is not advised. + * Gets the image store upload session identified by the given ID. User can + * query the upload session at any time during uploading. * - * Note: Once this API has been called, it cannot be reversed. Calling - * CancelOperation will only stop execution and clean up internal system state. - * It will not restore data if the command has progressed far enough to cause - * data loss. - * - * Call the GetDataLossProgress API with the same OperationId to return - * information on the operation started with this API. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API - * - * @param {string} dataLossMode This enum is passed to the StartDataLoss API to - * indicate what type of data loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - PartialDataLoss - PartialDataLoss option will cause a quorum of replicas - * to go down, triggering an OnDataLoss event in the system for the given - * partition. - * - FullDataLoss - FullDataLoss option will drop all the replicas which means - * that all the data will be lost. - * . Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23324,13 +25018,14 @@ function _invokeInfrastructureQuery(command, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link UploadSession} 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 _startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, callback) { +function _getImageStoreUploadSessionById(sessionId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -23344,17 +25039,8 @@ function _startDataLoss(serviceId, partitionId, operationId, dataLossMode, optio let apiVersion = '6.0'; // Validate try { - if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { - throw new Error('serviceId cannot be null or undefined and it must be of type string.'); - } - if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { - throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); - } - if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { - throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); - } - if (dataLossMode === null || dataLossMode === undefined || typeof dataLossMode.valueOf() !== 'string') { - throw new Error('dataLossMode cannot be null or undefined and it must be of type string.'); + if (sessionId === null || sessionId === undefined || typeof sessionId.valueOf() !== 'string' || !msRest.isValidUuid(sessionId)) { + throw new Error('sessionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -23375,13 +25061,10 @@ function _startDataLoss(serviceId, partitionId, operationId, dataLossMode, optio // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss'; - requestUrl = requestUrl.replace('{serviceId}', serviceId); - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ImageStore/$/GetUploadSession'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); - queryParameters.push('DataLossMode=' + encodeURIComponent(dataLossMode)); + queryParameters.push('session-id=' + encodeURIComponent(sessionId.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -23391,7 +25074,7 @@ function _startDataLoss(serviceId, partitionId, operationId, dataLossMode, optio // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -23410,7 +25093,7 @@ function _startDataLoss(serviceId, partitionId, operationId, dataLossMode, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -23439,37 +25122,44 @@ function _startDataLoss(serviceId, partitionId, operationId, dataLossMode, optio // 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['UploadSession']().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 Gets the progress of a partition data loss operation started using - * the StartDataLoss API. - * - * Gets the progress of a data loss operation started with StartDataLoss, using - * the OperationId. - * + * @summary Get the image store upload session by relative path. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. + * Gets the image store upload session associated with the given image store + * relative path. User can query the upload session at any time during + * uploading. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23481,14 +25171,13 @@ function _startDataLoss(serviceId, partitionId, operationId, dataLossMode, optio * {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 PartitionDataLossProgress} for more - * information. + * See {@link UploadSession} 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 _getDataLossProgress(serviceId, partitionId, operationId, options, callback) { +function _getImageStoreUploadSessionByPath(contentPath, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -23502,14 +25191,8 @@ function _getDataLossProgress(serviceId, partitionId, operationId, options, call let apiVersion = '6.0'; // Validate try { - if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { - throw new Error('serviceId cannot be null or undefined and it must be of type string.'); - } - if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { - throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); - } - if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { - throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (contentPath === null || contentPath === undefined || typeof contentPath.valueOf() !== 'string') { + throw new Error('contentPath cannot be null or undefined and it must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -23530,12 +25213,10 @@ function _getDataLossProgress(serviceId, partitionId, operationId, options, call // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress'; - requestUrl = requestUrl.replace('{serviceId}', serviceId); - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ImageStore/{contentPath}/$/GetUploadSession'; + requestUrl = requestUrl.replace('{contentPath}', encodeURIComponent(contentPath)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -23600,7 +25281,7 @@ function _getDataLossProgress(serviceId, partitionId, operationId, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PartitionDataLossProgress']().mapper(); + let resultMapper = new client.models['UploadSession']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23616,49 +25297,40 @@ function _getDataLossProgress(serviceId, partitionId, operationId, options, call } /** - * @summary Induces quorum loss for a given stateful service partition. - * - * Induces quorum loss for a given stateful service partition. This API is - * useful for a temporary quorum loss situation on your service. - * - * Call the GetQuorumLossProgress API with the same OperationId to return - * information on the operation started with this API. - * - * This can only be called on stateful persisted (HasPersistedState==true) - * services. Do not use this API on stateless services or stateful in-memory - * only services. - * + * @summary Uploads a file chunk to the image store relative path. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * Uploads a file chunk to the image store with the specified upload session ID + * and image store relative path. This API allows user to resume the file + * upload operation. user doesn't have to restart the file upload from scratch + * whenever there is a network interruption. Use this option if the file size + * is large. * - * @param {uuid} partitionId The identity of the partition. + * To perform a resumable file upload, user need to break the file into + * multiple chunks and upload these chunks to the image store one-by-one. + * Chunks don't have to be uploaded in order. If the file represented by the + * image store relative path already exists, it will be overwritten when the + * upload session commits. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * - * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss - * API to indicate what type of quorum loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - QuorumReplicas - Partial Quorum loss mode : Minimum number of replicas for - * a partition will be down that will cause a quorum loss. - * - AllReplicas- Full Quorum loss mode : All replicas for a partition will be - * down that will cause a quorum loss. - * . Possible values include: 'Invalid', 'QuorumReplicas', 'AllReplicas' + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * - * @param {number} quorumLossDuration The amount of time for which the - * partition will be kept in quorum loss. This must be specified in seconds. + * @param {string} contentRange When uploading file chunks to the image store, + * the Content-Range header field need to be configured and sent with a + * request. The format should looks like "bytes + * {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, + * Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300 + * through 5,000 and the total file length is 20,000 bytes. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23675,7 +25347,7 @@ function _getDataLossProgress(serviceId, partitionId, operationId, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, callback) { +function _uploadFileChunk(contentPath, sessionId, contentRange, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -23689,20 +25361,14 @@ function _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, q let apiVersion = '6.0'; // Validate try { - if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { - throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + if (contentPath === null || contentPath === undefined || typeof contentPath.valueOf() !== 'string') { + throw new Error('contentPath cannot be null or undefined and it must be of type string.'); } - if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { - throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (sessionId === null || sessionId === undefined || typeof sessionId.valueOf() !== 'string' || !msRest.isValidUuid(sessionId)) { + throw new Error('sessionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } - if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { - throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); - } - if (quorumLossMode === null || quorumLossMode === undefined || typeof quorumLossMode.valueOf() !== 'string') { - throw new Error('quorumLossMode cannot be null or undefined and it must be of type string.'); - } - if (quorumLossDuration === null || quorumLossDuration === undefined || typeof quorumLossDuration !== 'number') { - throw new Error('quorumLossDuration cannot be null or undefined and it must be of type number.'); + if (contentRange === null || contentRange === undefined || typeof contentRange.valueOf() !== 'string') { + throw new Error('contentRange cannot be null or undefined and it must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -23723,14 +25389,11 @@ function _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, q // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss'; - requestUrl = requestUrl.replace('{serviceId}', serviceId); - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'ImageStore/{contentPath}/$/UploadChunk'; + requestUrl = requestUrl.replace('{contentPath}', encodeURIComponent(contentPath)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); - queryParameters.push('QuorumLossMode=' + encodeURIComponent(quorumLossMode)); - queryParameters.push('QuorumLossDuration=' + encodeURIComponent(quorumLossDuration.toString())); + queryParameters.push('session-id=' + encodeURIComponent(sessionId.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -23740,11 +25403,14 @@ function _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, q // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (contentRange !== undefined && contentRange !== null) { + httpRequest.headers['Content-Range'] = contentRange; + } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { @@ -23759,7 +25425,7 @@ function _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, q return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -23794,31 +25460,36 @@ function _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, q } /** - * @summary Gets the progress of a quorum loss operation on a partition started - * using the StartQuorumLoss API. - * - * Gets the progress of a quorum loss operation started with StartQuorumLoss, - * using the provided OperationId. + * @summary Invokes an administrative command on the given Infrastructure + * Service instance. * + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific commands to a + * particular + * instance of the Infrastructure Service. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * - * @param {uuid} partitionId The identity of the partition. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23829,15 +25500,13 @@ function _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, q * * {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 PartitionQuorumLossProgress} for more - * information. + * {string} [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 _getQuorumLossProgress(serviceId, partitionId, operationId, options, callback) { +function _invokeInfrastructureCommand(command, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -23847,18 +25516,16 @@ function _getQuorumLossProgress(serviceId, partitionId, operationId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let serviceId = (options && options.serviceId !== undefined) ? options.serviceId : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate try { - if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { - throw new Error('serviceId cannot be null or undefined and it must be of type string.'); - } - if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { - throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (command === null || command === undefined || typeof command.valueOf() !== 'string') { + throw new Error('command cannot be null or undefined and it must be of type string.'); } - if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { - throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (serviceId !== null && serviceId !== undefined && typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -23879,12 +25546,13 @@ function _getQuorumLossProgress(serviceId, partitionId, operationId, options, ca // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress'; - requestUrl = requestUrl.replace('{serviceId}', serviceId); - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/InvokeInfrastructureCommand'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); + queryParameters.push('Command=' + encodeURIComponent(command)); + if (serviceId !== null && serviceId !== undefined) { + queryParameters.push('ServiceId=' + encodeURIComponent(serviceId)); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -23894,7 +25562,7 @@ function _getQuorumLossProgress(serviceId, partitionId, operationId, options, ca // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -23949,7 +25617,13 @@ function _getQuorumLossProgress(serviceId, partitionId, operationId, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PartitionQuorumLossProgress']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23965,44 +25639,36 @@ function _getQuorumLossProgress(serviceId, partitionId, operationId, options, ca } /** - * @summary This API will restart some or all replicas or instances of the - * specified partition. - * - * This API is useful for testing failover. - * - * If used to target a stateless service partition, RestartPartitionMode must - * be AllReplicasOrInstances. - * - * Call the GetPartitionRestartProgress API using the same OperationId to get - * the progress. - * + * @summary Invokes a read-only query on the given infrastructure service + * instance. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific queries to a + * particular + * instance of the Infrastructure Service. * - * @param {uuid} partitionId The identity of the partition. + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {string} restartPartitionMode - Invalid - Reserved. Do not pass into - * API. - * - AllReplicasOrInstances - All replicas or instances in the partition are - * restarted at once. - * - OnlyActiveSecondaries - Only the secondary replicas are restarted. - * . Possible values include: 'Invalid', 'AllReplicasOrInstances', - * 'OnlyActiveSecondaries' + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24013,13 +25679,13 @@ function _getQuorumLossProgress(serviceId, partitionId, operationId, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {string} [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 _startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, callback) { +function _invokeInfrastructureQuery(command, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -24029,21 +25695,16 @@ function _startPartitionRestart(serviceId, partitionId, operationId, restartPart if (!callback) { throw new Error('callback cannot be null.'); } + let serviceId = (options && options.serviceId !== undefined) ? options.serviceId : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; let apiVersion = '6.0'; // Validate try { - if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { - throw new Error('serviceId cannot be null or undefined and it must be of type string.'); - } - if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { - throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); - } - if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { - throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (command === null || command === undefined || typeof command.valueOf() !== 'string') { + throw new Error('command cannot be null or undefined and it must be of type string.'); } - if (restartPartitionMode === null || restartPartitionMode === undefined || typeof restartPartitionMode.valueOf() !== 'string') { - throw new Error('restartPartitionMode cannot be null or undefined and it must be of type string.'); + if (serviceId !== null && serviceId !== undefined && typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -24064,13 +25725,13 @@ function _startPartitionRestart(serviceId, partitionId, operationId, restartPart // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart'; - requestUrl = requestUrl.replace('{serviceId}', serviceId); - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '$/InvokeInfrastructureQuery'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); - queryParameters.push('RestartPartitionMode=' + encodeURIComponent(restartPartitionMode)); + queryParameters.push('Command=' + encodeURIComponent(command)); + if (serviceId !== null && serviceId !== undefined) { + queryParameters.push('ServiceId=' + encodeURIComponent(serviceId)); + } if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -24080,7 +25741,7 @@ function _startPartitionRestart(serviceId, partitionId, operationId, restartPart // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24099,7 +25760,7 @@ function _startPartitionRestart(serviceId, partitionId, operationId, restartPart return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -24128,23 +25789,65 @@ function _startPartitionRestart(serviceId, partitionId, operationId, restartPart // 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 Gets the progress of a PartitionRestart operation started using - * StartPartitionRestart. + * @summary This API will induce data loss for the specified partition. It will + * trigger a call to the OnDataLossAsync API of the partition. * - * Gets the progress of a PartitionRestart started with StartPartitionRestart - * using the provided OperationId. + * This API will induce data loss for the specified partition. It will trigger + * a call to the OnDataLoss API of the partition. + * Actual data loss will depend on the specified DataLossMode. + * + * - PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is + * triggered for the partition but actual data loss depends on the presence of + * in-flight replication. + * - FullDataLoss - All replicas are removed hence all data is lost and + * OnDataLoss is triggered. + * + * This API should only be called with a stateful service as the target. * + * Calling this API with a system service as the target is not advised. + * + * Note: Once this API has been called, it cannot be reversed. Calling + * CancelOperation will only stop execution and clean up internal system state. + * It will not restore data if the command has progressed far enough to cause + * data loss. + * + * Call the GetDataLossProgress API with the same OperationId to return + * information on the operation started with this API. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * @@ -24153,12 +25856,16 @@ function _startPartitionRestart(serviceId, partitionId, operationId, restartPart * @param {uuid} operationId A GUID that identifies a call of this API. This * is passed into the corresponding GetProgress API * + * @param {string} dataLossMode This enum is passed to the StartDataLoss API to + * indicate what type of data loss to induce. Possible values include: + * 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24169,15 +25876,13 @@ function _startPartitionRestart(serviceId, partitionId, operationId, restartPart * * {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 PartitionRestartProgress} 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 _getPartitionRestartProgress(serviceId, partitionId, operationId, options, callback) { +function _startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -24200,6 +25905,9 @@ function _getPartitionRestartProgress(serviceId, partitionId, operationId, optio if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } + if (dataLossMode === null || dataLossMode === undefined || typeof dataLossMode.valueOf() !== 'string') { + throw new Error('dataLossMode cannot be null or undefined and it must be of type string.'); + } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -24219,12 +25927,13 @@ function _getPartitionRestartProgress(serviceId, partitionId, operationId, optio // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss'; requestUrl = requestUrl.replace('{serviceId}', serviceId); requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); + queryParameters.push('DataLossMode=' + encodeURIComponent(dataLossMode)); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -24234,7 +25943,7 @@ function _getPartitionRestartProgress(serviceId, partitionId, operationId, optio // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24253,7 +25962,7 @@ function _getPartitionRestartProgress(serviceId, partitionId, operationId, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -24282,67 +25991,37 @@ function _getPartitionRestartProgress(serviceId, partitionId, operationId, optio // 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['PartitionRestartProgress']().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 Starts or stops a cluster node. + * @summary Gets the progress of a partition data loss operation started using + * the StartDataLoss API. * - * Starts or stops a cluster node. A cluster node is a process, not the OS - * instance itself. To start a node, pass in "Start" for the - * NodeTransitionType parameter. - * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This - * API starts the operation - when the API returns the node may not have - * finished transitioning yet. - * Call GetNodeTransitionProgress with the same OperationId to get the progress - * of the operation. + * Gets the progress of a data loss operation started with StartDataLoss, using + * the OperationId. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. * * @param {uuid} operationId A GUID that identifies a call of this API. This * is passed into the corresponding GetProgress API * - * @param {string} nodeTransitionType Indicates the type of transition to - * perform. NodeTransitionType.Start will start a stopped node. - * NodeTransitionType.Stop will stop a node that is up. - * - Invalid - Reserved. Do not pass into API. - * - Start - Transition a stopped node to up. - * - Stop - Transition an up node to stopped. - * . Possible values include: 'Invalid', 'Start', 'Stop' - * - * @param {string} nodeInstanceId The node instance ID of the target node. - * This can be determined through GetNodeInfo API. - * - * @param {number} stopDurationInSeconds The duration, in seconds, to keep the - * node stopped. The minimum value is 600, the maximum is 14400. After this - * time expires, the node will automatically come back up. - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24353,13 +26032,15 @@ function _getPartitionRestartProgress(serviceId, partitionId, operationId, optio * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionDataLossProgress} 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 _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, callback) { +function _getDataLossProgress(serviceId, partitionId, operationId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -24373,27 +26054,15 @@ function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeIns let apiVersion = '6.0'; // Validate try { - if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { - throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } - if (nodeTransitionType === null || nodeTransitionType === undefined || typeof nodeTransitionType.valueOf() !== 'string') { - throw new Error('nodeTransitionType cannot be null or undefined and it must be of type string.'); - } - if (nodeInstanceId === null || nodeInstanceId === undefined || typeof nodeInstanceId.valueOf() !== 'string') { - throw new Error('nodeInstanceId cannot be null or undefined and it must be of type string.'); - } - if (stopDurationInSeconds === null || stopDurationInSeconds === undefined || typeof stopDurationInSeconds !== 'number') { - throw new Error('stopDurationInSeconds cannot be null or undefined and it must be of type number.'); - } - if (stopDurationInSeconds !== null && stopDurationInSeconds !== undefined) { - if (stopDurationInSeconds < 0) - { - throw new Error('"stopDurationInSeconds" should satisfy the constraint - "InclusiveMinimum": 0'); - } - } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); } @@ -24413,14 +26082,12 @@ function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeIns // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Nodes/{nodeName}/$/StartTransition/'; - requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); - queryParameters.push('NodeTransitionType=' + encodeURIComponent(nodeTransitionType)); - queryParameters.push('NodeInstanceId=' + encodeURIComponent(nodeInstanceId)); - queryParameters.push('StopDurationInSeconds=' + encodeURIComponent(stopDurationInSeconds.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -24430,7 +26097,7 @@ function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeIns // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24449,7 +26116,7 @@ function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeIns return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -24478,20 +26145,216 @@ function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeIns // 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['PartitionDataLossProgress']().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 Gets the progress of an operation started using - * StartNodeTransition. + * @summary Induces quorum loss for a given stateful service partition. * - * Gets the progress of an operation started with StartNodeTransition using the - * provided OperationId. + * This API is useful for a temporary quorum loss situation on your service. + * + * Call the GetQuorumLossProgress API with the same OperationId to return + * information on the operation started with this API. * + * This can only be called on stateful persisted (HasPersistedState==true) + * services. Do not use this API on stateless services or stateful in-memory + * only services. * - * @param {string} nodeName The name of the node. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss + * API to indicate what type of quorum loss to induce. Possible values include: + * 'Invalid', 'QuorumReplicas', 'AllReplicas' + * + * @param {number} quorumLossDuration The amount of time for which the + * partition will be kept in quorum loss. This must be specified in seconds. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (quorumLossMode === null || quorumLossMode === undefined || typeof quorumLossMode.valueOf() !== 'string') { + throw new Error('quorumLossMode cannot be null or undefined and it must be of type string.'); + } + if (quorumLossDuration === null || quorumLossDuration === undefined || typeof quorumLossDuration !== 'number') { + throw new Error('quorumLossDuration cannot be null or undefined and it must be of type number.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); + queryParameters.push('QuorumLossMode=' + encodeURIComponent(quorumLossMode)); + queryParameters.push('QuorumLossDuration=' + encodeURIComponent(quorumLossDuration.toString())); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Gets the progress of a quorum loss operation on a partition started + * using the StartQuorumLoss API. + * + * Gets the progress of a quorum loss operation started with StartQuorumLoss, + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. * * @param {uuid} operationId A GUID that identifies a call of this API. This * is passed into the corresponding GetProgress API @@ -24499,9 +26362,9 @@ function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeIns * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24513,14 +26376,14 @@ function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeIns * {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 NodeTransitionProgress} for more + * See {@link PartitionQuorumLossProgress} 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 _getNodeTransitionProgress(nodeName, operationId, options, callback) { +function _getQuorumLossProgress(serviceId, partitionId, operationId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -24534,8 +26397,11 @@ function _getNodeTransitionProgress(nodeName, operationId, options, callback) { let apiVersion = '6.0'; // Validate try { - if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { - throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); @@ -24559,8 +26425,9 @@ function _getNodeTransitionProgress(nodeName, operationId, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Nodes/{nodeName}/$/GetTransitionProgress'; - requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); @@ -24628,7 +26495,7 @@ function _getNodeTransitionProgress(nodeName, operationId, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NodeTransitionProgress']().mapper(); + let resultMapper = new client.models['PartitionQuorumLossProgress']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24644,37 +26511,40 @@ function _getNodeTransitionProgress(nodeName, operationId, options, callback) { } /** - * @summary Gets a list of user-induced fault operations filtered by provided - * input. + * @summary This API will restart some or all replicas or instances of the + * specified partition. * - * Gets the a list of user-induced fault operations filtered by provided input. + * This API is useful for testing failover. * - * @param {number} typeFilter Used to filter on OperationType for user-induced - * operations. - * 65535 - select all - * 1 - select PartitionDataLoss. - * 2 - select PartitionQuorumLoss. - * 4 - select PartitionRestart. - * 8 - select NodeTransition. + * If used to target a stateless service partition, RestartPartitionMode must + * be AllReplicasOrInstances. * + * Call the GetPartitionRestartProgress API using the same OperationId to get + * the progress. * - * @param {number} stateFilter Used to filter on OperationState's for - * user-induced operations. - * 65535 - select All - * 1 - select Running - * 2 - select RollingBack - * 8 - select Completed - * 16 - select Faulted - * 32 - select Cancelled - * 64 - select ForceCancelled + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {string} restartPartitionMode Describe which partitions to restart. + * Possible values include: 'Invalid', 'AllReplicasOrInstances', + * 'OnlyActiveSecondaries' * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24685,13 +26555,13 @@ function _getNodeTransitionProgress(nodeName, operationId, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {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 _getFaultOperationList(typeFilter, stateFilter, options, callback) { +function _startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -24705,11 +26575,17 @@ function _getFaultOperationList(typeFilter, stateFilter, options, callback) { let apiVersion = '6.0'; // Validate try { - if (typeFilter === null || typeFilter === undefined || typeof typeFilter !== 'number') { - throw new Error('typeFilter cannot be null or undefined and it must be of type number.'); + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); } - if (stateFilter === null || stateFilter === undefined || typeof stateFilter !== 'number') { - throw new Error('stateFilter cannot be null or undefined and it must be of type number.'); + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (restartPartitionMode === null || restartPartitionMode === undefined || typeof restartPartitionMode.valueOf() !== 'string') { + throw new Error('restartPartitionMode cannot be null or undefined and it must be of type string.'); } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -24730,11 +26606,167 @@ function _getFaultOperationList(typeFilter, stateFilter, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('TypeFilter=' + encodeURIComponent(typeFilter.toString())); - queryParameters.push('StateFilter=' + encodeURIComponent(stateFilter.toString())); + queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); + queryParameters.push('RestartPartitionMode=' + encodeURIComponent(restartPartitionMode)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Gets the progress of a PartitionRestart operation started using + * StartPartitionRestart. + * + * Gets the progress of a PartitionRestart started with StartPartitionRestart + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PartitionRestartProgress} 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 _getPartitionRestartProgress(serviceId, partitionId, operationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -24799,21 +26831,7 @@ function _getFaultOperationList(typeFilter, stateFilter, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'OperationStatusElementType', - type: { - name: 'Composite', - className: 'OperationStatus' - } - } - } - }; + let resultMapper = new client.models['PartitionRestartProgress']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24829,49 +26847,40 @@ function _getFaultOperationList(typeFilter, stateFilter, options, callback) { } /** - * @summary Cancels a user-induced fault operation. - * - * The following is a list of APIs that start fault operations that may be - * cancelled using CancelOperation - - * - StartDataLoss - * - StartQuorumLoss - * - StartPartitionRestart - * - StartNodeTransition - * - * If force is false, then the specified user-induced operation will be - * gracefully stopped and cleaned up. If force is true, the command will be - * aborted, and some internal state - * may be left behind. Specifying force as true should be used with care. - * Calling this API with force set to true is not allowed until this API has - * already - * been called on the same test command with force set to false first, or - * unless the test command already has an OperationState of - * OperationState.RollingBack. - * Clarification: OperationState.RollingBack means that the system will/is be - * cleaning up internal system state caused by executing the command. It will - * not restore data if the - * test command was to cause data loss. For example, if you call StartDataLoss - * then call this API, the system will only clean up internal state from - * running the command. - * It will not restore the target partition's data, if the command progressed - * far enough to cause data loss. + * @summary Starts or stops a cluster node. * - * Important note: if this API is invoked with force==true, internal state may - * be left behind. + * Starts or stops a cluster node. A cluster node is a process, not the OS + * instance itself. To start a node, pass in "Start" for the + * NodeTransitionType parameter. + * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This + * API starts the operation - when the API returns the node may not have + * finished transitioning yet. + * Call GetNodeTransitionProgress with the same OperationId to get the progress + * of the operation. * + * @param {string} nodeName The name of the node. * * @param {uuid} operationId A GUID that identifies a call of this API. This * is passed into the corresponding GetProgress API * - * @param {boolean} force Indicates whether to gracefully rollback and clean up - * internal system state modified by executing the user-induced operation. + * @param {string} nodeTransitionType Indicates the type of transition to + * perform. NodeTransitionType.Start will start a stopped node. + * NodeTransitionType.Stop will stop a node that is up. Possible values + * include: 'Invalid', 'Start', 'Stop' + * + * @param {string} nodeInstanceId The node instance ID of the target node. + * This can be determined through GetNodeInfo API. + * + * @param {number} stopDurationInSeconds The duration, in seconds, to keep the + * node stopped. The minimum value is 600, the maximum is 14400. After this + * time expires, the node will automatically come back up. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24888,7 +26897,7 @@ function _getFaultOperationList(typeFilter, stateFilter, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _cancelOperation(operationId, force, options, callback) { +function _startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -24902,11 +26911,26 @@ function _cancelOperation(operationId, force, options, callback) { let apiVersion = '6.0'; // Validate try { + if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { + throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + } if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } - if (force === null || force === undefined || typeof force !== 'boolean') { - throw new Error('force cannot be null or undefined and it must be of type boolean.'); + if (nodeTransitionType === null || nodeTransitionType === undefined || typeof nodeTransitionType.valueOf() !== 'string') { + throw new Error('nodeTransitionType cannot be null or undefined and it must be of type string.'); + } + if (nodeInstanceId === null || nodeInstanceId === undefined || typeof nodeInstanceId.valueOf() !== 'string') { + throw new Error('nodeInstanceId cannot be null or undefined and it must be of type string.'); + } + if (stopDurationInSeconds === null || stopDurationInSeconds === undefined || typeof stopDurationInSeconds !== 'number') { + throw new Error('stopDurationInSeconds cannot be null or undefined and it must be of type number.'); + } + if (stopDurationInSeconds !== null && stopDurationInSeconds !== undefined) { + if (stopDurationInSeconds < 0) + { + throw new Error('"stopDurationInSeconds" should satisfy the constraint - "InclusiveMinimum": 0'); + } } if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { throw new Error('timeout must be of type number.'); @@ -24927,11 +26951,14 @@ function _cancelOperation(operationId, force, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/$/Cancel'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Nodes/{nodeName}/$/StartTransition/'; + requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); - queryParameters.push('Force=' + encodeURIComponent(force.toString())); + queryParameters.push('NodeTransitionType=' + encodeURIComponent(nodeTransitionType)); + queryParameters.push('NodeInstanceId=' + encodeURIComponent(nodeInstanceId)); + queryParameters.push('StopDurationInSeconds=' + encodeURIComponent(stopDurationInSeconds.toString())); if (timeout !== null && timeout !== undefined) { queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); } @@ -24960,7 +26987,7 @@ function _cancelOperation(operationId, force, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -24994,204 +27021,22451 @@ function _cancelOperation(operationId, force, options, callback) { }); } -/** Class representing a ServiceFabricClient. */ -class ServiceFabricClient extends ServiceClient { - /** - * Create a ServiceFabricClient. - * @param {string} [baseUri] - The base URI of the service. - * @param {object} [options] - The parameter options - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * @param {object} [options.requestOptions] - Options for the underlying request object - * {@link https://github.com/request/request#requestoptions-callback Options doc} - * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - */ - constructor(baseUri, options) { - - if (!options) options = {}; - - super(null, options); - - this.baseUri = baseUri; +/** + * @summary Gets the progress of an operation started using + * StartNodeTransition. + * + * Gets the progress of an operation started with StartNodeTransition using the + * provided OperationId. + * + * @param {string} nodeName The name of the node. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 NodeTransitionProgress} 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 _getNodeTransitionProgress(nodeName, operationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { + throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/Nodes/{nodeName}/$/GetTransitionProgress'; + requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['NodeTransitionProgress']().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 Gets a list of user-induced fault operations filtered by provided + * input. + * + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param {number} typeFilter Used to filter on OperationType for user-induced + * operations. + * + * - 65535 - select all + * - 1 - select PartitionDataLoss. + * - 2 - select PartitionQuorumLoss. + * - 4 - select PartitionRestart. + * - 8 - select NodeTransition. + * + * @param {number} stateFilter Used to filter on OperationState's for + * user-induced operations. + * + * - 65535 - select All + * - 1 - select Running + * - 2 - select RollingBack + * - 8 - select Completed + * - 16 - select Faulted + * - 32 - select Cancelled + * - 64 - select ForceCancelled + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + * + * {array} [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 _getFaultOperationList(typeFilter, stateFilter, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (typeFilter === null || typeFilter === undefined || typeof typeFilter !== 'number') { + throw new Error('typeFilter cannot be null or undefined and it must be of type number.'); + } + if (stateFilter === null || stateFilter === undefined || typeof stateFilter !== 'number') { + throw new Error('stateFilter cannot be null or undefined and it must be of type number.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('TypeFilter=' + encodeURIComponent(typeFilter.toString())); + queryParameters.push('StateFilter=' + encodeURIComponent(stateFilter.toString())); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationStatusElementType', + type: { + name: 'Composite', + className: 'OperationStatus' + } + } + } + }; + 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 Cancels a user-induced fault operation. + * + * The following APIs start fault operations that may be cancelled by using + * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, + * StartNodeTransition. + * + * If force is false, then the specified user-induced operation will be + * gracefully stopped and cleaned up. If force is true, the command will be + * aborted, and some internal state + * may be left behind. Specifying force as true should be used with care. + * Calling this API with force set to true is not allowed until this API has + * already + * been called on the same test command with force set to false first, or + * unless the test command already has an OperationState of + * OperationState.RollingBack. + * Clarification: OperationState.RollingBack means that the system will be/is + * cleaning up internal system state caused by executing the command. It will + * not restore data if the + * test command was to cause data loss. For example, if you call StartDataLoss + * then call this API, the system will only clean up internal state from + * running the command. + * It will not restore the target partition's data, if the command progressed + * far enough to cause data loss. + * + * Important note: if this API is invoked with force==true, internal state may + * be left behind. + * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {boolean} force Indicates whether to gracefully rollback and clean up + * internal system state modified by executing the user-induced operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _cancelOperation(operationId, force, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (force === null || force === undefined || typeof force !== 'boolean') { + throw new Error('force cannot be null or undefined and it must be of type boolean.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Faults/$/Cancel'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('OperationId=' + encodeURIComponent(operationId.toString())); + queryParameters.push('Force=' + encodeURIComponent(force.toString())); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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); + }); +} + +/** + * @summary Creates a backup policy. + * + * Creates a backup policy which can be associated later with a Service Fabric + * application, service or a partition for periodic backup. + * + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _createBackupPolicy(backupPolicyDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (backupPolicyDescription === null || backupPolicyDescription === undefined) { + throw new Error('backupPolicyDescription cannot be null or undefined.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'BackupRestore/BackupPolicies/$/Create'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (backupPolicyDescription !== null && backupPolicyDescription !== undefined) { + let requestModelMapper = new client.models['BackupPolicyDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, backupPolicyDescription, 'backupPolicyDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(backupPolicyDescription, 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 !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['FabricError']().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); + }); +} + +/** + * @summary Deletes the backup policy. + * + * Deletes an existing backup policy. A backup policy must be created before it + * can be deleted. A currently active backup policy, associated with any + * Service Fabric application, service or partition, cannot be deleted without + * first deleting the mapping. + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _deleteBackupPolicy(backupPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (backupPolicyName === null || backupPolicyName === undefined || typeof backupPolicyName.valueOf() !== 'string') { + throw new Error('backupPolicyName cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'BackupRestore/BackupPolicies/{backupPolicyName}/$/Delete'; + requestUrl = requestUrl.replace('{backupPolicyName}', encodeURIComponent(backupPolicyName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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); + }); +} + +/** + * @summary Gets all the backup policies configured. + * + * Get a list of all the backup policies configured. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PagedBackupPolicyDescriptionList} 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 _getBackupPolicyList(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'BackupRestore/BackupPolicies'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedBackupPolicyDescriptionList']().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 Gets a particular backup policy by name. + * + * Gets a particular backup policy identified by {backupPolicyName} + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 BackupPolicyDescription} 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 _getBackupPolicyByName(backupPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (backupPolicyName === null || backupPolicyName === undefined || typeof backupPolicyName.valueOf() !== 'string') { + throw new Error('backupPolicyName cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'BackupRestore/BackupPolicies/{backupPolicyName}'; + requestUrl = requestUrl.replace('{backupPolicyName}', encodeURIComponent(backupPolicyName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['BackupPolicyDescription']().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 Gets the list of backup entities that are associated with this + * policy. + * + * Returns a list of Service Fabric application, service or partition which are + * associated with this backup policy. + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PagedBackupEntityList} 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 _getAllEntitiesBackedUpByPolicy(backupPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (backupPolicyName === null || backupPolicyName === undefined || typeof backupPolicyName.valueOf() !== 'string') { + throw new Error('backupPolicyName cannot be null or undefined and it must be of type string.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'BackupRestore/BackupPolicies/{backupPolicyName}/$/GetBackupEnabledEntities'; + requestUrl = requestUrl.replace('{backupPolicyName}', encodeURIComponent(backupPolicyName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedBackupEntityList']().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 the backup policy. + * + * Updates the backup policy identified by {backupPolicyName} + * + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {string} backupPolicyName The name of the backup policy. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (backupPolicyDescription === null || backupPolicyDescription === undefined) { + throw new Error('backupPolicyDescription cannot be null or undefined.'); + } + if (backupPolicyName === null || backupPolicyName === undefined || typeof backupPolicyName.valueOf() !== 'string') { + throw new Error('backupPolicyName cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'BackupRestore/BackupPolicies/{backupPolicyName}/$/Update'; + requestUrl = requestUrl.replace('{backupPolicyName}', encodeURIComponent(backupPolicyName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (backupPolicyDescription !== null && backupPolicyDescription !== undefined) { + let requestModelMapper = new client.models['BackupPolicyDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, backupPolicyDescription, 'backupPolicyDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(backupPolicyDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric application. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric application. Each partition is backed up individually as per + * the specified backup policy description. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _enableApplicationBackup(applicationId, enableBackupDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (enableBackupDescription === null || enableBackupDescription === undefined) { + throw new Error('enableBackupDescription cannot be null or undefined.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/EnableBackup'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (enableBackupDescription !== null && enableBackupDescription !== undefined) { + let requestModelMapper = new client.models['EnableBackupDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, enableBackupDescription, 'enableBackupDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(enableBackupDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Disables periodic backup of Service Fabric application. + * + * Disables periodic backup of Service Fabric application which was previously + * enabled. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _disableApplicationBackup(applicationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/DisableBackup'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Gets the Service Fabric application backup configuration + * information. + * + * Gets the Service Fabric backup configuration information for the application + * and the services and partitions under this application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PagedBackupConfigurationInfoList} 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 _getApplicationBackupConfigurationInfo(applicationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/GetBackupConfigurationInfo'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedBackupConfigurationInfoList']().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 Gets the list of backups available for every partition in this + * application. + * + * Returns a list of backups available for every partition in this Service + * Fabric application. The server enumerates all the backups available at the + * backup location configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @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 PagedBackupInfoList} 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 _getApplicationBackupList(applicationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let latest = (options && options.latest !== undefined) ? options.latest : false; + let startDateTimeFilter = (options && options.startDateTimeFilter !== undefined) ? options.startDateTimeFilter : undefined; + let endDateTimeFilter = (options && options.endDateTimeFilter !== undefined) ? options.endDateTimeFilter : undefined; + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let apiVersion = '6.2-preview'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (latest !== null && latest !== undefined && typeof latest !== 'boolean') { + throw new Error('latest must be of type boolean.'); + } + if (startDateTimeFilter && !(startDateTimeFilter instanceof Date || + (typeof startDateTimeFilter.valueOf() === 'string' && !isNaN(Date.parse(startDateTimeFilter))))) { + throw new Error('startDateTimeFilter must be of type date.'); + } + if (endDateTimeFilter && !(endDateTimeFilter instanceof Date || + (typeof endDateTimeFilter.valueOf() === 'string' && !isNaN(Date.parse(endDateTimeFilter))))) { + throw new Error('endDateTimeFilter must be of type date.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/GetBackups'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (latest !== null && latest !== undefined) { + queryParameters.push('Latest=' + encodeURIComponent(latest.toString())); + } + if (startDateTimeFilter !== null && startDateTimeFilter !== undefined) { + queryParameters.push('StartDateTimeFilter=' + encodeURIComponent(client.serializeObject(startDateTimeFilter))); + } + if (endDateTimeFilter !== null && endDateTimeFilter !== undefined) { + queryParameters.push('EndDateTimeFilter=' + encodeURIComponent(client.serializeObject(endDateTimeFilter))); + } + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedBackupInfoList']().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 Suspends periodic backup for the specified Service Fabric + * application. + * + * The application which is configured to take periodic backups, is suspended + * for taking further backups till it is resumed again. This operation applies + * to the entire application's hierarchy. It means all the services and + * partitions under this application are now suspended for backup. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _suspendApplicationBackup(applicationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/SuspendBackup'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Resumes periodic backup of a Service Fabric application which was + * previously suspended. + * + * The previously suspended Service Fabric application resumes taking periodic + * backup as per the backup policy currently configured for the same. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _resumeApplicationBackup(applicationId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Applications/{applicationId}/$/ResumeBackup'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric service. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric service. Each partition is backed up individually as per the + * specified backup policy description. In case the application, which the + * service is part of, is already enabled for backup then this operation would + * override the policy being used to take the periodic backup for this service + * and its partitions (unless explicitly overridden at the partition level). + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _enableServiceBackup(serviceId, enableBackupDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (enableBackupDescription === null || enableBackupDescription === undefined) { + throw new Error('enableBackupDescription cannot be null or undefined.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Services/{serviceId}/$/EnableBackup'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (enableBackupDescription !== null && enableBackupDescription !== undefined) { + let requestModelMapper = new client.models['EnableBackupDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, enableBackupDescription, 'enableBackupDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(enableBackupDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Disables periodic backup of Service Fabric service which was + * previously enabled. + * + * Disables periodic backup of Service Fabric service which was previously + * enabled. Backup must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application, which this + * service is part of, this service would continue to be periodically backed up + * as per the policy mapped at the application level. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _disableServiceBackup(serviceId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Services/{serviceId}/$/DisableBackup'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Gets the Service Fabric service backup configuration information. + * + * Gets the Service Fabric backup configuration information for the service and + * the partitions under this service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PagedBackupConfigurationInfoList} 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 _getServiceBackupConfigurationInfo(serviceId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Services/{serviceId}/$/GetBackupConfigurationInfo'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedBackupConfigurationInfoList']().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 Gets the list of backups available for every partition in this + * service. + * + * Returns a list of backups available for every partition in this Service + * Fabric service. The server enumerates all the backups available in the + * backup store configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @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 PagedBackupInfoList} 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 _getServiceBackupList(serviceId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let latest = (options && options.latest !== undefined) ? options.latest : false; + let startDateTimeFilter = (options && options.startDateTimeFilter !== undefined) ? options.startDateTimeFilter : undefined; + let endDateTimeFilter = (options && options.endDateTimeFilter !== undefined) ? options.endDateTimeFilter : undefined; + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let apiVersion = '6.2-preview'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (latest !== null && latest !== undefined && typeof latest !== 'boolean') { + throw new Error('latest must be of type boolean.'); + } + if (startDateTimeFilter && !(startDateTimeFilter instanceof Date || + (typeof startDateTimeFilter.valueOf() === 'string' && !isNaN(Date.parse(startDateTimeFilter))))) { + throw new Error('startDateTimeFilter must be of type date.'); + } + if (endDateTimeFilter && !(endDateTimeFilter instanceof Date || + (typeof endDateTimeFilter.valueOf() === 'string' && !isNaN(Date.parse(endDateTimeFilter))))) { + throw new Error('endDateTimeFilter must be of type date.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Services/{serviceId}/$/GetBackups'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (latest !== null && latest !== undefined) { + queryParameters.push('Latest=' + encodeURIComponent(latest.toString())); + } + if (startDateTimeFilter !== null && startDateTimeFilter !== undefined) { + queryParameters.push('StartDateTimeFilter=' + encodeURIComponent(client.serializeObject(startDateTimeFilter))); + } + if (endDateTimeFilter !== null && endDateTimeFilter !== undefined) { + queryParameters.push('EndDateTimeFilter=' + encodeURIComponent(client.serializeObject(endDateTimeFilter))); + } + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedBackupInfoList']().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 Suspends periodic backup for the specified Service Fabric service. + * + * The service which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. This operation applies to + * the entire service's hierarchy. It means all the partitions under this + * service are now suspended for backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _suspendServiceBackup(serviceId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Services/{serviceId}/$/SuspendBackup'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Resumes periodic backup of a Service Fabric service which was + * previously suspended. + * + * The previously suspended Service Fabric service resumes taking periodic + * backup as per the backup policy currently configured for the same. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _resumeServiceBackup(serviceId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Services/{serviceId}/$/ResumeBackup'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Enables periodic backup of the stateful persisted partition. + * + * Enables periodic backup of stateful persisted partition. Each partition is + * backed up as per the specified backup policy description. In case the + * application or service, which is partition is part of, is already enabled + * for backup then this operation would override the policy being used to take + * the periodic backup of this partition. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. + * + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _enablePartitionBackup(partitionId, enableBackupDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (enableBackupDescription === null || enableBackupDescription === undefined) { + throw new Error('enableBackupDescription cannot be null or undefined.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/EnableBackup'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (enableBackupDescription !== null && enableBackupDescription !== undefined) { + let requestModelMapper = new client.models['EnableBackupDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, enableBackupDescription, 'enableBackupDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(enableBackupDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Disables periodic backup of Service Fabric partition which was + * previously enabled. + * + * Disables periodic backup of partition which was previously enabled. Backup + * must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application or service, + * which this partition is part of, this partition would continue to be + * periodically backed up as per the policy mapped at the higher level entity. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _disablePartitionBackup(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/DisableBackup'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Gets the partition backup configuration information + * + * Gets the Service Fabric Backup configuration information for the specified + * partition. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PartitionBackupConfigurationInfo} 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 _getPartitionBackupConfigurationInfo(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetBackupConfigurationInfo'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PartitionBackupConfigurationInfo']().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 Gets the list of backups available for the specified partition. + * + * Returns a list of backups available for the specified partition. The server + * enumerates all the backups available in the backup store configured in the + * backup policy. It also allows filtering of the result based on start and end + * datetime or just fetching the latest available backup for the partition. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @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 PagedBackupInfoList} 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 _getPartitionBackupList(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let latest = (options && options.latest !== undefined) ? options.latest : false; + let startDateTimeFilter = (options && options.startDateTimeFilter !== undefined) ? options.startDateTimeFilter : undefined; + let endDateTimeFilter = (options && options.endDateTimeFilter !== undefined) ? options.endDateTimeFilter : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (latest !== null && latest !== undefined && typeof latest !== 'boolean') { + throw new Error('latest must be of type boolean.'); + } + if (startDateTimeFilter && !(startDateTimeFilter instanceof Date || + (typeof startDateTimeFilter.valueOf() === 'string' && !isNaN(Date.parse(startDateTimeFilter))))) { + throw new Error('startDateTimeFilter must be of type date.'); + } + if (endDateTimeFilter && !(endDateTimeFilter instanceof Date || + (typeof endDateTimeFilter.valueOf() === 'string' && !isNaN(Date.parse(endDateTimeFilter))))) { + throw new Error('endDateTimeFilter must be of type date.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetBackups'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (latest !== null && latest !== undefined) { + queryParameters.push('Latest=' + encodeURIComponent(latest.toString())); + } + if (startDateTimeFilter !== null && startDateTimeFilter !== undefined) { + queryParameters.push('StartDateTimeFilter=' + encodeURIComponent(client.serializeObject(startDateTimeFilter))); + } + if (endDateTimeFilter !== null && endDateTimeFilter !== undefined) { + queryParameters.push('EndDateTimeFilter=' + encodeURIComponent(client.serializeObject(endDateTimeFilter))); + } + 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(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['FabricError']().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['PagedBackupInfoList']().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 Suspends periodic backup for the specified partition. + * + * The partition which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _suspendPartitionBackup(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/SuspendBackup'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Resumes periodic backup of partition which was previously + * suspended. + * + * The previously suspended partition resumes taking periodic backup as per the + * backup policy currently configured for the same. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _resumePartitionBackup(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/ResumeBackup'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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) { + 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['FabricError']().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); + }); +} + +/** + * @summary Triggers backup of the partition's state. + * + * Creates a backup of the stateful persisted partition's state. In case the + * partition is already being periodically backed up, then by default the new + * backup is created at the same backup storage. One can also override the same + * by specifying the backup storage details as part of the request body. Once + * the backup is initiated, its progress can be tracked using the + * GetBackupProgress operation. + * In case, the operation times out, specify a greater backup timeout value in + * the query parameter. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.backupPartitionDescription] Describes the + * parameters to backup the partition now. If not present, backup operation + * uses default parameters from the backup policy current associated with this + * partition. + * + * @param {object} [options.backupPartitionDescription.backupStorage] Specifies + * the details of the backup storage where to save the backup. + * + * @param {string} + * [options.backupPartitionDescription.backupStorage.friendlyName] Friendly + * name for this backup storage. + * + * @param {string} options.backupPartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {number} [options.backupTimeout] Specifies the maximum amount of + * time, in minutes, to wait for the backup operation to complete. Post that, + * the operation completes with timeout error. However, in certain corner cases + * it could be that though the operation returns back timeout, the backup + * actually goes through. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. The default value for the + * same is 10 minutes. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _backupPartition(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let backupPartitionDescription = (options && options.backupPartitionDescription !== undefined) ? options.backupPartitionDescription : undefined; + let backupTimeout = (options && options.backupTimeout !== undefined) ? options.backupTimeout : 10; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (backupTimeout !== null && backupTimeout !== undefined && typeof backupTimeout !== 'number') { + throw new Error('backupTimeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/Backup'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + if (backupTimeout !== null && backupTimeout !== undefined) { + queryParameters.push('BackupTimeout=' + encodeURIComponent(backupTimeout.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (backupPartitionDescription !== null && backupPartitionDescription !== undefined) { + let requestModelMapper = new client.models['BackupPartitionDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, backupPartitionDescription, 'backupPartitionDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(backupPartitionDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Gets details for the latest backup triggered for this partition. + * + * Returns information about the state of the latest backup along with details + * or failure reason in case of completion. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 BackupProgressInfo} 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 _getPartitionBackupProgress(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetBackupProgress'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['BackupProgressInfo']().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 Triggers restore of the state of the partition using the specified + * restore partition description. + * + * Restores the state of a of the stateful persisted partition using the + * specified backup point. In case the partition is already being periodically + * backed up, then by default the backup point is looked for in the storage + * specified in backup policy. One can also override the same by specifying the + * backup storage details as part of the restore partition description in body. + * Once the restore is initiated, its progress can be tracked using the + * GetRestoreProgress operation. + * In case, the operation times out, specify a greater restore timeout value in + * the query parameter. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} restorePartitionDescription Describes the parameters to + * restore the partition. + * + * @param {uuid} restorePartitionDescription.backupId Unique backup ID. + * + * @param {string} restorePartitionDescription.backupLocation Location of the + * backup relative to the backup storage specified/ configured. + * + * @param {object} [restorePartitionDescription.backupStorage] Location of the + * backup from where the partition will be restored. + * + * @param {string} [restorePartitionDescription.backupStorage.friendlyName] + * Friendly name for this backup storage. + * + * @param {string} restorePartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.restoreTimeout] Specifies the maximum amount of + * time to wait, in minutes, for the restore operation to complete. Post that, + * the operation returns back with timeout error. However, in certain corner + * cases it could be that the restore operation goes through even though it + * completes with timeout. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. the default value for the + * same is 10 minutes. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _restorePartition(partitionId, restorePartitionDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let restoreTimeout = (options && options.restoreTimeout !== undefined) ? options.restoreTimeout : 10; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (restorePartitionDescription === null || restorePartitionDescription === undefined) { + throw new Error('restorePartitionDescription cannot be null or undefined.'); + } + if (restoreTimeout !== null && restoreTimeout !== undefined && typeof restoreTimeout !== 'number') { + throw new Error('restoreTimeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/Restore'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + if (restoreTimeout !== null && restoreTimeout !== undefined) { + queryParameters.push('RestoreTimeout=' + encodeURIComponent(restoreTimeout.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (restorePartitionDescription !== null && restorePartitionDescription !== undefined) { + let requestModelMapper = new client.models['RestorePartitionDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, restorePartitionDescription, 'restorePartitionDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(restorePartitionDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Gets details for the latest restore operation triggered for this + * partition. + * + * Returns information about the state of the latest restore operation along + * with details or failure reason in case of completion. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 RestoreProgressInfo} 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 _getPartitionRestoreProgress(partitionId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Partitions/{partitionId}/$/GetRestoreProgress'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['RestoreProgressInfo']().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 Gets the list of backups available for the specified backed up + * entity at the specified backup location. + * + * Gets the list of backups available for the specified backed up entity + * (Application, Service or Partition) at the specified backup location + * (FileShare or Azure Blob Storage). + * + * @param {object} getBackupByStorageQueryDescription Describes the filters and + * backup storage details to be used for enumerating backups. + * + * @param {date} [getBackupByStorageQueryDescription.startDateTimeFilter] + * Specifies the start date time in ISO8601 from which to enumerate backups. If + * not specified, backups are enumerated from the beginning. + * + * @param {date} [getBackupByStorageQueryDescription.endDateTimeFilter] + * Specifies the end date time in ISO8601 till which to enumerate backups. If + * not specified, backups are enumerated till the end. + * + * @param {boolean} [getBackupByStorageQueryDescription.latest] If specified as + * true, gets the most recent backup (within the specified time range) for + * every partition under the specified backup entity. + * + * @param {object} getBackupByStorageQueryDescription.storage Describes the + * parameters for the backup storage from where to enumerate backups. This is + * optional and by default backups are enumerated from the backup storage where + * this backup entity is currently being backed up (as specified in backup + * policy). This parameter is useful to be able to enumerate backups from + * another cluster where you may intend to restore. + * + * @param {string} [getBackupByStorageQueryDescription.storage.friendlyName] + * Friendly name for this backup storage. + * + * @param {string} getBackupByStorageQueryDescription.storage.storageKind + * Polymorphic Discriminator + * + * @param {object} getBackupByStorageQueryDescription.backupEntity Indicates + * the entity for which to enumerate backups. + * + * @param {string} getBackupByStorageQueryDescription.backupEntity.entityKind + * Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @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 PagedBackupInfoList} 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 _getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let maxResults = (options && options.maxResults !== undefined) ? options.maxResults : 0; + let apiVersion = '6.2-preview'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (maxResults !== null && maxResults !== undefined && typeof maxResults !== 'number') { + throw new Error('maxResults must be of type number.'); + } + if (maxResults !== null && maxResults !== undefined) { + if (maxResults < 0) + { + throw new Error('"maxResults" should satisfy the constraint - "InclusiveMinimum": 0'); + } + } + if (getBackupByStorageQueryDescription === null || getBackupByStorageQueryDescription === undefined) { + throw new Error('getBackupByStorageQueryDescription cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'BackupRestore/$/GetBackups'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (maxResults !== null && maxResults !== undefined) { + queryParameters.push('MaxResults=' + encodeURIComponent(maxResults.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (getBackupByStorageQueryDescription !== null && getBackupByStorageQueryDescription !== undefined) { + let requestModelMapper = new client.models['GetBackupByStorageQueryDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, getBackupByStorageQueryDescription, 'getBackupByStorageQueryDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(getBackupByStorageQueryDescription, 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['FabricError']().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['PagedBackupInfoList']().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 a Service Fabric name. + * + * Creates the specified Service Fabric name. + * + * @param {object} nameDescription Describes the Service Fabric name to be + * created. + * + * @param {string} nameDescription.name The Service Fabric name, including the + * 'fabric:' URI scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _createName(nameDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameDescription === null || nameDescription === undefined) { + throw new Error('nameDescription cannot be null or undefined.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/$/Create'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (nameDescription !== null && nameDescription !== undefined) { + let requestModelMapper = new client.models['NameDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, nameDescription, 'nameDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(nameDescription, 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 !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['FabricError']().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); + }); +} + +/** + * @summary Returns whether the Service Fabric name exists. + * + * Returns whether the specified Service Fabric name exists. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _getNameExistsInfo(nameId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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); + }); +} + +/** + * @summary Deletes a Service Fabric name. + * + * Deletes the specified Service Fabric name. A name must be created before it + * can be deleted. Deleting a name with child properties will fail. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _deleteName(nameId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + 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(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['FabricError']().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); + }); +} + +/** + * @summary Enumerates all the Service Fabric names under a given name. + * + * Enumerates all the Service Fabric names under a given name. If the subnames + * do not fit in a page, one page of results is returned as well as a + * continuation token, which can be used to get the next page. Querying a name + * that doesn't exist will fail. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] Allows specifying that the search + * performed should be recursive. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PagedSubNameInfoList} 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 _getSubNameInfoList(nameId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let recursive = (options && options.recursive !== undefined) ? options.recursive : false; + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (recursive !== null && recursive !== undefined && typeof recursive !== 'boolean') { + throw new Error('recursive must be of type boolean.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}/$/GetSubNames'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (recursive !== null && recursive !== undefined) { + queryParameters.push('Recursive=' + encodeURIComponent(recursive.toString())); + } + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedSubNameInfoList']().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 Gets information on all Service Fabric properties under a given + * name. + * + * A Service Fabric name can have one or more named properties that store + * custom information. This operation gets the information about these + * properties in a paged list. The information includes name, value, and + * metadata about each of the properties. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeValues] Allows specifying whether to + * include the values of the properties returned. True if values should be + * returned with the metadata; False to return only property metadata. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PagedPropertyInfoList} 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 _getPropertyInfoList(nameId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let includeValues = (options && options.includeValues !== undefined) ? options.includeValues : false; + let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (includeValues !== null && includeValues !== undefined && typeof includeValues !== 'boolean') { + throw new Error('includeValues must be of type boolean.'); + } + if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { + throw new Error('continuationToken must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}/$/GetProperties'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (includeValues !== null && includeValues !== undefined) { + queryParameters.push('IncludeValues=' + encodeURIComponent(includeValues.toString())); + } + if (continuationToken !== null && continuationToken !== undefined) { + queryParameters.push('ContinuationToken=' + continuationToken); + } + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PagedPropertyInfoList']().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 property. + * + * Creates or updates the specified Service Fabric property under a given name. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} propertyDescription Describes the Service Fabric property to + * be created. + * + * @param {string} propertyDescription.propertyName The name of the Service + * Fabric property. + * + * @param {string} [propertyDescription.customTypeId] The property's custom + * type ID. Using this property, the user is able to tag the type of the value + * of the property. + * + * @param {object} propertyDescription.value Describes a Service Fabric + * property value. + * + * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _putProperty(nameId, propertyDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (propertyDescription === null || propertyDescription === undefined) { + throw new Error('propertyDescription cannot be null or undefined.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}/$/GetProperty'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + 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(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 (propertyDescription !== null && propertyDescription !== undefined) { + let requestModelMapper = new client.models['PropertyDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, propertyDescription, 'propertyDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(propertyDescription, 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['FabricError']().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); + }); +} + +/** + * @summary Gets the specified Service Fabric property. + * + * Gets the specified Service Fabric property under a given name. This will + * always return both value and metadata. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PropertyInfo} 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 _getPropertyInfo(nameId, propertyName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (propertyName === null || propertyName === undefined || typeof propertyName.valueOf() !== 'string') { + throw new Error('propertyName cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}/$/GetProperty'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('PropertyName=' + encodeURIComponent(propertyName)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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['PropertyInfo']().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 the specified Service Fabric property. + * + * Deletes the specified Service Fabric property under a given name. A property + * must be created before it can be deleted. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 _deleteProperty(nameId, propertyName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (propertyName === null || propertyName === undefined || typeof propertyName.valueOf() !== 'string') { + throw new Error('propertyName cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}/$/GetProperty'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('PropertyName=' + encodeURIComponent(propertyName)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + 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(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['FabricError']().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); + }); +} + +/** + * @summary Submits a property batch. + * + * Submits a batch of property operations. Either all or none of the operations + * will be committed. + * + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {object} propertyBatchDescriptionList Describes the property batch + * operations to be submitted. + * + * @param {array} [propertyBatchDescriptionList.operations] A list of the + * property batch operations to be executed. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 PropertyBatchInfo} 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 _submitPropertyBatch(nameId, propertyBatchDescriptionList, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.0'; + // Validate + try { + if (nameId === null || nameId === undefined || typeof nameId.valueOf() !== 'string') { + throw new Error('nameId cannot be null or undefined and it must be of type string.'); + } + if (propertyBatchDescriptionList === null || propertyBatchDescriptionList === undefined) { + throw new Error('propertyBatchDescriptionList cannot be null or undefined.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Names/{nameId}/$/GetProperties/$/SubmitBatch'; + requestUrl = requestUrl.replace('{nameId}', nameId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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 (propertyBatchDescriptionList !== null && propertyBatchDescriptionList !== undefined) { + let requestModelMapper = new client.models['PropertyBatchDescriptionList']().mapper(); + requestModel = client.serialize(requestModelMapper, propertyBatchDescriptionList, 'propertyBatchDescriptionList'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(propertyBatchDescriptionList, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 409) { + 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['FabricError']().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['SuccessfulPropertyBatchInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 409) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FailedPropertyBatchInfo']().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 Gets all Cluster-related events. + * + * The response is list of ClusterEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getClusterEventList(startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Cluster/Events'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ClusterEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterEvent' + } + } + } + }; + 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 Gets all Containers-related events. + * + * The response is list of ContainerInstanceEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Containers/Events'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerInstanceEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ContainerInstanceEvent' + } + } + } + }; + 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 Gets a Node-related events. + * + * The response is list of NodeEvent objects. + * + * @param {string} nodeName The name of the node. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { + throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Nodes/{nodeName}/$/Events'; + requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NodeEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeEvent' + } + } + } + }; + 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 Gets all Nodes-related Events. + * + * The response is list of NodeEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Nodes/Events'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NodeEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeEvent' + } + } + } + }; + 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 Gets an Application-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { + throw new Error('applicationId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Applications/{applicationId}/$/Events'; + requestUrl = requestUrl.replace('{applicationId}', applicationId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationEvent' + } + } + } + }; + 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 Gets all Applications-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Applications/Events'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationEvent' + } + } + } + }; + 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 Gets a Service-related events. + * + * The response is list of ServiceEvent objects. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { + throw new Error('serviceId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Services/{serviceId}/$/Events'; + requestUrl = requestUrl.replace('{serviceId}', serviceId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceEvent' + } + } + } + }; + 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 Gets all Services-related events. + * + * The response is list of ServiceEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Services/Events'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceEvent' + } + } + } + }; + 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 Gets a Partition-related events. + * + * The response is list of PartitionEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/{partitionId}/$/Events'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PartitionEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionEvent' + } + } + } + }; + 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 Gets all Partitions-related events. + * + * The response is list of PartitionEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/Events'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PartitionEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionEvent' + } + } + } + }; + 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 Gets a Partition Replica-related events. + * + * The response is list of ReplicaEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (replicaId === null || replicaId === undefined || typeof replicaId.valueOf() !== 'string') { + throw new Error('replicaId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + requestUrl = requestUrl.replace('{replicaId}', replicaId); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReplicaEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ReplicaEvent' + } + } + } + }; + 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 Gets all Replicas-related events for a Partition. + * + * The response is list of ReplicaEvent objects. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @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. + * + * {array} [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 _getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let eventsTypesFilter = (options && options.eventsTypesFilter !== undefined) ? options.eventsTypesFilter : undefined; + let excludeAnalysisEvents = (options && options.excludeAnalysisEvents !== undefined) ? options.excludeAnalysisEvents : undefined; + let skipCorrelationLookup = (options && options.skipCorrelationLookup !== undefined) ? options.skipCorrelationLookup : undefined; + let apiVersion = '6.2-preview'; + // Validate + try { + if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { + throw new Error('partitionId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (startTimeUtc === null || startTimeUtc === undefined || typeof startTimeUtc.valueOf() !== 'string') { + throw new Error('startTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (endTimeUtc === null || endTimeUtc === undefined || typeof endTimeUtc.valueOf() !== 'string') { + throw new Error('endTimeUtc cannot be null or undefined and it must be of type string.'); + } + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined && typeof eventsTypesFilter.valueOf() !== 'string') { + throw new Error('eventsTypesFilter must be of type string.'); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined && typeof excludeAnalysisEvents !== 'boolean') { + throw new Error('excludeAnalysisEvents must be of type boolean.'); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined && typeof skipCorrelationLookup !== 'boolean') { + throw new Error('skipCorrelationLookup must be of type boolean.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/{partitionId}/$/Replicas/Events'; + requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + queryParameters.push('StartTimeUtc=' + encodeURIComponent(startTimeUtc)); + queryParameters.push('EndTimeUtc=' + encodeURIComponent(endTimeUtc)); + if (eventsTypesFilter !== null && eventsTypesFilter !== undefined) { + queryParameters.push('EventsTypesFilter=' + encodeURIComponent(eventsTypesFilter)); + } + if (excludeAnalysisEvents !== null && excludeAnalysisEvents !== undefined) { + queryParameters.push('ExcludeAnalysisEvents=' + encodeURIComponent(excludeAnalysisEvents.toString())); + } + if (skipCorrelationLookup !== null && skipCorrelationLookup !== undefined) { + queryParameters.push('SkipCorrelationLookup=' + encodeURIComponent(skipCorrelationLookup.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReplicaEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ReplicaEvent' + } + } + } + }; + 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 Gets all correlated events for a given event. + * + * The response is list of FabricEvents. + * + * @param {string} eventInstanceId The EventInstanceId. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + * + * {array} [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 _getCorrelatedEventList(eventInstanceId, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; + let apiVersion = '6.2-preview'; + // Validate + try { + if (eventInstanceId === null || eventInstanceId === undefined || typeof eventInstanceId.valueOf() !== 'string') { + throw new Error('eventInstanceId cannot be null or undefined and it must be of type string.'); + } + if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { + throw new Error('timeout must be of type number.'); + } + if (timeout !== null && timeout !== undefined) { + if (timeout > 4294967295) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMaximum": 4294967295'); + } + if (timeout < 1) + { + throw new Error('"timeout" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events'; + requestUrl = requestUrl.replace('{eventInstanceId}', encodeURIComponent(eventInstanceId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (timeout !== null && timeout !== undefined) { + queryParameters.push('timeout=' + encodeURIComponent(timeout.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(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['FabricError']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FabricEventElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'FabricEvent' + } + } + } + }; + 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 an application resource. + * + * Creates an application with the specified name and description. If an + * application with the same name already exists, then its description are + * updated to the one indicated in this request. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {object} applicationResourceDescription Description for creating an + * application resource. + * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. + * + * @param {string} [applicationResourceDescription.debugParams] Internal use. + * + * @param {array} [applicationResourceDescription.services] describes the + * services in the application. + * + * @param {object} [applicationResourceDescription.diagnostics] Describes the + * diagnostics definition and usage for an application resource. + * + * @param {array} [applicationResourceDescription.diagnostics.sinks] List of + * supported sinks that can be referenced. + * + * @param {boolean} [applicationResourceDescription.diagnostics.enabled] Status + * of whether or not sinks are enabled. + * + * @param {array} [applicationResourceDescription.diagnostics.defaultSinkRefs] + * The sinks to be used if diagnostics is enabled. Sink choices can be + * overridden at the service and code package level. + * + * @param {string} applicationResourceDescription.name Application resource + * name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createApplicationResource(applicationResourceName, applicationResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (applicationResourceName === null || applicationResourceName === undefined || typeof applicationResourceName.valueOf() !== 'string') { + throw new Error('applicationResourceName cannot be null or undefined and it must be of type string.'); + } + if (applicationResourceDescription === null || applicationResourceDescription === undefined) { + throw new Error('applicationResourceDescription cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + 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(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 (applicationResourceDescription !== null && applicationResourceDescription !== undefined) { + let requestModelMapper = new client.models['ApplicationResourceDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, applicationResourceDescription, 'applicationResourceDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(applicationResourceDescription, 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 !== 201 && 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['FabricError']().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); + }); +} + +/** + * @summary Gets the application with the given name. + * + * Gets the application with the given name. This includes the information + * about the application's services and other runtime information. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationResourceDescription} 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 _getApplicationResource(applicationResourceName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (applicationResourceName === null || applicationResourceName === undefined || typeof applicationResourceName.valueOf() !== 'string') { + throw new Error('applicationResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + 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(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['FabricError']().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['ApplicationResourceDescription']().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 the specified application. + * + * Deletes the application identified by the name. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteApplicationResource(applicationResourceName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (applicationResourceName === null || applicationResourceName === undefined || typeof applicationResourceName.valueOf() !== 'string') { + throw new Error('applicationResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + 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(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 !== 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['FabricError']().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); + }); +} + +/** + * @summary Gets all the services in the application resource. + * + * The operation returns the service descriptions of all the services in the + * application resource. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedServiceResourceDescriptionList} 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 _getServices(applicationResourceName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (applicationResourceName === null || applicationResourceName === undefined || typeof applicationResourceName.valueOf() !== 'string') { + throw new Error('applicationResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}/Services'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + 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(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; + } + } 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['PagedServiceResourceDescriptionList']().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 Gets the description of the specified service in an application + * resource. + * + * Gets the description of the service resource. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {string} serviceResourceName Service Fabric service resource name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceDescription} 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 _getService(applicationResourceName, serviceResourceName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (applicationResourceName === null || applicationResourceName === undefined || typeof applicationResourceName.valueOf() !== 'string') { + throw new Error('applicationResourceName cannot be null or undefined and it must be of type string.'); + } + if (serviceResourceName === null || serviceResourceName === undefined || typeof serviceResourceName.valueOf() !== 'string') { + throw new Error('serviceResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + requestUrl = requestUrl.replace('{serviceResourceName}', serviceResourceName); + 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(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; + } + } 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['ServiceResourceDescription']().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 Gets replicas of a given service in an applciation resource. + * + * Gets the information about all replicas of a given service of an + * application. The information includes the runtime properties of the replica + * instance. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {string} serviceResourceName Service Fabric service resource name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedServiceResourceReplicaDescriptionList} + * 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 _getReplicas(applicationResourceName, serviceResourceName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (applicationResourceName === null || applicationResourceName === undefined || typeof applicationResourceName.valueOf() !== 'string') { + throw new Error('applicationResourceName cannot be null or undefined and it must be of type string.'); + } + if (serviceResourceName === null || serviceResourceName === undefined || typeof serviceResourceName.valueOf() !== 'string') { + throw new Error('serviceResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/replicas'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + requestUrl = requestUrl.replace('{serviceResourceName}', serviceResourceName); + 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(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; + } + } 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['PagedServiceResourceReplicaDescriptionList']().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 Gets a specific replica of a given service in an application + * resource. + * + * Gets the information about the specified replica of a given service of an + * application. The information includes the runtime properties of the replica + * instance. + * + * @param {string} applicationResourceName Service Fabric application resource + * name. + * + * @param {string} serviceResourceName Service Fabric service resource name. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceReplicaDescription} 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 _getReplica(applicationResourceName, serviceResourceName, replicaName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (applicationResourceName === null || applicationResourceName === undefined || typeof applicationResourceName.valueOf() !== 'string') { + throw new Error('applicationResourceName cannot be null or undefined and it must be of type string.'); + } + if (serviceResourceName === null || serviceResourceName === undefined || typeof serviceResourceName.valueOf() !== 'string') { + throw new Error('serviceResourceName cannot be null or undefined and it must be of type string.'); + } + if (replicaName === null || replicaName === undefined || typeof replicaName.valueOf() !== 'string') { + throw new Error('replicaName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas/{replicaName}'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + requestUrl = requestUrl.replace('{serviceResourceName}', serviceResourceName); + requestUrl = requestUrl.replace('{replicaName}', replicaName); + 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(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; + } + } 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['ServiceResourceReplicaDescription']().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 volume resource. + * + * Creates a volume resource with the specified name and description. If a + * volume with the same name already exists, then its description is updated to + * the one indicated in this request. + * + * @param {string} volumeResourceName Service Fabric volume resource name. + * + * @param {object} volumeResourceDescription Description for creating a volume + * resource. + * + * @param {string} [volumeResourceDescription.description] User readable + * description of the volume. + * + * @param {object} [volumeResourceDescription.azureFileParameters] This type + * describes a volume provided by an Azure Files file share. + * + * @param {string} volumeResourceDescription.azureFileParameters.accountName + * Name of the Azure storage account for the File Share. + * + * @param {string} [volumeResourceDescription.azureFileParameters.accountKey] + * Access key of the Azure storage account for the File Share. + * + * @param {string} volumeResourceDescription.azureFileParameters.shareName Name + * of the Azure Files file share that provides storage for the volume. + * + * @param {string} volumeResourceDescription.name Volume resource name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createVolumeResource(volumeResourceName, volumeResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + if (volumeResourceDescription === null || volumeResourceDescription === undefined) + { + volumeResourceDescription = {}; + } + // Validate + try { + if (volumeResourceName === null || volumeResourceName === undefined || typeof volumeResourceName.valueOf() !== 'string') { + throw new Error('volumeResourceName cannot be null or undefined and it must be of type string.'); + } + if (volumeResourceDescription === null || volumeResourceDescription === undefined) { + throw new Error('volumeResourceDescription cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Volumes/{volumeResourceName}'; + requestUrl = requestUrl.replace('{volumeResourceName}', volumeResourceName); + 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(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 (volumeResourceDescription !== null && volumeResourceDescription !== undefined) { + let requestModelMapper = new client.models['VolumeResourceDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, volumeResourceDescription, 'volumeResourceDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(volumeResourceDescription, 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 !== 201 && 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['FabricError']().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); + }); +} + +/** + * @summary Gets the volume resource. + * + * Gets the information about the volume resource with a given name. This + * information includes the volume description and other runtime information. + * + * @param {string} volumeResourceName Service Fabric volume resource name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VolumeResourceDescription} 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 _getVolumeResource(volumeResourceName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (volumeResourceName === null || volumeResourceName === undefined || typeof volumeResourceName.valueOf() !== 'string') { + throw new Error('volumeResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Volumes/{volumeResourceName}'; + requestUrl = requestUrl.replace('{volumeResourceName}', volumeResourceName); + 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(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['FabricError']().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['VolumeResourceDescription']().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 the volume resource. + * + * Deletes the volume identified by the name. + * + * @param {string} volumeResourceName Service Fabric volume resource name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteVolumeResource(volumeResourceName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.3-preview'; + // Validate + try { + if (volumeResourceName === null || volumeResourceName === undefined || typeof volumeResourceName.valueOf() !== 'string') { + throw new Error('volumeResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Volumes/{volumeResourceName}'; + requestUrl = requestUrl.replace('{volumeResourceName}', volumeResourceName); + 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(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 !== 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['FabricError']().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 ServiceFabricClient. */ +class ServiceFabricClient extends ServiceClient { + /** + * Create a ServiceFabricClient. + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + */ + constructor(baseUri, options) { + + if (!options) options = {}; + + super(null, options); + + this.baseUri = baseUri; if (!this.baseUri) { this.baseUri = 'http://localhost:19080'; } - let packageInfo = this.getPackageJsonInfo(__dirname); - this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); - this.models = models; - this._getClusterManifest = _getClusterManifest; - this._getClusterHealth = _getClusterHealth; - this._getClusterHealthUsingPolicy = _getClusterHealthUsingPolicy; - this._getClusterHealthChunk = _getClusterHealthChunk; - this._getClusterHealthChunkUsingPolicyAndAdvancedFilters = _getClusterHealthChunkUsingPolicyAndAdvancedFilters; - this._reportClusterHealth = _reportClusterHealth; - this._getProvisionedFabricCodeVersionInfoList = _getProvisionedFabricCodeVersionInfoList; - this._getProvisionedFabricConfigVersionInfoList = _getProvisionedFabricConfigVersionInfoList; - this._getClusterUpgradeProgress = _getClusterUpgradeProgress; - this._getClusterConfiguration = _getClusterConfiguration; - this._getClusterConfigurationUpgradeStatus = _getClusterConfigurationUpgradeStatus; - this._provisionCluster = _provisionCluster; - this._unprovisionCluster = _unprovisionCluster; - this._rollbackClusterUpgrade = _rollbackClusterUpgrade; - this._resumeClusterUpgrade = _resumeClusterUpgrade; - this._startClusterUpgrade = _startClusterUpgrade; - this._startClusterConfigurationUpgrade = _startClusterConfigurationUpgrade; - this._updateClusterUpgrade = _updateClusterUpgrade; - this._getAadMetadata = _getAadMetadata; - this._getNodeInfoList = _getNodeInfoList; - this._getNodeInfo = _getNodeInfo; - this._getNodeHealth = _getNodeHealth; - this._getNodeHealthUsingPolicy = _getNodeHealthUsingPolicy; - this._reportNodeHealth = _reportNodeHealth; - this._getNodeLoadInfo = _getNodeLoadInfo; - this._disableNode = _disableNode; - this._enableNode = _enableNode; - this._removeNodeState = _removeNodeState; - this._restartNode = _restartNode; - this._getApplicationTypeInfoList = _getApplicationTypeInfoList; - this._getApplicationTypeInfoListByName = _getApplicationTypeInfoListByName; - this._provisionApplicationType = _provisionApplicationType; - this._unprovisionApplicationType = _unprovisionApplicationType; - this._getServiceTypeInfoList = _getServiceTypeInfoList; - this._getServiceManifest = _getServiceManifest; - this._getDeployedServiceTypeInfoList = _getDeployedServiceTypeInfoList; - this._getDeployedServiceTypeInfoByName = _getDeployedServiceTypeInfoByName; - this._createApplication = _createApplication; - this._deleteApplication = _deleteApplication; - this._getApplicationLoadInfo = _getApplicationLoadInfo; - this._getApplicationInfoList = _getApplicationInfoList; - this._getApplicationInfo = _getApplicationInfo; - this._getApplicationHealth = _getApplicationHealth; - this._getApplicationHealthUsingPolicy = _getApplicationHealthUsingPolicy; - this._reportApplicationHealth = _reportApplicationHealth; - this._startApplicationUpgrade = _startApplicationUpgrade; - this._getApplicationUpgrade = _getApplicationUpgrade; - this._updateApplicationUpgrade = _updateApplicationUpgrade; - this._resumeApplicationUpgrade = _resumeApplicationUpgrade; - this._rollbackApplicationUpgrade = _rollbackApplicationUpgrade; - this._getDeployedApplicationInfoList = _getDeployedApplicationInfoList; - this._getDeployedApplicationInfo = _getDeployedApplicationInfo; - this._getDeployedApplicationHealth = _getDeployedApplicationHealth; - this._getDeployedApplicationHealthUsingPolicy = _getDeployedApplicationHealthUsingPolicy; - this._reportDeployedApplicationHealth = _reportDeployedApplicationHealth; - this._getApplicationManifest = _getApplicationManifest; - this._getServiceInfoList = _getServiceInfoList; - this._getServiceInfo = _getServiceInfo; - this._getApplicationNameInfo = _getApplicationNameInfo; - this._createService = _createService; - this._createServiceFromTemplate = _createServiceFromTemplate; - this._deleteService = _deleteService; - this._updateService = _updateService; - this._getServiceDescription = _getServiceDescription; - this._getServiceHealth = _getServiceHealth; - this._getServiceHealthUsingPolicy = _getServiceHealthUsingPolicy; - this._reportServiceHealth = _reportServiceHealth; - this._resolveService = _resolveService; - this._getPartitionInfoList = _getPartitionInfoList; - this._getPartitionInfo = _getPartitionInfo; - this._getServiceNameInfo = _getServiceNameInfo; - this._getPartitionHealth = _getPartitionHealth; - this._getPartitionHealthUsingPolicy = _getPartitionHealthUsingPolicy; - this._reportPartitionHealth = _reportPartitionHealth; - this._getPartitionLoadInformation = _getPartitionLoadInformation; - this._resetPartitionLoad = _resetPartitionLoad; - this._recoverPartition = _recoverPartition; - this._recoverServicePartitions = _recoverServicePartitions; - this._recoverSystemPartitions = _recoverSystemPartitions; - this._recoverAllPartitions = _recoverAllPartitions; - this._createRepairTask = _createRepairTask; - this._cancelRepairTask = _cancelRepairTask; - this._deleteRepairTask = _deleteRepairTask; - this._getRepairTaskList = _getRepairTaskList; - this._forceApproveRepairTask = _forceApproveRepairTask; - this._updateRepairTaskHealthPolicy = _updateRepairTaskHealthPolicy; - this._updateRepairExecutionState = _updateRepairExecutionState; - this._getReplicaInfoList = _getReplicaInfoList; - this._getReplicaInfo = _getReplicaInfo; - this._getReplicaHealth = _getReplicaHealth; - this._getReplicaHealthUsingPolicy = _getReplicaHealthUsingPolicy; - this._reportReplicaHealth = _reportReplicaHealth; - this._getDeployedServiceReplicaInfoList = _getDeployedServiceReplicaInfoList; - this._getDeployedServiceReplicaDetailInfo = _getDeployedServiceReplicaDetailInfo; - this._getDeployedServiceReplicaDetailInfoByPartitionId = _getDeployedServiceReplicaDetailInfoByPartitionId; - this._restartReplica = _restartReplica; - this._removeReplica = _removeReplica; - this._getDeployedServicePackageInfoList = _getDeployedServicePackageInfoList; - this._getDeployedServicePackageInfoListByName = _getDeployedServicePackageInfoListByName; - this._getDeployedServicePackageHealth = _getDeployedServicePackageHealth; - this._getDeployedServicePackageHealthUsingPolicy = _getDeployedServicePackageHealthUsingPolicy; - this._reportDeployedServicePackageHealth = _reportDeployedServicePackageHealth; - this._deployedServicePackageToNode = _deployedServicePackageToNode; - this._getDeployedCodePackageInfoList = _getDeployedCodePackageInfoList; - this._restartDeployedCodePackage = _restartDeployedCodePackage; - this._createComposeDeployment = _createComposeDeployment; - this._getComposeDeploymentStatus = _getComposeDeploymentStatus; - this._getComposeDeploymentStatusList = _getComposeDeploymentStatusList; - this._getComposeDeploymentUpgradeProgress = _getComposeDeploymentUpgradeProgress; - this._removeComposeDeployment = _removeComposeDeployment; - this._startComposeDeploymentUpgrade = _startComposeDeploymentUpgrade; - this._startChaos = _startChaos; - this._stopChaos = _stopChaos; - this._getChaosReport = _getChaosReport; - this._uploadFile = _uploadFile; - this._getImageStoreContent = _getImageStoreContent; - this._deleteImageStoreContent = _deleteImageStoreContent; - this._getImageStoreRootContent = _getImageStoreRootContent; - this._copyImageStoreContent = _copyImageStoreContent; - this._invokeInfrastructureCommand = _invokeInfrastructureCommand; - this._invokeInfrastructureQuery = _invokeInfrastructureQuery; - this._startDataLoss = _startDataLoss; - this._getDataLossProgress = _getDataLossProgress; - this._startQuorumLoss = _startQuorumLoss; - this._getQuorumLossProgress = _getQuorumLossProgress; - this._startPartitionRestart = _startPartitionRestart; - this._getPartitionRestartProgress = _getPartitionRestartProgress; - this._startNodeTransition = _startNodeTransition; - this._getNodeTransitionProgress = _getNodeTransitionProgress; - this._getFaultOperationList = _getFaultOperationList; - this._cancelOperation = _cancelOperation; - msRest.addSerializationMixin(this); + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + this.models = models; + this._getClusterManifest = _getClusterManifest; + this._getClusterHealth = _getClusterHealth; + this._getClusterHealthUsingPolicy = _getClusterHealthUsingPolicy; + this._getClusterHealthChunk = _getClusterHealthChunk; + this._getClusterHealthChunkUsingPolicyAndAdvancedFilters = _getClusterHealthChunkUsingPolicyAndAdvancedFilters; + this._reportClusterHealth = _reportClusterHealth; + this._getProvisionedFabricCodeVersionInfoList = _getProvisionedFabricCodeVersionInfoList; + this._getProvisionedFabricConfigVersionInfoList = _getProvisionedFabricConfigVersionInfoList; + this._getClusterUpgradeProgress = _getClusterUpgradeProgress; + this._getClusterConfiguration = _getClusterConfiguration; + this._getClusterConfigurationUpgradeStatus = _getClusterConfigurationUpgradeStatus; + this._getUpgradeOrchestrationServiceState = _getUpgradeOrchestrationServiceState; + this._setUpgradeOrchestrationServiceState = _setUpgradeOrchestrationServiceState; + this._provisionCluster = _provisionCluster; + this._unprovisionCluster = _unprovisionCluster; + this._rollbackClusterUpgrade = _rollbackClusterUpgrade; + this._resumeClusterUpgrade = _resumeClusterUpgrade; + this._startClusterUpgrade = _startClusterUpgrade; + this._startClusterConfigurationUpgrade = _startClusterConfigurationUpgrade; + this._updateClusterUpgrade = _updateClusterUpgrade; + this._getAadMetadata = _getAadMetadata; + this._getNodeInfoList = _getNodeInfoList; + this._getNodeInfo = _getNodeInfo; + this._getNodeHealth = _getNodeHealth; + this._getNodeHealthUsingPolicy = _getNodeHealthUsingPolicy; + this._reportNodeHealth = _reportNodeHealth; + this._getNodeLoadInfo = _getNodeLoadInfo; + this._disableNode = _disableNode; + this._enableNode = _enableNode; + this._removeNodeState = _removeNodeState; + this._restartNode = _restartNode; + this._getApplicationTypeInfoList = _getApplicationTypeInfoList; + this._getApplicationTypeInfoListByName = _getApplicationTypeInfoListByName; + this._provisionApplicationType = _provisionApplicationType; + this._unprovisionApplicationType = _unprovisionApplicationType; + this._getServiceTypeInfoList = _getServiceTypeInfoList; + this._getServiceTypeInfoByName = _getServiceTypeInfoByName; + this._getServiceManifest = _getServiceManifest; + this._getDeployedServiceTypeInfoList = _getDeployedServiceTypeInfoList; + this._getDeployedServiceTypeInfoByName = _getDeployedServiceTypeInfoByName; + this._createApplication = _createApplication; + this._deleteApplication = _deleteApplication; + this._getApplicationLoadInfo = _getApplicationLoadInfo; + this._getApplicationInfoList = _getApplicationInfoList; + this._getApplicationInfo = _getApplicationInfo; + this._getApplicationHealth = _getApplicationHealth; + this._getApplicationHealthUsingPolicy = _getApplicationHealthUsingPolicy; + this._reportApplicationHealth = _reportApplicationHealth; + this._startApplicationUpgrade = _startApplicationUpgrade; + this._getApplicationUpgrade = _getApplicationUpgrade; + this._updateApplicationUpgrade = _updateApplicationUpgrade; + this._resumeApplicationUpgrade = _resumeApplicationUpgrade; + this._rollbackApplicationUpgrade = _rollbackApplicationUpgrade; + this._getDeployedApplicationInfoList = _getDeployedApplicationInfoList; + this._getDeployedApplicationInfo = _getDeployedApplicationInfo; + this._getDeployedApplicationHealth = _getDeployedApplicationHealth; + this._getDeployedApplicationHealthUsingPolicy = _getDeployedApplicationHealthUsingPolicy; + this._reportDeployedApplicationHealth = _reportDeployedApplicationHealth; + this._getApplicationManifest = _getApplicationManifest; + this._getServiceInfoList = _getServiceInfoList; + this._getServiceInfo = _getServiceInfo; + this._getApplicationNameInfo = _getApplicationNameInfo; + this._createService = _createService; + this._createServiceFromTemplate = _createServiceFromTemplate; + this._deleteService = _deleteService; + this._updateService = _updateService; + this._getServiceDescription = _getServiceDescription; + this._getServiceHealth = _getServiceHealth; + this._getServiceHealthUsingPolicy = _getServiceHealthUsingPolicy; + this._reportServiceHealth = _reportServiceHealth; + this._resolveService = _resolveService; + this._getPartitionInfoList = _getPartitionInfoList; + this._getPartitionInfo = _getPartitionInfo; + this._getServiceNameInfo = _getServiceNameInfo; + this._getPartitionHealth = _getPartitionHealth; + this._getPartitionHealthUsingPolicy = _getPartitionHealthUsingPolicy; + this._reportPartitionHealth = _reportPartitionHealth; + this._getPartitionLoadInformation = _getPartitionLoadInformation; + this._resetPartitionLoad = _resetPartitionLoad; + this._recoverPartition = _recoverPartition; + this._recoverServicePartitions = _recoverServicePartitions; + this._recoverSystemPartitions = _recoverSystemPartitions; + this._recoverAllPartitions = _recoverAllPartitions; + this._createRepairTask = _createRepairTask; + this._cancelRepairTask = _cancelRepairTask; + this._deleteRepairTask = _deleteRepairTask; + this._getRepairTaskList = _getRepairTaskList; + this._forceApproveRepairTask = _forceApproveRepairTask; + this._updateRepairTaskHealthPolicy = _updateRepairTaskHealthPolicy; + this._updateRepairExecutionState = _updateRepairExecutionState; + this._getReplicaInfoList = _getReplicaInfoList; + this._getReplicaInfo = _getReplicaInfo; + this._getReplicaHealth = _getReplicaHealth; + this._getReplicaHealthUsingPolicy = _getReplicaHealthUsingPolicy; + this._reportReplicaHealth = _reportReplicaHealth; + this._getDeployedServiceReplicaInfoList = _getDeployedServiceReplicaInfoList; + this._getDeployedServiceReplicaDetailInfo = _getDeployedServiceReplicaDetailInfo; + this._getDeployedServiceReplicaDetailInfoByPartitionId = _getDeployedServiceReplicaDetailInfoByPartitionId; + this._restartReplica = _restartReplica; + this._removeReplica = _removeReplica; + this._getDeployedServicePackageInfoList = _getDeployedServicePackageInfoList; + this._getDeployedServicePackageInfoListByName = _getDeployedServicePackageInfoListByName; + this._getDeployedServicePackageHealth = _getDeployedServicePackageHealth; + this._getDeployedServicePackageHealthUsingPolicy = _getDeployedServicePackageHealthUsingPolicy; + this._reportDeployedServicePackageHealth = _reportDeployedServicePackageHealth; + this._deployServicePackageToNode = _deployServicePackageToNode; + this._getDeployedCodePackageInfoList = _getDeployedCodePackageInfoList; + this._restartDeployedCodePackage = _restartDeployedCodePackage; + this._getContainerLogsDeployedOnNode = _getContainerLogsDeployedOnNode; + this._invokeContainerApi = _invokeContainerApi; + this._createComposeDeployment = _createComposeDeployment; + this._getComposeDeploymentStatus = _getComposeDeploymentStatus; + this._getComposeDeploymentStatusList = _getComposeDeploymentStatusList; + this._getComposeDeploymentUpgradeProgress = _getComposeDeploymentUpgradeProgress; + this._removeComposeDeployment = _removeComposeDeployment; + this._startComposeDeploymentUpgrade = _startComposeDeploymentUpgrade; + this._getChaos = _getChaos; + this._startChaos = _startChaos; + this._stopChaos = _stopChaos; + this._getChaosEvents = _getChaosEvents; + this._getChaosSchedule = _getChaosSchedule; + this._postChaosSchedule = _postChaosSchedule; + this._uploadFile = _uploadFile; + this._getImageStoreContent = _getImageStoreContent; + this._deleteImageStoreContent = _deleteImageStoreContent; + this._getImageStoreRootContent = _getImageStoreRootContent; + this._copyImageStoreContent = _copyImageStoreContent; + this._deleteImageStoreUploadSession = _deleteImageStoreUploadSession; + this._commitImageStoreUploadSession = _commitImageStoreUploadSession; + this._getImageStoreUploadSessionById = _getImageStoreUploadSessionById; + this._getImageStoreUploadSessionByPath = _getImageStoreUploadSessionByPath; + this._uploadFileChunk = _uploadFileChunk; + this._invokeInfrastructureCommand = _invokeInfrastructureCommand; + this._invokeInfrastructureQuery = _invokeInfrastructureQuery; + this._startDataLoss = _startDataLoss; + this._getDataLossProgress = _getDataLossProgress; + this._startQuorumLoss = _startQuorumLoss; + this._getQuorumLossProgress = _getQuorumLossProgress; + this._startPartitionRestart = _startPartitionRestart; + this._getPartitionRestartProgress = _getPartitionRestartProgress; + this._startNodeTransition = _startNodeTransition; + this._getNodeTransitionProgress = _getNodeTransitionProgress; + this._getFaultOperationList = _getFaultOperationList; + this._cancelOperation = _cancelOperation; + this._createBackupPolicy = _createBackupPolicy; + this._deleteBackupPolicy = _deleteBackupPolicy; + this._getBackupPolicyList = _getBackupPolicyList; + this._getBackupPolicyByName = _getBackupPolicyByName; + this._getAllEntitiesBackedUpByPolicy = _getAllEntitiesBackedUpByPolicy; + this._updateBackupPolicy = _updateBackupPolicy; + this._enableApplicationBackup = _enableApplicationBackup; + this._disableApplicationBackup = _disableApplicationBackup; + this._getApplicationBackupConfigurationInfo = _getApplicationBackupConfigurationInfo; + this._getApplicationBackupList = _getApplicationBackupList; + this._suspendApplicationBackup = _suspendApplicationBackup; + this._resumeApplicationBackup = _resumeApplicationBackup; + this._enableServiceBackup = _enableServiceBackup; + this._disableServiceBackup = _disableServiceBackup; + this._getServiceBackupConfigurationInfo = _getServiceBackupConfigurationInfo; + this._getServiceBackupList = _getServiceBackupList; + this._suspendServiceBackup = _suspendServiceBackup; + this._resumeServiceBackup = _resumeServiceBackup; + this._enablePartitionBackup = _enablePartitionBackup; + this._disablePartitionBackup = _disablePartitionBackup; + this._getPartitionBackupConfigurationInfo = _getPartitionBackupConfigurationInfo; + this._getPartitionBackupList = _getPartitionBackupList; + this._suspendPartitionBackup = _suspendPartitionBackup; + this._resumePartitionBackup = _resumePartitionBackup; + this._backupPartition = _backupPartition; + this._getPartitionBackupProgress = _getPartitionBackupProgress; + this._restorePartition = _restorePartition; + this._getPartitionRestoreProgress = _getPartitionRestoreProgress; + this._getBackupsFromBackupLocation = _getBackupsFromBackupLocation; + this._createName = _createName; + this._getNameExistsInfo = _getNameExistsInfo; + this._deleteName = _deleteName; + this._getSubNameInfoList = _getSubNameInfoList; + this._getPropertyInfoList = _getPropertyInfoList; + this._putProperty = _putProperty; + this._getPropertyInfo = _getPropertyInfo; + this._deleteProperty = _deleteProperty; + this._submitPropertyBatch = _submitPropertyBatch; + this._getClusterEventList = _getClusterEventList; + this._getContainersEventList = _getContainersEventList; + this._getNodeEventList = _getNodeEventList; + this._getNodesEventList = _getNodesEventList; + this._getApplicationEventList = _getApplicationEventList; + this._getApplicationsEventList = _getApplicationsEventList; + this._getServiceEventList = _getServiceEventList; + this._getServicesEventList = _getServicesEventList; + this._getPartitionEventList = _getPartitionEventList; + this._getPartitionsEventList = _getPartitionsEventList; + this._getPartitionReplicaEventList = _getPartitionReplicaEventList; + this._getPartitionReplicasEventList = _getPartitionReplicasEventList; + this._getCorrelatedEventList = _getCorrelatedEventList; + this._createApplicationResource = _createApplicationResource; + this._getApplicationResource = _getApplicationResource; + this._deleteApplicationResource = _deleteApplicationResource; + this._getServices = _getServices; + this._getService = _getService; + this._getReplicas = _getReplicas; + this._getReplica = _getReplica; + this._createVolumeResource = _createVolumeResource; + this._getVolumeResource = _getVolumeResource; + this._deleteVolumeResource = _deleteVolumeResource; + msRest.addSerializationMixin(this); + } + + /** + * @summary Get the Service Fabric cluster manifest. + * + * Get the Service Fabric cluster manifest. The cluster manifest contains + * properties of the cluster that include different node types on the cluster, + * security configurations, fault, and upgrade domain topologies, etc. + * + * These properties are specified as part of the ClusterConfig.JSON file while + * deploying a stand-alone cluster. However, most of the information in the + * cluster manifest + * is generated internally by service fabric during cluster deployment in other + * deployment scenarios (e.g. when using Azure portal). + * + * The contents of the cluster manifest are for informational purposes only and + * users are not expected to take a dependency on the format of the file + * contents or its interpretation. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterManifestWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterManifest(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 the Service Fabric cluster manifest. + * + * Get the Service Fabric cluster manifest. The cluster manifest contains + * properties of the cluster that include different node types on the cluster, + * security configurations, fault, and upgrade domain topologies, etc. + * + * These properties are specified as part of the ClusterConfig.JSON file while + * deploying a stand-alone cluster. However, most of the information in the + * cluster manifest + * is generated internally by service fabric during cluster deployment in other + * deployment scenarios (e.g. when using Azure portal). + * + * The contents of the cluster manifest are for informational purposes only and + * users are not expected to take a dependency on the format of the file + * contents or its interpretation. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterManifest} - 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 ClusterManifest} 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. + */ + getClusterManifest(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterManifest(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterManifest(options, optionalCallback); + } + } + + /** + * @summary Gets the health of a Service Fabric cluster. + * + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the cluster based on the health state. + * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to + * filter the collection of nodes and applications returned based on their + * aggregated health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.nodesHealthStateFilter] Allows filtering of the + * node health state objects returned in the result of cluster health query + * based on their health state. The possible values for this parameter include + * integer value of one of the + * following health states. Only nodes that match the filter are returned. All + * nodes are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of nodes with + * HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.applicationsHealthStateFilter] Allows filtering of + * the application health state objects returned in the result of cluster + * health + * query based on their health state. + * The possible values for this parameter include integer value obtained from + * members or bitwise operations + * on members of HealthStateFilter enumeration. Only applications that match + * the filter are returned. + * All applications are used to evaluate the aggregated health state. If not + * specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of applications + * with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {boolean} [options.includeSystemApplicationHealthStatistics] + * Indicates whether the health statistics should include the fabric:/System + * application health statistics. False by default. + * If IncludeSystemApplicationHealthStatistics is set to true, the health + * statistics include the entities that belong to the fabric:/System + * application. + * Otherwise, the query result includes health statistics only for user + * applications. + * The health statistics must be included in the query result for this + * parameter to be applied. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterHealthWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterHealth(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 health of a Service Fabric cluster. + * + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the cluster based on the health state. + * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to + * filter the collection of nodes and applications returned based on their + * aggregated health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.nodesHealthStateFilter] Allows filtering of the + * node health state objects returned in the result of cluster health query + * based on their health state. The possible values for this parameter include + * integer value of one of the + * following health states. Only nodes that match the filter are returned. All + * nodes are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of nodes with + * HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.applicationsHealthStateFilter] Allows filtering of + * the application health state objects returned in the result of cluster + * health + * query based on their health state. + * The possible values for this parameter include integer value obtained from + * members or bitwise operations + * on members of HealthStateFilter enumeration. Only applications that match + * the filter are returned. + * All applications are used to evaluate the aggregated health state. If not + * specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of applications + * with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {boolean} [options.includeSystemApplicationHealthStatistics] + * Indicates whether the health statistics should include the fabric:/System + * application health statistics. False by default. + * If IncludeSystemApplicationHealthStatistics is set to true, the health + * statistics include the entities that belong to the fabric:/System + * application. + * Otherwise, the query result includes health statistics only for user + * applications. + * The health statistics must be included in the query result for this + * parameter to be applied. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterHealth} - 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 ClusterHealth} 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. + */ + getClusterHealth(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterHealth(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterHealth(options, optionalCallback); + } + } + + /** + * @summary Gets the health of a Service Fabric cluster using the specified + * policy. + * + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the cluster based on the health state. + * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to + * filter the collection of nodes and applications returned based on their + * aggregated health state. + * Use ClusterHealthPolicies to override the health policies used to evaluate + * the health. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.nodesHealthStateFilter] Allows filtering of the + * node health state objects returned in the result of cluster health query + * based on their health state. The possible values for this parameter include + * integer value of one of the + * following health states. Only nodes that match the filter are returned. All + * nodes are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of nodes with + * HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.applicationsHealthStateFilter] Allows filtering of + * the application health state objects returned in the result of cluster + * health + * query based on their health state. + * The possible values for this parameter include integer value obtained from + * members or bitwise operations + * on members of HealthStateFilter enumeration. Only applications that match + * the filter are returned. + * All applications are used to evaluate the aggregated health state. If not + * specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of applications + * with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {boolean} [options.includeSystemApplicationHealthStatistics] + * Indicates whether the health statistics should include the fabric:/System + * application health statistics. False by default. + * If IncludeSystemApplicationHealthStatistics is set to true, the health + * statistics include the entities that belong to the fabric:/System + * application. + * Otherwise, the query result includes health statistics only for user + * applications. + * The health statistics must be included in the query result for this + * parameter to be applied. + * + * @param {object} [options.clusterHealthPolicies] Describes the health + * policies used to evaluate the cluster health. + * If not present, the health evaluation uses the cluster health policy defined + * in the cluster manifest or the default cluster health policy. + * By default, each application is evaluated using its specific application + * health policy, defined in the application manifest, or the default health + * policy, if no policy is defined in manifest. + * If the application health policy map is specified, and it has an entry for + * an application, the specified application health policy + * is used to evaluate the application health. + * + * @param {array} [options.clusterHealthPolicies.applicationHealthPolicyMap] + * Defines a map that contains specific application health policies for + * different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * + * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. + * + * @param {boolean} + * [options.clusterHealthPolicies.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.clusterHealthPolicies.clusterHealthPolicy.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} + * [options.clusterHealthPolicies.clusterHealthPolicy.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 {array} + * [options.clusterHealthPolicies.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterHealthUsingPolicyWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterHealthUsingPolicy(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 health of a Service Fabric cluster using the specified + * policy. + * + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the cluster based on the health state. + * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to + * filter the collection of nodes and applications returned based on their + * aggregated health state. + * Use ClusterHealthPolicies to override the health policies used to evaluate + * the health. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.nodesHealthStateFilter] Allows filtering of the + * node health state objects returned in the result of cluster health query + * based on their health state. The possible values for this parameter include + * integer value of one of the + * following health states. Only nodes that match the filter are returned. All + * nodes are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of nodes with + * HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.applicationsHealthStateFilter] Allows filtering of + * the application health state objects returned in the result of cluster + * health + * query based on their health state. + * The possible values for this parameter include integer value obtained from + * members or bitwise operations + * on members of HealthStateFilter enumeration. Only applications that match + * the filter are returned. + * All applications are used to evaluate the aggregated health state. If not + * specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of applications + * with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {boolean} [options.includeSystemApplicationHealthStatistics] + * Indicates whether the health statistics should include the fabric:/System + * application health statistics. False by default. + * If IncludeSystemApplicationHealthStatistics is set to true, the health + * statistics include the entities that belong to the fabric:/System + * application. + * Otherwise, the query result includes health statistics only for user + * applications. + * The health statistics must be included in the query result for this + * parameter to be applied. + * + * @param {object} [options.clusterHealthPolicies] Describes the health + * policies used to evaluate the cluster health. + * If not present, the health evaluation uses the cluster health policy defined + * in the cluster manifest or the default cluster health policy. + * By default, each application is evaluated using its specific application + * health policy, defined in the application manifest, or the default health + * policy, if no policy is defined in manifest. + * If the application health policy map is specified, and it has an entry for + * an application, the specified application health policy + * is used to evaluate the application health. + * + * @param {array} [options.clusterHealthPolicies.applicationHealthPolicyMap] + * Defines a map that contains specific application health policies for + * different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy is + * defined in the manifest). + * The map is empty by default. + * + * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. + * + * @param {boolean} + * [options.clusterHealthPolicies.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.clusterHealthPolicies.clusterHealthPolicy.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} + * [options.clusterHealthPolicies.clusterHealthPolicy.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 {array} + * [options.clusterHealthPolicies.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterHealth} - 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 ClusterHealth} 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. + */ + getClusterHealthUsingPolicy(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterHealthUsingPolicy(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterHealthUsingPolicy(options, optionalCallback); + } + } + + /** + * @summary Gets the health of a Service Fabric cluster using health chunks. + * + * Gets the health of a Service Fabric cluster using health chunks. Includes + * the aggregated health state of the cluster, but none of the cluster + * entities. + * To expand the cluster health and get the health state of all or some of the + * entities, use the POST URI and specify the cluster health chunk query + * description. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterHealthChunkWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterHealthChunk(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 health of a Service Fabric cluster using health chunks. + * + * Gets the health of a Service Fabric cluster using health chunks. Includes + * the aggregated health state of the cluster, but none of the cluster + * entities. + * To expand the cluster health and get the health state of all or some of the + * entities, use the POST URI and specify the cluster health chunk query + * description. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterHealthChunk} - 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 ClusterHealthChunk} 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. + */ + getClusterHealthChunk(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterHealthChunk(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterHealthChunk(options, optionalCallback); + } + } + + /** + * @summary Gets the health of a Service Fabric cluster using health chunks. + * + * Gets the health of a Service Fabric cluster using health chunks. The health + * evaluation is done based on the input cluster health chunk query + * description. + * The query description allows users to specify health policies for evaluating + * the cluster and its children. + * Users can specify very flexible filters to select which cluster entities to + * return. The selection can be done based on the entities health state and + * based on the hierarchy. + * The query can return multi-level children of the entities based on the + * specified filters. For example, it can return one application with a + * specified name, and for this application, return + * only services that are in Error or Warning, and all partitions and replicas + * for one of these services. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.clusterHealthChunkQueryDescription] Describes the + * cluster and application health policies used to evaluate the cluster health + * and the filters to select which cluster entities to be returned. + * If the cluster health policy is present, it is used to evaluate the cluster + * events and the cluster nodes. If not present, the health evaluation uses the + * cluster health policy defined in the cluster manifest or the default cluster + * health policy. + * By default, each application is evaluated using its specific application + * health policy, defined in the application manifest, or the default health + * policy, if no policy is defined in manifest. + * If the application health policy map is specified, and it has an entry for + * an application, the specified application health policy + * is used to evaluate the application health. + * Users can specify very flexible filters to select which cluster entities to + * include in response. The selection can be done based on the entities health + * state and based on the hierarchy. + * The query can return multi-level children of the entities based on the + * specified filters. For example, it can return one application with a + * specified name, and for this application, return + * only services that are in Error or Warning, and all partitions and replicas + * for one of these services. + * + * @param {array} [options.clusterHealthChunkQueryDescription.nodeFilters] + * Defines a list of filters that specify which nodes to be included in the + * returned cluster health chunk. + * If no filters are specified, no nodes are returned. All the nodes are used + * to evaluate the cluster's aggregated health state, regardless of the input + * filters. + * The cluster health chunk query may specify multiple node filters. + * For example, it can specify a filter to return all nodes with health state + * Error and another filter to always include a node identified by its + * NodeName. + * + * @param {array} + * [options.clusterHealthChunkQueryDescription.applicationFilters] Defines a + * list of filters that specify which applications to be included in the + * returned cluster health chunk. + * If no filters are specified, no applications are returned. All the + * applications are used to evaluate the cluster's aggregated health state, + * regardless of the input filters. + * The cluster health chunk query may specify multiple application filters. + * For example, it can specify a filter to return all applications with health + * state Error and another filter to always include applications of a specified + * application type. + * + * @param {object} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] Defines a + * health policy used to evaluate the health of the cluster or of a cluster + * node. + * + * @param {boolean} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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 {array} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {object} + * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterHealthChunkUsingPolicyAndAdvancedFilters(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 health of a Service Fabric cluster using health chunks. + * + * Gets the health of a Service Fabric cluster using health chunks. The health + * evaluation is done based on the input cluster health chunk query + * description. + * The query description allows users to specify health policies for evaluating + * the cluster and its children. + * Users can specify very flexible filters to select which cluster entities to + * return. The selection can be done based on the entities health state and + * based on the hierarchy. + * The query can return multi-level children of the entities based on the + * specified filters. For example, it can return one application with a + * specified name, and for this application, return + * only services that are in Error or Warning, and all partitions and replicas + * for one of these services. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.clusterHealthChunkQueryDescription] Describes the + * cluster and application health policies used to evaluate the cluster health + * and the filters to select which cluster entities to be returned. + * If the cluster health policy is present, it is used to evaluate the cluster + * events and the cluster nodes. If not present, the health evaluation uses the + * cluster health policy defined in the cluster manifest or the default cluster + * health policy. + * By default, each application is evaluated using its specific application + * health policy, defined in the application manifest, or the default health + * policy, if no policy is defined in manifest. + * If the application health policy map is specified, and it has an entry for + * an application, the specified application health policy + * is used to evaluate the application health. + * Users can specify very flexible filters to select which cluster entities to + * include in response. The selection can be done based on the entities health + * state and based on the hierarchy. + * The query can return multi-level children of the entities based on the + * specified filters. For example, it can return one application with a + * specified name, and for this application, return + * only services that are in Error or Warning, and all partitions and replicas + * for one of these services. + * + * @param {array} [options.clusterHealthChunkQueryDescription.nodeFilters] + * Defines a list of filters that specify which nodes to be included in the + * returned cluster health chunk. + * If no filters are specified, no nodes are returned. All the nodes are used + * to evaluate the cluster's aggregated health state, regardless of the input + * filters. + * The cluster health chunk query may specify multiple node filters. + * For example, it can specify a filter to return all nodes with health state + * Error and another filter to always include a node identified by its + * NodeName. + * + * @param {array} + * [options.clusterHealthChunkQueryDescription.applicationFilters] Defines a + * list of filters that specify which applications to be included in the + * returned cluster health chunk. + * If no filters are specified, no applications are returned. All the + * applications are used to evaluate the cluster's aggregated health state, + * regardless of the input filters. + * The cluster health chunk query may specify multiple application filters. + * For example, it can specify a filter to return all applications with health + * state Error and another filter to always include applications of a specified + * application type. + * + * @param {object} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] Defines a + * health policy used to evaluate the health of the cluster or of a cluster + * node. + * + * @param {boolean} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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 {array} + * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {object} + * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterHealthChunk} - 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 ClusterHealthChunk} 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. + */ + getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, optionalCallback); + } + } + + /** + * @summary Sends a health report on the Service Fabric cluster. + * + * Sends a health report on a Service Fabric cluster. The report must contain + * the information about the source of the health report and property on which + * it is reported. + * The report is sent to a Service Fabric gateway node, which forwards to the + * health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run + * GetClusterHealth and check that the report appears in the HealthEvents + * section. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + reportClusterHealthWithHttpOperationResponse(healthInformation, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._reportClusterHealth(healthInformation, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sends a health report on the Service Fabric cluster. + * + * Sends a health report on a Service Fabric cluster. The report must contain + * the information about the source of the health report and property on which + * it is reported. + * The report is sent to a Service Fabric gateway node, which forwards to the + * health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run + * GetClusterHealth and check that the report appears in the HealthEvents + * section. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + reportClusterHealth(healthInformation, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._reportClusterHealth(healthInformation, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reportClusterHealth(healthInformation, options, optionalCallback); + } + } + + /** + * @summary Gets a list of fabric code versions that are provisioned in a + * Service Fabric cluster. + * + * Gets a list of information about fabric code versions that are provisioned + * in the cluster. The parameter CodeVersion can be used to optionally filter + * the output to only that particular version. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.codeVersion] The product version of Service Fabric. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getProvisionedFabricCodeVersionInfoListWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getProvisionedFabricCodeVersionInfoList(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 list of fabric code versions that are provisioned in a + * Service Fabric cluster. + * + * Gets a list of information about fabric code versions that are provisioned + * in the cluster. The parameter CodeVersion can be used to optionally filter + * the output to only that particular version. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.codeVersion] The product version of Service Fabric. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {Array} - 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. + * + * {array} [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. + */ + getProvisionedFabricCodeVersionInfoList(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getProvisionedFabricCodeVersionInfoList(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProvisionedFabricCodeVersionInfoList(options, optionalCallback); + } + } + + /** + * @summary Gets a list of fabric config versions that are provisioned in a + * Service Fabric cluster. + * + * Gets a list of information about fabric config versions that are provisioned + * in the cluster. The parameter ConfigVersion can be used to optionally filter + * the output to only that particular version. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.configVersion] The config version of Service + * Fabric. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getProvisionedFabricConfigVersionInfoListWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getProvisionedFabricConfigVersionInfoList(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 list of fabric config versions that are provisioned in a + * Service Fabric cluster. + * + * Gets a list of information about fabric config versions that are provisioned + * in the cluster. The parameter ConfigVersion can be used to optionally filter + * the output to only that particular version. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.configVersion] The config version of Service + * Fabric. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {Array} - 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. + * + * {array} [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. + */ + getProvisionedFabricConfigVersionInfoList(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getProvisionedFabricConfigVersionInfoList(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProvisionedFabricConfigVersionInfoList(options, optionalCallback); + } + } + + /** + * @summary Gets the progress of the current cluster upgrade. + * + * Gets the current progress of the ongoing cluster upgrade. If no upgrade is + * currently in progress, get the last state of the previous cluster upgrade. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterUpgradeProgressWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterUpgradeProgress(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 progress of the current cluster upgrade. + * + * Gets the current progress of the ongoing cluster upgrade. If no upgrade is + * currently in progress, get the last state of the previous cluster upgrade. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterUpgradeProgressObject} - 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 ClusterUpgradeProgressObject} 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. + */ + getClusterUpgradeProgress(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterUpgradeProgress(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterUpgradeProgress(options, optionalCallback); + } + } + + /** + * @summary Get the Service Fabric standalone cluster configuration. + * + * The cluster configuration contains properties of the cluster that include + * different node types on the cluster, + * security configurations, fault, and upgrade domain topologies, etc. + * + * @param {string} configurationApiVersion The API version of the Standalone + * cluster json configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterConfigurationWithHttpOperationResponse(configurationApiVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterConfiguration(configurationApiVersion, 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 the Service Fabric standalone cluster configuration. + * + * The cluster configuration contains properties of the cluster that include + * different node types on the cluster, + * security configurations, fault, and upgrade domain topologies, etc. + * + * @param {string} configurationApiVersion The API version of the Standalone + * cluster json configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterConfiguration} - 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 ClusterConfiguration} 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. + */ + getClusterConfiguration(configurationApiVersion, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterConfiguration(configurationApiVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterConfiguration(configurationApiVersion, options, optionalCallback); + } + } + + /** + * @summary Get the cluster configuration upgrade status of a Service Fabric + * standalone cluster. + * + * Get the cluster configuration upgrade status details of a Service Fabric + * standalone cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getClusterConfigurationUpgradeStatusWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterConfigurationUpgradeStatus(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 the cluster configuration upgrade status of a Service Fabric + * standalone cluster. + * + * Get the cluster configuration upgrade status details of a Service Fabric + * standalone cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ClusterConfigurationUpgradeStatusInfo} - 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 ClusterConfigurationUpgradeStatusInfo} 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. + */ + getClusterConfigurationUpgradeStatus(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getClusterConfigurationUpgradeStatus(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getClusterConfigurationUpgradeStatus(options, optionalCallback); + } + } + + /** + * @summary Get the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Get the service state of Service Fabric Upgrade Orchestration Service. This + * API is internally used for support purposes. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getUpgradeOrchestrationServiceStateWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getUpgradeOrchestrationServiceState(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 the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Get the service state of Service Fabric Upgrade Orchestration Service. This + * API is internally used for support purposes. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {UpgradeOrchestrationServiceState} - 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 UpgradeOrchestrationServiceState} 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. + */ + getUpgradeOrchestrationServiceState(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getUpgradeOrchestrationServiceState(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getUpgradeOrchestrationServiceState(options, optionalCallback); + } + } + + /** + * @summary Update the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Update the service state of Service Fabric Upgrade Orchestration Service. + * This API is internally used for support purposes. + * + * @param {object} upgradeOrchestrationServiceState Service state of Service + * Fabric Upgrade Orchestration Service. + * + * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of + * Service Fabric Upgrade Orchestration Service. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + setUpgradeOrchestrationServiceStateWithHttpOperationResponse(upgradeOrchestrationServiceState, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Update the service state of Service Fabric Upgrade Orchestration + * Service. + * + * Update the service state of Service Fabric Upgrade Orchestration Service. + * This API is internally used for support purposes. + * + * @param {object} upgradeOrchestrationServiceState Service state of Service + * Fabric Upgrade Orchestration Service. + * + * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of + * Service Fabric Upgrade Orchestration Service. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {UpgradeOrchestrationServiceStateSummary} - 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 UpgradeOrchestrationServiceStateSummary} 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. + */ + setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, optionalCallback); + } + } + + /** + * @summary Provision the code or configuration packages of a Service Fabric + * cluster. + * + * Validate and provision the code or configuration packages of a Service + * Fabric cluster. + * + * @param {object} provisionFabricDescription Describes the parameters for + * provisioning a cluster. + * + * @param {string} [provisionFabricDescription.codeFilePath] The cluster code + * package file path. + * + * @param {string} [provisionFabricDescription.clusterManifestFilePath] The + * cluster manifest file path. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + provisionClusterWithHttpOperationResponse(provisionFabricDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._provisionCluster(provisionFabricDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Provision the code or configuration packages of a Service Fabric + * cluster. + * + * Validate and provision the code or configuration packages of a Service + * Fabric cluster. + * + * @param {object} provisionFabricDescription Describes the parameters for + * provisioning a cluster. + * + * @param {string} [provisionFabricDescription.codeFilePath] The cluster code + * package file path. + * + * @param {string} [provisionFabricDescription.clusterManifestFilePath] The + * cluster manifest file path. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + provisionCluster(provisionFabricDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._provisionCluster(provisionFabricDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._provisionCluster(provisionFabricDescription, options, optionalCallback); + } + } + + /** + * @summary Unprovision the code or configuration packages of a Service Fabric + * cluster. + * + * It is supported to unprovision code and configuration separately. + * + * @param {object} unprovisionFabricDescription Describes the parameters for + * unprovisioning a cluster. + * + * @param {string} [unprovisionFabricDescription.codeVersion] The cluster code + * package version. + * + * @param {string} [unprovisionFabricDescription.configVersion] The cluster + * manifest version. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + unprovisionClusterWithHttpOperationResponse(unprovisionFabricDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._unprovisionCluster(unprovisionFabricDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Unprovision the code or configuration packages of a Service Fabric + * cluster. + * + * It is supported to unprovision code and configuration separately. + * + * @param {object} unprovisionFabricDescription Describes the parameters for + * unprovisioning a cluster. + * + * @param {string} [unprovisionFabricDescription.codeVersion] The cluster code + * package version. + * + * @param {string} [unprovisionFabricDescription.configVersion] The cluster + * manifest version. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + unprovisionCluster(unprovisionFabricDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._unprovisionCluster(unprovisionFabricDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._unprovisionCluster(unprovisionFabricDescription, options, optionalCallback); + } + } + + /** + * @summary Rollback the upgrade of a Service Fabric cluster. + * + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + rollbackClusterUpgradeWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._rollbackClusterUpgrade(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Rollback the upgrade of a Service Fabric cluster. + * + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + rollbackClusterUpgrade(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._rollbackClusterUpgrade(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._rollbackClusterUpgrade(options, optionalCallback); + } + } + + /** + * @summary Make the cluster upgrade move on to the next upgrade domain. + * + * Make the cluster code or configuration upgrade move on to the next upgrade + * domain if appropriate. + * + * @param {object} resumeClusterUpgradeDescription Describes the parameters for + * resuming a cluster upgrade. + * + * @param {string} resumeClusterUpgradeDescription.upgradeDomain The next + * upgrade domain for this cluster upgrade. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + resumeClusterUpgradeWithHttpOperationResponse(resumeClusterUpgradeDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Make the cluster upgrade move on to the next upgrade domain. + * + * Make the cluster code or configuration upgrade move on to the next upgrade + * domain if appropriate. + * + * @param {object} resumeClusterUpgradeDescription Describes the parameters for + * resuming a cluster upgrade. + * + * @param {string} resumeClusterUpgradeDescription.upgradeDomain The next + * upgrade domain for this cluster upgrade. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + resumeClusterUpgrade(resumeClusterUpgradeDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, optionalCallback); + } + } + + /** + * @summary Start upgrading the code or configuration version of a Service + * Fabric cluster. + * + * Validate the supplied upgrade parameters and start upgrading the code or + * configuration version of a Service Fabric cluster if the parameters are + * valid. + * + * @param {object} startClusterUpgradeDescription Describes the parameters for + * starting a cluster upgrade. + * + * @param {string} [startClusterUpgradeDescription.codeVersion] The cluster + * code version. + * + * @param {string} [startClusterUpgradeDescription.configVersion] The cluster + * configuration version. + * + * @param {string} [startClusterUpgradeDescription.upgradeKind] The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {number} + * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [startClusterUpgradeDescription.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} [startClusterUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. + * + * @param {string} + * [startClusterUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [startClusterUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [startClusterUpgradeDescription.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. + * + * @param {boolean} + * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [startClusterUpgradeDescription.clusterHealthPolicy.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} + * [startClusterUpgradeDescription.clusterHealthPolicy.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 {array} + * [startClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {boolean} + * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * enables delta health evaluation rather than absolute health evaluation after + * completion of each upgrade domain. + * + * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. + * + * @param {number} + * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. + * + * @param {number} + * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. + * + * @param {object} [startClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + startClusterUpgradeWithHttpOperationResponse(startClusterUpgradeDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start upgrading the code or configuration version of a Service + * Fabric cluster. + * + * Validate the supplied upgrade parameters and start upgrading the code or + * configuration version of a Service Fabric cluster if the parameters are + * valid. + * + * @param {object} startClusterUpgradeDescription Describes the parameters for + * starting a cluster upgrade. + * + * @param {string} [startClusterUpgradeDescription.codeVersion] The cluster + * code version. + * + * @param {string} [startClusterUpgradeDescription.configVersion] The cluster + * configuration version. + * + * @param {string} [startClusterUpgradeDescription.upgradeKind] The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {number} + * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [startClusterUpgradeDescription.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} [startClusterUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. + * + * @param {string} + * [startClusterUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [startClusterUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} + * [startClusterUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [startClusterUpgradeDescription.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. + * + * @param {boolean} + * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [startClusterUpgradeDescription.clusterHealthPolicy.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} + * [startClusterUpgradeDescription.clusterHealthPolicy.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 {array} + * [startClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {boolean} + * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * enables delta health evaluation rather than absolute health evaluation after + * completion of each upgrade domain. + * + * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. + * + * @param {number} + * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. + * + * @param {number} + * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. + * + * @param {object} [startClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + startClusterUpgrade(startClusterUpgradeDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startClusterUpgrade(startClusterUpgradeDescription, options, optionalCallback); + } + } + + /** + * @summary Start upgrading the configuration of a Service Fabric standalone + * cluster. + * + * Validate the supplied configuration upgrade parameters and start upgrading + * the cluster configuration if the parameters are valid. + * + * @param {object} clusterConfigurationUpgradeDescription Parameters for a + * standalone cluster configuration upgrade. + * + * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The + * cluster configuration. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length + * of time between attempts to perform a health checks if the application or + * cluster is not healthy. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckWaitDurationInSeconds] + * The length of time to wait after completing an upgrade domain before + * starting the health checks process. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] + * The length of time that the application or cluster must remain healthy. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The + * timeout for the upgrade domain. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.upgradeTimeoutInSeconds] The upgrade + * timeout. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyApplications] The + * maximum allowed percentage of unhealthy applications during the upgrade. + * Allowed values are integer values from zero to 100. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes during the upgrade. Allowed + * values are integer values from zero to 100. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentDeltaUnhealthyNodes] The + * maximum allowed percentage of delta health degradation during the upgrade. + * Allowed values are integer values from zero to 100. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUpgradeDomainDeltaUnhealthyNodes] + * The maximum allowed percentage of upgrade domain delta health degradation + * during the upgrade. Allowed values are integer values from zero to 100. + * + * @param {object} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies] Defines + * the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + startClusterConfigurationUpgradeWithHttpOperationResponse(clusterConfigurationUpgradeDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start upgrading the configuration of a Service Fabric standalone + * cluster. + * + * Validate the supplied configuration upgrade parameters and start upgrading + * the cluster configuration if the parameters are valid. + * + * @param {object} clusterConfigurationUpgradeDescription Parameters for a + * standalone cluster configuration upgrade. + * + * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The + * cluster configuration. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length + * of time between attempts to perform a health checks if the application or + * cluster is not healthy. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckWaitDurationInSeconds] + * The length of time to wait after completing an upgrade domain before + * starting the health checks process. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] + * The length of time that the application or cluster must remain healthy. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The + * timeout for the upgrade domain. + * + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.upgradeTimeoutInSeconds] The upgrade + * timeout. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyApplications] The + * maximum allowed percentage of unhealthy applications during the upgrade. + * Allowed values are integer values from zero to 100. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes during the upgrade. Allowed + * values are integer values from zero to 100. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentDeltaUnhealthyNodes] The + * maximum allowed percentage of delta health degradation during the upgrade. + * Allowed values are integer values from zero to 100. + * + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUpgradeDomainDeltaUnhealthyNodes] + * The maximum allowed percentage of upgrade domain delta health degradation + * during the upgrade. Allowed values are integer values from zero to 100. + * + * @param {object} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies] Defines + * the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback); + } + } + + /** + * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. + * + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param {object} updateClusterUpgradeDescription Parameters for updating a + * cluster upgrade. + * + * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling', 'Rolling_ForceRestart' + * + * @param {object} [updateClusterUpgradeDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. + * + * @param {string} + * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {boolean} + * [updateClusterUpgradeDescription.updateDescription.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 {number} + * [updateClusterUpgradeDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} + * [updateClusterUpgradeDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [updateClusterUpgradeDescription.clusterHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. + * + * @param {boolean} + * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [updateClusterUpgradeDescription.clusterHealthPolicy.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} + * [updateClusterUpgradeDescription.clusterHealthPolicy.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 {array} + * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {boolean} + * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * enables delta health evaluation rather than absolute health evaluation after + * completion of each upgrade domain. + * + * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. + * + * @param {number} + * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. + * + * @param {number} + * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. + * + * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + updateClusterUpgradeWithHttpOperationResponse(updateClusterUpgradeDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateClusterUpgrade(updateClusterUpgradeDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. + * + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param {object} updateClusterUpgradeDescription Parameters for updating a + * cluster upgrade. + * + * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling', 'Rolling_ForceRestart' + * + * @param {object} [updateClusterUpgradeDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. + * + * @param {string} + * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {boolean} + * [updateClusterUpgradeDescription.updateDescription.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 {number} + * [updateClusterUpgradeDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} + * [updateClusterUpgradeDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} + * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [updateClusterUpgradeDescription.clusterHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. + * + * @param {boolean} + * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [updateClusterUpgradeDescription.clusterHealthPolicy.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} + * [updateClusterUpgradeDescription.clusterHealthPolicy.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 {array} + * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {boolean} + * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * enables delta health evaluation rather than absolute health evaluation after + * completion of each upgrade domain. + * + * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. + * + * @param {number} + * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. + * + * @param {number} + * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. + * + * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {array} + * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + updateClusterUpgrade(updateClusterUpgradeDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateClusterUpgrade(updateClusterUpgradeDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateClusterUpgrade(updateClusterUpgradeDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the Azure Active Directory metadata used for secured + * connection to cluster. + * + * Gets the Azure Active Directory metadata used for secured connection to + * cluster. + * This API is not supposed to be called separately. It provides information + * needed to set up an Azure Active Directory secured connection with a Service + * Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getAadMetadataWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getAadMetadata(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 Azure Active Directory metadata used for secured + * connection to cluster. + * + * Gets the Azure Active Directory metadata used for secured connection to + * cluster. + * This API is not supposed to be called separately. It provides information + * needed to set up an Azure Active Directory secured connection with a Service + * Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {AadMetadataObject} - 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 AadMetadataObject} 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. + */ + getAadMetadata(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAadMetadata(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAadMetadata(options, optionalCallback); + } + } + + /** + * @summary Gets the list of nodes in the Service Fabric cluster. + * + * The response includes the name, status, ID, health, uptime, and other + * details about the nodes. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {string} [options.nodeStatusFilter] Allows filtering the nodes based + * on the NodeStatus. Only the nodes that are matching the specified filter + * value will be returned. The filter value can be one of the following. + * Possible values include: 'default', 'all', 'up', 'down', 'enabling', + * 'disabling', 'disabled', 'unknown', 'removed' + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getNodeInfoListWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getNodeInfoList(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 nodes in the Service Fabric cluster. + * + * The response includes the name, status, ID, health, uptime, and other + * details about the nodes. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {string} [options.nodeStatusFilter] Allows filtering the nodes based + * on the NodeStatus. Only the nodes that are matching the specified filter + * value will be returned. The filter value can be one of the following. + * Possible values include: 'default', 'all', 'up', 'down', 'enabling', + * 'disabling', 'disabled', 'unknown', 'removed' + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedNodeInfoList} - 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 PagedNodeInfoList} 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. + */ + getNodeInfoList(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNodeInfoList(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNodeInfoList(options, optionalCallback); + } + } + + /** + * @summary Gets the information about a specific node in the Service Fabric + * cluster. + * + * The response includes the name, status, ID, health, uptime, and other + * details about the node. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getNodeInfoWithHttpOperationResponse(nodeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getNodeInfo(nodeName, 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 information about a specific node in the Service Fabric + * cluster. + * + * The response includes the name, status, ID, health, uptime, and other + * details about the node. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {NodeInfo} - 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 NodeInfo} 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. + */ + getNodeInfo(nodeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNodeInfo(nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNodeInfo(nodeName, options, optionalCallback); + } + } + + /** + * @summary Gets the health of a Service Fabric node. + * + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to + * filter the collection of health events reported on the node based on the + * health state. If the node that you specify by name does not exist in the + * health store, this returns an error. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getNodeHealthWithHttpOperationResponse(nodeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getNodeHealth(nodeName, 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 health of a Service Fabric node. + * + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to + * filter the collection of health events reported on the node based on the + * health state. If the node that you specify by name does not exist in the + * health store, this returns an error. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {NodeHealth} - 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 NodeHealth} 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. + */ + getNodeHealth(nodeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNodeHealth(nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNodeHealth(nodeName, options, optionalCallback); + } + } + + /** + * @summary Gets the health of a Service Fabric node, by using the specified + * health policy. + * + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to + * filter the collection of health events reported on the node based on the + * health state. Use ClusterHealthPolicy in the POST body to override the + * health policies used to evaluate the health. If the node that you specify by + * name does not exist in the health store, this returns an error. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {object} [options.clusterHealthPolicy] Describes the health policies + * used to evaluate the health of a cluster or node. If not present, the health + * evaluation uses the health policy from cluster manifest or the default + * health policy. + * + * @param {boolean} [options.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} [options.clusterHealthPolicy.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} + * [options.clusterHealthPolicy.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 {array} [options.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getNodeHealthUsingPolicyWithHttpOperationResponse(nodeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getNodeHealthUsingPolicy(nodeName, 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 health of a Service Fabric node, by using the specified + * health policy. + * + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to + * filter the collection of health events reported on the node based on the + * health state. Use ClusterHealthPolicy in the POST body to override the + * health policies used to evaluate the health. If the node that you specify by + * name does not exist in the health store, this returns an error. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {object} [options.clusterHealthPolicy] Describes the health policies + * used to evaluate the health of a cluster or node. If not present, the health + * evaluation uses the health policy from cluster manifest or the default + * health policy. + * + * @param {boolean} [options.clusterHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} [options.clusterHealthPolicy.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} + * [options.clusterHealthPolicy.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 {array} [options.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * Defines a map with max percentage unhealthy applications for specific + * application types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {NodeHealth} - 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 NodeHealth} 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. + */ + getNodeHealthUsingPolicy(nodeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNodeHealthUsingPolicy(nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNodeHealthUsingPolicy(nodeName, options, optionalCallback); + } + } + + /** + * @summary Sends a health report on the Service Fabric node. + * + * Reports health state of the specified Service Fabric node. The report must + * contain the information about the source of the health report and property + * on which it is reported. + * The report is sent to a Service Fabric gateway node, which forwards to the + * health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run GetNodeHealth + * and check that the report appears in the HealthEvents section. + * + * @param {string} nodeName The name of the node. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + reportNodeHealthWithHttpOperationResponse(nodeName, healthInformation, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sends a health report on the Service Fabric node. + * + * Reports health state of the specified Service Fabric node. The report must + * contain the information about the source of the health report and property + * on which it is reported. + * The report is sent to a Service Fabric gateway node, which forwards to the + * health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run GetNodeHealth + * and check that the report appears in the HealthEvents section. + * + * @param {string} nodeName The name of the node. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + reportNodeHealth(nodeName, healthInformation, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reportNodeHealth(nodeName, healthInformation, options, optionalCallback); + } + } + + /** + * @summary Gets the load information of a Service Fabric node. + * + * Retrieves the load information of a Service Fabric node for all the metrics + * that have load or capacity defined. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getNodeLoadInfoWithHttpOperationResponse(nodeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getNodeLoadInfo(nodeName, 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 load information of a Service Fabric node. + * + * Retrieves the load information of a Service Fabric node for all the metrics + * that have load or capacity defined. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {NodeLoadInfo} - 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 NodeLoadInfo} 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. + */ + getNodeLoadInfo(nodeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNodeLoadInfo(nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNodeLoadInfo(nodeName, options, optionalCallback); + } + } + + /** + * @summary Deactivate a Service Fabric cluster node with the specified + * deactivation intent. + * + * Deactivate a Service Fabric cluster node with the specified deactivation + * intent. Once the deactivation is in progress, the deactivation intent can be + * increased, but not decreased (for example, a node that is deactivated with + * the Pause intent can be deactivated further with Restart, but not the other + * way around. Nodes may be reactivated using the Activate a node operation any + * time after they are deactivated. If the deactivation is not complete, this + * will cancel the deactivation. A node that goes down and comes back up while + * deactivated will still need to be reactivated before services will be placed + * on that node. + * + * @param {string} nodeName The name of the node. + * + * @param {object} deactivationIntentDescription Describes the intent or reason + * for deactivating the node. + * + * @param {string} [deactivationIntentDescription.deactivationIntent] Describes + * the intent or reason for deactivating the node. The possible values are + * following. Possible values include: 'Pause', 'Restart', 'RemoveData' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + disableNodeWithHttpOperationResponse(nodeName, deactivationIntentDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deactivate a Service Fabric cluster node with the specified + * deactivation intent. + * + * Deactivate a Service Fabric cluster node with the specified deactivation + * intent. Once the deactivation is in progress, the deactivation intent can be + * increased, but not decreased (for example, a node that is deactivated with + * the Pause intent can be deactivated further with Restart, but not the other + * way around. Nodes may be reactivated using the Activate a node operation any + * time after they are deactivated. If the deactivation is not complete, this + * will cancel the deactivation. A node that goes down and comes back up while + * deactivated will still need to be reactivated before services will be placed + * on that node. + * + * @param {string} nodeName The name of the node. + * + * @param {object} deactivationIntentDescription Describes the intent or reason + * for deactivating the node. + * + * @param {string} [deactivationIntentDescription.deactivationIntent] Describes + * the intent or reason for deactivating the node. The possible values are + * following. Possible values include: 'Pause', 'Restart', 'RemoveData' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + disableNode(nodeName, deactivationIntentDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._disableNode(nodeName, deactivationIntentDescription, options, optionalCallback); + } + } + + /** + * @summary Activate a Service Fabric cluster node that is currently + * deactivated. + * + * Activates a Service Fabric cluster node that is currently deactivated. Once + * activated, the node will again become a viable target for placing new + * replicas, and any deactivated replicas remaining on the node will be + * reactivated. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + enableNodeWithHttpOperationResponse(nodeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._enableNode(nodeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Activate a Service Fabric cluster node that is currently + * deactivated. + * + * Activates a Service Fabric cluster node that is currently deactivated. Once + * activated, the node will again become a viable target for placing new + * replicas, and any deactivated replicas remaining on the node will be + * reactivated. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + enableNode(nodeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._enableNode(nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._enableNode(nodeName, options, optionalCallback); + } + } + + /** + * @summary Notifies Service Fabric that the persisted state on a node has been + * permanently removed or lost. + * + * This implies that it is not possible to recover the persisted state of that + * node. This generally happens if a hard disk has been wiped clean, or if a + * hard disk crashes. The node has to be down for this operation to be + * successful. This operation lets Service Fabric know that the replicas on + * that node no longer exist, and that Service Fabric should stop waiting for + * those replicas to come back up. Do not run this cmdlet if the state on the + * node has not been removed and the node can come back up with its state + * intact. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + removeNodeStateWithHttpOperationResponse(nodeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._removeNodeState(nodeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Notifies Service Fabric that the persisted state on a node has been + * permanently removed or lost. + * + * This implies that it is not possible to recover the persisted state of that + * node. This generally happens if a hard disk has been wiped clean, or if a + * hard disk crashes. The node has to be down for this operation to be + * successful. This operation lets Service Fabric know that the replicas on + * that node no longer exist, and that Service Fabric should stop waiting for + * those replicas to come back up. Do not run this cmdlet if the state on the + * node has not been removed and the node can come back up with its state + * intact. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + removeNodeState(nodeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._removeNodeState(nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._removeNodeState(nodeName, options, optionalCallback); + } + } + + /** + * @summary Restarts a Service Fabric cluster node. + * + * Restarts a Service Fabric cluster node that is already started. + * + * @param {string} nodeName The name of the node. + * + * @param {object} restartNodeDescription The instance of the node to be + * restarted and a flag indicating the need to take dump of the fabric process. + * + * @param {string} restartNodeDescription.nodeInstanceId The instance ID of the + * target node. If instance ID is specified the node is restarted only if it + * matches with the current instance of the node. A default value of "0" would + * match any instance ID. The instance ID can be obtained using get node query. + * + * @param {string} [restartNodeDescription.createFabricDump] Specify True to + * create a dump of the fabric node process. This is case-sensitive. Possible + * values include: 'False', 'True' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + restartNodeWithHttpOperationResponse(nodeName, restartNodeDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restarts a Service Fabric cluster node. + * + * Restarts a Service Fabric cluster node that is already started. + * + * @param {string} nodeName The name of the node. + * + * @param {object} restartNodeDescription The instance of the node to be + * restarted and a flag indicating the need to take dump of the fabric process. + * + * @param {string} restartNodeDescription.nodeInstanceId The instance ID of the + * target node. If instance ID is specified the node is restarted only if it + * matches with the current instance of the node. A default value of "0" would + * match any instance ID. The instance ID can be obtained using get node query. + * + * @param {string} [restartNodeDescription.createFabricDump] Specify True to + * create a dump of the fabric node process. This is case-sensitive. Possible + * values include: 'False', 'True' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + restartNode(nodeName, restartNodeDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restartNode(nodeName, restartNodeDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the list of application types in the Service Fabric cluster. + * + * Returns the information about the application types that are provisioned or + * in the process of being provisioned in the Service Fabric cluster. Each + * version of an application type is returned as one application type. The + * response includes the name, version, status, and other details about the + * application type. This is a paged query, meaning that if not all of the + * application types fit in a page, one page of results is returned as well as + * a continuation token, which can be used to get the next page. For example, + * if there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.applicationTypeDefinitionKindFilter] Used to filter + * on ApplicationTypeDefinitionKind which is the mechanism used to define a + * Service Fabric application type. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. + * - All - Filter that matches input with any ApplicationTypeDefinitionKind + * value. The value is 65535. + * - ServiceFabricApplicationPackage - Filter that matches input with + * ApplicationTypeDefinitionKind value ServiceFabricApplicationPackage. The + * value is 1. + * - Compose - Filter that matches input with ApplicationTypeDefinitionKind + * value Compose. The value is 2. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationTypeInfoListWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationTypeInfoList(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 types in the Service Fabric cluster. + * + * Returns the information about the application types that are provisioned or + * in the process of being provisioned in the Service Fabric cluster. Each + * version of an application type is returned as one application type. The + * response includes the name, version, status, and other details about the + * application type. This is a paged query, meaning that if not all of the + * application types fit in a page, one page of results is returned as well as + * a continuation token, which can be used to get the next page. For example, + * if there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.applicationTypeDefinitionKindFilter] Used to filter + * on ApplicationTypeDefinitionKind which is the mechanism used to define a + * Service Fabric application type. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. + * - All - Filter that matches input with any ApplicationTypeDefinitionKind + * value. The value is 65535. + * - ServiceFabricApplicationPackage - Filter that matches input with + * ApplicationTypeDefinitionKind value ServiceFabricApplicationPackage. The + * value is 1. + * - Compose - Filter that matches input with ApplicationTypeDefinitionKind + * value Compose. The value is 2. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedApplicationTypeInfoList} - 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 PagedApplicationTypeInfoList} 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. + */ + getApplicationTypeInfoList(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationTypeInfoList(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationTypeInfoList(options, optionalCallback); + } + } + + /** + * @summary Gets the list of application types in the Service Fabric cluster + * matching exactly the specified name. + * + * Returns the information about the application types that are provisioned or + * in the process of being provisioned in the Service Fabric cluster. These + * results are of application types whose name match exactly the one specified + * as the parameter, and which comply with the given query parameters. All + * versions of the application type matching the application type name are + * returned, with each version returned as one application type. The response + * includes the name, version, status, and other details about the application + * type. This is a paged query, meaning that if not all of the application + * types fit in a page, one page of results is returned as well as a + * continuation token, which can be used to get the next page. For example, if + * there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.applicationTypeVersion] The version of the + * application type. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationTypeInfoListByNameWithHttpOperationResponse(applicationTypeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationTypeInfoListByName(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 types in the Service Fabric cluster + * matching exactly the specified name. + * + * Returns the information about the application types that are provisioned or + * in the process of being provisioned in the Service Fabric cluster. These + * results are of application types whose name match exactly the one specified + * as the parameter, and which comply with the given query parameters. All + * versions of the application type matching the application type name are + * returned, with each version returned as one application type. The response + * includes the name, version, status, and other details about the application + * type. This is a paged query, meaning that if not all of the application + * types fit in a page, one page of results is returned as well as a + * continuation token, which can be used to get the next page. For example, if + * there are 10 application types but a page only fits the first three + * application types, or if max results is set to 3, then three is returned. To + * access the rest of the results, retrieve subsequent pages by using the + * returned continuation token in the next query. An empty continuation token + * is returned if there are no subsequent pages. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.applicationTypeVersion] The version of the + * application type. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedApplicationTypeInfoList} - 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 PagedApplicationTypeInfoList} 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. + */ + getApplicationTypeInfoListByName(applicationTypeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationTypeInfoListByName(applicationTypeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationTypeInfoListByName(applicationTypeName, options, optionalCallback); + } + } + + /** + * @summary Provisions or registers a Service Fabric application type with the + * cluster using the '.sfpkg' package in the external store or using the + * application package in the image store. + * + * Provisions a Service Fabric application type with the cluster. The provision + * is required before any new applications can be instantiated. + * The provision operation can be performed either on the application package + * specified by the relativePathInImageStore, or by using the URI of the + * external '.sfpkg'. + * + * @param {object} provisionApplicationTypeDescriptionBaseRequiredBodyParam The + * base type of provision application type description which supports either + * image store-based provision or external store-based provision. + * + * @param {boolean} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.async Indicates + * whether or not provisioning should occur asynchronously. When set to true, + * the provision operation returns when the request is accepted by the system, + * and the provision operation continues without any timeout limit. The default + * value is false. For large application packages, we recommend setting the + * value to true. + * + * @param {string} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + provisionApplicationTypeWithHttpOperationResponse(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Provisions or registers a Service Fabric application type with the + * cluster using the '.sfpkg' package in the external store or using the + * application package in the image store. + * + * Provisions a Service Fabric application type with the cluster. The provision + * is required before any new applications can be instantiated. + * The provision operation can be performed either on the application package + * specified by the relativePathInImageStore, or by using the URI of the + * external '.sfpkg'. + * + * @param {object} provisionApplicationTypeDescriptionBaseRequiredBodyParam The + * base type of provision application type description which supports either + * image store-based provision or external store-based provision. + * + * @param {boolean} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.async Indicates + * whether or not provisioning should occur asynchronously. When set to true, + * the provision operation returns when the request is accepted by the system, + * and the provision operation continues without any timeout limit. The default + * value is false. For large application packages, we recommend setting the + * value to true. + * + * @param {string} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, optionalCallback); + } + } + + /** + * @summary Removes or unregisters a Service Fabric application type from the + * cluster. + * + * This operation can only be performed if all application instances of the + * application type have been deleted. Once the application type is + * unregistered, no new application instances can be created for this + * particular application type. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {object} unprovisionApplicationTypeDescriptionInfo The relative path + * for the application package in the image store specified during the prior + * copy operation. + * + * @param {string} + * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version + * of the application type as defined in the application manifest. + * + * @param {boolean} [unprovisionApplicationTypeDescriptionInfo.async] The flag + * indicating whether or not unprovision should occur asynchronously. When set + * to true, the unprovision operation returns when the request is accepted by + * the system, and the unprovision operation continues without any timeout + * limit. The default value is false. However, we recommend setting it to true + * for large application packages that were provisioned. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + unprovisionApplicationTypeWithHttpOperationResponse(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Removes or unregisters a Service Fabric application type from the + * cluster. + * + * This operation can only be performed if all application instances of the + * application type have been deleted. Once the application type is + * unregistered, no new application instances can be created for this + * particular application type. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {object} unprovisionApplicationTypeDescriptionInfo The relative path + * for the application package in the image store specified during the prior + * copy operation. + * + * @param {string} + * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version + * of the application type as defined in the application manifest. + * + * @param {boolean} [unprovisionApplicationTypeDescriptionInfo.async] The flag + * indicating whether or not unprovision should occur asynchronously. When set + * to true, the unprovision operation returns when the request is accepted by + * the system, and the unprovision operation continues without any timeout + * limit. The default value is false. However, we recommend setting it to true + * for large application packages that were provisioned. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, optionalCallback); + } + } + + /** + * @summary Gets the list containing the information about service types that + * are supported by a provisioned application type in a Service Fabric cluster. + * + * Gets the list containing the information about service types that are + * supported by a provisioned application type in a Service Fabric cluster. The + * provided application type must exist. Otherwise, a 404 status is returned. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getServiceTypeInfoListWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, 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 containing the information about service types that + * are supported by a provisioned application type in a Service Fabric cluster. + * + * Gets the list containing the information about service types that are + * supported by a provisioned application type in a Service Fabric cluster. The + * provided application type must exist. Otherwise, a 404 status is returned. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {Array} - 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. + * + * {array} [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. + */ + getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback); + } + } + + /** + * @summary Gets the information about a specific service type that is + * supported by a provisioned application type in a Service Fabric cluster. + * + * Gets the information about a specific service type that is supported by a + * provisioned application type in a Service Fabric cluster. The provided + * application type must exist. Otherwise, a 404 status is returned. A 204 + * response is returned if the specificed service type is not found in the + * cluster. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getServiceTypeInfoByNameWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, serviceTypeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, 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 information about a specific service type that is + * supported by a provisioned application type in a Service Fabric cluster. + * + * Gets the information about a specific service type that is supported by a + * provisioned application type in a Service Fabric cluster. The provided + * application type must exist. Otherwise, a 404 status is returned. A 204 + * response is returned if the specificed service type is not found in the + * cluster. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ServiceTypeInfo} - 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 ServiceTypeInfo} 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. + */ + getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, optionalCallback); + } + } + + /** + * @summary Gets the manifest describing a service type. + * + * Gets the manifest describing a service type. The response contains the + * service manifest XML as a string. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getServiceManifestWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, serviceManifestName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, 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 manifest describing a service type. + * + * Gets the manifest describing a service type. The response contains the + * service manifest XML as a string. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ServiceTypeManifest} - 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 ServiceTypeManifest} 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. + */ + getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, optionalCallback); + } + } + + /** + * @summary Gets the list containing the information about service types from + * the applications deployed on a node in a Service Fabric cluster. + * + * Gets the list containing the information about service types from the + * applications deployed on a node in a Service Fabric cluster. The response + * includes the name of the service type, its registration status, the code + * package that registered it and activation ID of the service package. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceManifestName] The name of the service + * manifest to filter the list of deployed service type information. If + * specified, the response will only contain the information about service + * types that are defined in this service manifest. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getDeployedServiceTypeInfoListWithHttpOperationResponse(nodeName, applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedServiceTypeInfoList(nodeName, applicationId, 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 containing the information about service types from + * the applications deployed on a node in a Service Fabric cluster. + * + * Gets the list containing the information about service types from the + * applications deployed on a node in a Service Fabric cluster. The response + * includes the name of the service type, its registration status, the code + * package that registered it and activation ID of the service package. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceManifestName] The name of the service + * manifest to filter the list of deployed service type information. If + * specified, the response will only contain the information about service + * types that are defined in this service manifest. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {Array} - 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. + * + * {array} [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. + */ + getDeployedServiceTypeInfoList(nodeName, applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the information about a specified service type of the + * application deployed on a node in a Service Fabric cluster. + * + * Gets the list containing the information about a specific service type from + * the applications deployed on a node in a Service Fabric cluster. The + * response includes the name of the service type, its registration status, the + * code package that registered it and activation ID of the service package. + * Each entry represents one activation of a service type, differentiated by + * the activation ID. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceManifestName] The name of the service + * manifest to filter the list of deployed service type information. If + * specified, the response will only contain the information about service + * types that are defined in this service manifest. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getDeployedServiceTypeInfoByNameWithHttpOperationResponse(nodeName, applicationId, serviceTypeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, 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 information about a specified service type of the + * application deployed on a node in a Service Fabric cluster. + * + * Gets the list containing the information about a specific service type from + * the applications deployed on a node in a Service Fabric cluster. The + * response includes the name of the service type, its registration status, the + * code package that registered it and activation ID of the service package. + * Each entry represents one activation of a service type, differentiated by + * the activation ID. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceTypeName Specifies the name of a Service Fabric + * service type. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceManifestName] The name of the service + * manifest to filter the list of deployed service type information. If + * specified, the response will only contain the information about service + * types that are defined in this service manifest. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {Array} - 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. + * + * {array} [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. + */ + getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback); + } + } + + /** + * @summary Creates a Service Fabric application. + * + * Creates a Service Fabric application using the specified description. + * + * @param {object} applicationDescription Description for creating an + * application. + * + * @param {string} applicationDescription.name The name of the application, + * including the 'fabric:' URI scheme. + * + * @param {string} applicationDescription.typeName The application type name as + * defined in the application manifest. + * + * @param {string} applicationDescription.typeVersion The version of the + * application type as defined in the application manifest. + * + * @param {array} [applicationDescription.parameterList] List of application + * parameters with overridden values from their default values specified in the + * application manifest. + * + * @param {object} [applicationDescription.applicationCapacity] Describes + * capacity information for services of this application. This description can + * be used for describing the following. + * - Reserving the capacity for the services on the nodes + * - Limiting the total number of nodes that services of this application can + * run on + * - Limiting the custom capacity metrics to limit the total consumption of + * this metric by the services of this application + * + * @param {number} [applicationDescription.applicationCapacity.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} [applicationDescription.applicationCapacity.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 {array} + * [applicationDescription.applicationCapacity.applicationMetrics] List of + * application capacity metric description. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + createApplicationWithHttpOperationResponse(applicationDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._createApplication(applicationDescription, 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 a Service Fabric application. + * + * Creates a Service Fabric application using the specified description. + * + * @param {object} applicationDescription Description for creating an + * application. + * + * @param {string} applicationDescription.name The name of the application, + * including the 'fabric:' URI scheme. + * + * @param {string} applicationDescription.typeName The application type name as + * defined in the application manifest. + * + * @param {string} applicationDescription.typeVersion The version of the + * application type as defined in the application manifest. + * + * @param {array} [applicationDescription.parameterList] List of application + * parameters with overridden values from their default values specified in the + * application manifest. + * + * @param {object} [applicationDescription.applicationCapacity] Describes + * capacity information for services of this application. This description can + * be used for describing the following. + * - Reserving the capacity for the services on the nodes + * - Limiting the total number of nodes that services of this application can + * run on + * - Limiting the custom capacity metrics to limit the total consumption of + * this metric by the services of this application + * + * @param {number} [applicationDescription.applicationCapacity.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} [applicationDescription.applicationCapacity.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 {array} + * [applicationDescription.applicationCapacity.applicationMetrics] List of + * application capacity metric description. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + createApplication(applicationDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createApplication(applicationDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createApplication(applicationDescription, options, optionalCallback); + } + } + + /** + * @summary Deletes an existing Service Fabric application. + * + * An application must be created before it can be deleted. Deleting an + * application will delete all services that are part of that application. By + * default, Service Fabric will try to close service replicas in a graceful + * manner and then delete the service. However, if a service is having issues + * closing the replica gracefully, the delete operation may take a long time or + * get stuck. Use the optional ForceRemove flag to skip the graceful close + * sequence and forcefully delete the application and all of its services. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceRemove] Remove a Service Fabric application + * or service forcefully without going through the graceful shutdown sequence. + * This parameter can be used to forcefully delete an application or service + * for which delete is timing out due to issues in the service code that + * prevents graceful close of replicas. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + deleteApplicationWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteApplication(applicationId, 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 an existing Service Fabric application. + * + * An application must be created before it can be deleted. Deleting an + * application will delete all services that are part of that application. By + * default, Service Fabric will try to close service replicas in a graceful + * manner and then delete the service. However, if a service is having issues + * closing the replica gracefully, the delete operation may take a long time or + * get stuck. Use the optional ForceRemove flag to skip the graceful close + * sequence and forcefully delete the application and all of its services. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceRemove] Remove a Service Fabric application + * or service forcefully without going through the graceful shutdown sequence. + * This parameter can be used to forcefully delete an application or service + * for which delete is timing out due to issues in the service code that + * prevents graceful close of replicas. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + deleteApplication(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteApplication(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteApplication(applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets load information about a Service Fabric application. + * + * Returns the load information about the application that was created or in + * the process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * minimum nodes, maximum nodes, the number of nodes the application is + * occupying currently, and application load metric information about the + * application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationLoadInfoWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationLoadInfo(applicationId, 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 load information about a Service Fabric application. + * + * Returns the load information about the application that was created or in + * the process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * minimum nodes, maximum nodes, the number of nodes the application is + * occupying currently, and application load metric information about the + * application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ApplicationLoadInfo} - 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 ApplicationLoadInfo} 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. + */ + getApplicationLoadInfo(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationLoadInfo(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationLoadInfo(applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the list of applications created in the Service Fabric cluster + * that match the specified filters. + * + * Gets the information about the applications that were created or in the + * process of being created in the Service Fabric cluster and match the + * specified filters. The response includes the name, type, status, parameters, + * and other details about the application. If the applications do not fit in a + * page, one page of results is returned as well as a continuation token, which + * can be used to get the next page. Filters ApplicationTypeName and + * ApplicationDefinitionKindFilter cannot be specified at the same time. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.applicationDefinitionKindFilter] Used to filter on + * ApplicationDefinitionKind, which is the mechanism used to define a Service + * Fabric application. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. + * - All - Filter that matches input with any ApplicationDefinitionKind value. + * The value is 65535. + * - ServiceFabricApplicationDescription - Filter that matches input with + * ApplicationDefinitionKind value ServiceFabricApplicationDescription. The + * value is 1. + * - Compose - Filter that matches input with ApplicationDefinitionKind value + * Compose. The value is 2. + * + * @param {string} [options.applicationTypeName] The application type name used + * to filter the applications to query for. This value should not contain the + * application type version. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationInfoListWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationInfoList(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 applications created in the Service Fabric cluster + * that match the specified filters. + * + * Gets the information about the applications that were created or in the + * process of being created in the Service Fabric cluster and match the + * specified filters. The response includes the name, type, status, parameters, + * and other details about the application. If the applications do not fit in a + * page, one page of results is returned as well as a continuation token, which + * can be used to get the next page. Filters ApplicationTypeName and + * ApplicationDefinitionKindFilter cannot be specified at the same time. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.applicationDefinitionKindFilter] Used to filter on + * ApplicationDefinitionKind, which is the mechanism used to define a Service + * Fabric application. + * - Default - Default value, which performs the same function as selecting + * "All". The value is 0. + * - All - Filter that matches input with any ApplicationDefinitionKind value. + * The value is 65535. + * - ServiceFabricApplicationDescription - Filter that matches input with + * ApplicationDefinitionKind value ServiceFabricApplicationDescription. The + * value is 1. + * - Compose - Filter that matches input with ApplicationDefinitionKind value + * Compose. The value is 2. + * + * @param {string} [options.applicationTypeName] The application type name used + * to filter the applications to query for. This value should not contain the + * application type version. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedApplicationInfoList} - 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 PagedApplicationInfoList} 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. + */ + getApplicationInfoList(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationInfoList(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationInfoList(options, optionalCallback); + } + } + + /** + * @summary Gets information about a Service Fabric application. + * + * Returns the information about the application that was created or in the + * process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * type, status, parameters, and other details about the application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationInfoWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationInfo(applicationId, 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 information about a Service Fabric application. + * + * Returns the information about the application that was created or in the + * process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * type, status, parameters, and other details about the application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ApplicationInfo} - 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 ApplicationInfo} 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. + */ + getApplicationInfo(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationInfo(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationInfo(applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the health of the service fabric application. + * + * Returns the heath state of the service fabric application. The response + * reports either Ok, Error or Warning health state. If the entity is not found + * in the health store, it will return Error. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedApplicationsHealthStateFilter] Allows + * filtering of the deployed applications health state objects returned in the + * result of application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. Only deployed applications that match the filter + * will be returned. + * All deployed applications are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of deployed + * applications with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.servicesHealthStateFilter] Allows filtering of the + * services health state objects returned in the result of services health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only services that match the filter are returned. All services are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of services with HealthState value of OK (2) and Warning + * (4) will be returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationHealthWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationHealth(applicationId, 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 health of the service fabric application. + * + * Returns the heath state of the service fabric application. The response + * reports either Ok, Error or Warning health state. If the entity is not found + * in the health store, it will return Error. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedApplicationsHealthStateFilter] Allows + * filtering of the deployed applications health state objects returned in the + * result of application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. Only deployed applications that match the filter + * will be returned. + * All deployed applications are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of deployed + * applications with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.servicesHealthStateFilter] Allows filtering of the + * services health state objects returned in the result of services health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only services that match the filter are returned. All services are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of services with HealthState value of OK (2) and Warning + * (4) will be returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ApplicationHealth} - 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 ApplicationHealth} 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. + */ + getApplicationHealth(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationHealth(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationHealth(applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the health of a Service Fabric application using the specified + * policy. + * + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter + * to filter the collection of health events reported on the node based on the + * health state. Use ClusterHealthPolicies to override the health policies used + * to evaluate the health. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedApplicationsHealthStateFilter] Allows + * filtering of the deployed applications health state objects returned in the + * result of application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. Only deployed applications that match the filter + * will be returned. + * All deployed applications are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of deployed + * applications with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.servicesHealthStateFilter] Allows filtering of the + * services health state objects returned in the result of services health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only services that match the filter are returned. All services are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of services with HealthState value of OK (2) and Warning + * (4) will be returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. + * + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.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. + * + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationHealthUsingPolicyWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationHealthUsingPolicy(applicationId, 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 health of a Service Fabric application using the specified + * policy. + * + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter + * to filter the collection of health events reported on the node based on the + * health state. Use ClusterHealthPolicies to override the health policies used + * to evaluate the health. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedApplicationsHealthStateFilter] Allows + * filtering of the deployed applications health state objects returned in the + * result of application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. Only deployed applications that match the filter + * will be returned. + * All deployed applications are used to evaluate the aggregated health state. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values, obtained using bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of deployed + * applications with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.servicesHealthStateFilter] Allows filtering of the + * services health state objects returned in the result of services health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only services that match the filter are returned. All services are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of services with HealthState value of OK (2) and Warning + * (4) will be returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. + * + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.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. + * + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ApplicationHealth} - 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 ApplicationHealth} 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. + */ + getApplicationHealthUsingPolicy(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationHealthUsingPolicy(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationHealthUsingPolicy(applicationId, options, optionalCallback); + } + } + + /** + * @summary Sends a health report on the Service Fabric application. + * + * Reports health state of the specified Service Fabric application. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Application, which forwards + * to the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, get application + * health and check that the report appears in the HealthEvents section. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + reportApplicationHealthWithHttpOperationResponse(applicationId, healthInformation, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sends a health report on the Service Fabric application. + * + * Reports health state of the specified Service Fabric application. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Application, which forwards + * to the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, get application + * health and check that the report appears in the HealthEvents section. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + reportApplicationHealth(applicationId, healthInformation, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reportApplicationHealth(applicationId, healthInformation, options, optionalCallback); + } + } + + /** + * @summary Starts upgrading an application in the Service Fabric cluster. + * + * Validates the supplied application upgrade parameters and starts upgrading + * the application if the parameters are valid. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} applicationUpgradeDescription Parameters for an application + * upgrade. + * + * @param {string} applicationUpgradeDescription.name The name of the target + * application, including the 'fabric:' URI scheme. + * + * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion + * The target application type version (found in the application manifest) for + * the application upgrade. + * + * @param {array} applicationUpgradeDescription.parameters List of application + * parameters with overridden values from their default values specified in the + * application manifest. + * + * @param {string} applicationUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {number} + * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [applicationUpgradeDescription.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} [applicationUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. + * + * @param {string} + * [applicationUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [applicationUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [applicationUpgradeDescription.applicationHealthPolicy] + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. + * + * @param {boolean} + * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [applicationUpgradeDescription.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} + * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [applicationUpgradeDescription.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} + * [applicationUpgradeDescription.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. + * + * @param {number} + * [applicationUpgradeDescription.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} + * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + startApplicationUpgradeWithHttpOperationResponse(applicationId, applicationUpgradeDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Starts upgrading an application in the Service Fabric cluster. + * + * Validates the supplied application upgrade parameters and starts upgrading + * the application if the parameters are valid. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} applicationUpgradeDescription Parameters for an application + * upgrade. + * + * @param {string} applicationUpgradeDescription.name The name of the target + * application, including the 'fabric:' URI scheme. + * + * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion + * The target application type version (found in the application manifest) for + * the application upgrade. + * + * @param {array} applicationUpgradeDescription.parameters List of application + * parameters with overridden values from their default values specified in the + * application manifest. + * + * @param {string} applicationUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] The mode + * used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {number} + * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] 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} [applicationUpgradeDescription.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} [applicationUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. + * + * @param {string} + * [applicationUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [applicationUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} + * [applicationUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} [applicationUpgradeDescription.applicationHealthPolicy] + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. + * + * @param {boolean} + * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [applicationUpgradeDescription.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} + * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [applicationUpgradeDescription.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} + * [applicationUpgradeDescription.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. + * + * @param {number} + * [applicationUpgradeDescription.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} + * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, optionalCallback); + } + } + + /** + * @summary Gets details for the latest upgrade performed on this application. + * + * Returns information about the state of the latest application upgrade along + * with details to aid debugging application health issues. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationUpgradeWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationUpgrade(applicationId, 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 details for the latest upgrade performed on this application. + * + * Returns information about the state of the latest application upgrade along + * with details to aid debugging application health issues. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ApplicationUpgradeProgressInfo} - 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 ApplicationUpgradeProgressInfo} 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. + */ + getApplicationUpgrade(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationUpgrade(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationUpgrade(applicationId, options, optionalCallback); + } + } + + /** + * @summary Updates an ongoing application upgrade in the Service Fabric + * cluster. + * + * Updates the parameters of an ongoing application upgrade from the ones + * specified at the time of starting the application upgrade. This may be + * required to mitigate stuck application upgrades due to incorrect parameters + * or issues in the application to make progress. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} applicationUpgradeUpdateDescription Parameters for updating + * an existing application upgrade. + * + * @param {string} applicationUpgradeUpdateDescription.name The name of the + * application, including the 'fabric:' URI scheme. + * + * @param {string} applicationUpgradeUpdateDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {object} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * @param {boolean} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [applicationUpgradeUpdateDescription.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} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [applicationUpgradeUpdateDescription.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} + * [applicationUpgradeUpdateDescription.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. + * + * @param {number} + * [applicationUpgradeUpdateDescription.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} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {object} [applicationUpgradeUpdateDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. + * + * @param {string} + * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {boolean} + * [applicationUpgradeUpdateDescription.updateDescription.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 {number} + * [applicationUpgradeUpdateDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} + * [applicationUpgradeUpdateDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [applicationUpgradeUpdateDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + updateApplicationUpgradeWithHttpOperationResponse(applicationId, applicationUpgradeUpdateDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, 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 an ongoing application upgrade in the Service Fabric + * cluster. + * + * Updates the parameters of an ongoing application upgrade from the ones + * specified at the time of starting the application upgrade. This may be + * required to mitigate stuck application upgrades due to incorrect parameters + * or issues in the application to make progress. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} applicationUpgradeUpdateDescription Parameters for updating + * an existing application upgrade. + * + * @param {string} applicationUpgradeUpdateDescription.name The name of the + * application, including the 'fabric:' URI scheme. + * + * @param {string} applicationUpgradeUpdateDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {object} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * @param {boolean} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [applicationUpgradeUpdateDescription.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} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [applicationUpgradeUpdateDescription.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} + * [applicationUpgradeUpdateDescription.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. + * + * @param {number} + * [applicationUpgradeUpdateDescription.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} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {object} [applicationUpgradeUpdateDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * cluster. + * + * @param {string} + * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {boolean} + * [applicationUpgradeUpdateDescription.updateDescription.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 {number} + * [applicationUpgradeUpdateDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] + * 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 {string} + * [applicationUpgradeUpdateDescription.updateDescription.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [applicationUpgradeUpdateDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.upgradeTimeoutInMilliseconds] + * 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} + * [applicationUpgradeUpdateDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * 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} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, optionalCallback); + } + } + + /** + * @summary Resumes upgrading an application in the Service Fabric cluster. + * + * Resumes an unmonitored manual Service Fabric application upgrade. Service + * Fabric upgrades one upgrade domain at a time. For unmonitored manual + * upgrades, after Service Fabric finishes an upgrade domain, it waits for you + * to call this API before proceeding to the next upgrade domain. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} resumeApplicationUpgradeDescription Describes the parameters + * for resuming an application upgrade. + * + * @param {string} resumeApplicationUpgradeDescription.upgradeDomainName The + * name of the upgrade domain in which to resume the upgrade. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + resumeApplicationUpgradeWithHttpOperationResponse(applicationId, resumeApplicationUpgradeDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Resumes upgrading an application in the Service Fabric cluster. + * + * Resumes an unmonitored manual Service Fabric application upgrade. Service + * Fabric upgrades one upgrade domain at a time. For unmonitored manual + * upgrades, after Service Fabric finishes an upgrade domain, it waits for you + * to call this API before proceeding to the next upgrade domain. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} resumeApplicationUpgradeDescription Describes the parameters + * for resuming an application upgrade. + * + * @param {string} resumeApplicationUpgradeDescription.upgradeDomainName The + * name of the upgrade domain in which to resume the upgrade. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, optionalCallback); + } + } + + /** + * @summary Starts rolling back the currently on-going upgrade of an + * application in the Service Fabric cluster. + * + * Starts rolling back the current application upgrade to the previous version. + * This API can only be used to roll back the current in-progress upgrade that + * is rolling forward to new version. If the application is not currently being + * upgraded use StartApplicationUpgrade API to upgrade it to desired version, + * including rolling back to a previous version. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + rollbackApplicationUpgradeWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._rollbackApplicationUpgrade(applicationId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Starts rolling back the currently on-going upgrade of an + * application in the Service Fabric cluster. + * + * Starts rolling back the current application upgrade to the previous version. + * This API can only be used to roll back the current in-progress upgrade that + * is rolling forward to new version. If the application is not currently being + * upgraded use StartApplicationUpgrade API to upgrade it to desired version, + * including rolling back to a previous version. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + rollbackApplicationUpgrade(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._rollbackApplicationUpgrade(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._rollbackApplicationUpgrade(applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the list of applications deployed on a Service Fabric node. + * + * Gets the list of applications deployed on a Service Fabric node. The results + * do not include information about deployed system applications unless + * explicitly queried for by ID. Results encompass deployed applications in + * active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @param {object} [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. + */ + getDeployedApplicationInfoListWithHttpOperationResponse(nodeName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedApplicationInfoList(nodeName, 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 applications deployed on a Service Fabric node. + * + * Gets the list of applications deployed on a Service Fabric node. The results + * do not include information about deployed system applications unless + * explicitly queried for by ID. Results encompass deployed applications in + * active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. + * + * @param {string} nodeName The name of the node. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * + * @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 {PagedDeployedApplicationInfoList} - 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 PagedDeployedApplicationInfoList} 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. + */ + getDeployedApplicationInfoList(nodeName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeployedApplicationInfoList(nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployedApplicationInfoList(nodeName, options, optionalCallback); + } + } + + /** + * @summary Gets the information about an application deployed on a Service + * Fabric node. + * + * This query returns system application information if the application ID + * provided is for system application. Results encompass deployed applications + * in active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. + * + * @param {object} [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. + */ + getDeployedApplicationInfoWithHttpOperationResponse(nodeName, applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedApplicationInfo(nodeName, applicationId, 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 information about an application deployed on a Service + * Fabric node. + * + * This query returns system application information if the application ID + * provided is for system application. Results encompass deployed applications + * in active, activating, and downloading states. This query requires that the + * node name corresponds to a node on the cluster. The query fails if the + * provided node name does not point to any active Service Fabric nodes on the + * cluster. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.includeHealthState] Include the health state of an + * entity. + * If this parameter is false or not specified, then the health state returned + * is "Unknown". + * When set to true, the query goes in parallel to the node and the health + * system service before the results are merged. + * As a result, the query is more expensive and may take a longer time. + * + * @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 {DeployedApplicationInfo} - 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 DeployedApplicationInfo} 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. + */ + getDeployedApplicationInfo(nodeName, applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeployedApplicationInfo(nodeName, applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployedApplicationInfo(nodeName, applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the information about health of an application deployed on a + * Service Fabric node. + * + * Gets the information about health of an application deployed on a Service + * Fabric node. Use EventsHealthStateFilter to optionally filter for the + * collection of HealthEvent objects reported on the deployed application based + * on health state. Use DeployedServicePackagesHealthStateFilter to optionally + * filter for DeployedServicePackageHealth children based on health state. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows + * filtering of the deployed service package health state objects returned in + * the result of deployed application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only deployed service packages that match the filter are returned. All + * deployed service packages are used to evaluate the aggregated health state + * of the deployed application. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of service + * packages with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getDeployedApplicationHealthWithHttpOperationResponse(nodeName, applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedApplicationHealth(nodeName, applicationId, 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 information about health of an application deployed on a + * Service Fabric node. + * + * Gets the information about health of an application deployed on a Service + * Fabric node. Use EventsHealthStateFilter to optionally filter for the + * collection of HealthEvent objects reported on the deployed application based + * on health state. Use DeployedServicePackagesHealthStateFilter to optionally + * filter for DeployedServicePackageHealth children based on health state. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows + * filtering of the deployed service package health state objects returned in + * the result of deployed application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only deployed service packages that match the filter are returned. All + * deployed service packages are used to evaluate the aggregated health state + * of the deployed application. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of service + * packages with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {DeployedApplicationHealth} - 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 DeployedApplicationHealth} 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. + */ + getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeployedApplicationHealth(nodeName, applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the information about health of an application deployed on a + * Service Fabric node. using the specified policy. + * + * Gets the information about health of an application deployed on a Service + * Fabric node using the specified policy. Use EventsHealthStateFilter to + * optionally filter for the collection of HealthEvent objects reported on the + * deployed application based on health state. Use + * DeployedServicePackagesHealthStateFilter to optionally filter for + * DeployedServicePackageHealth children based on health state. Use + * ApplicationHealthPolicy to optionally override the health policies used to + * evaluate the health. This API only uses 'ConsiderWarningAsError' field of + * the ApplicationHealthPolicy. The rest of the fields are ignored while + * evaluating the health of the deployed application. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows + * filtering of the deployed service package health state objects returned in + * the result of deployed application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only deployed service packages that match the filter are returned. All + * deployed service packages are used to evaluate the aggregated health state + * of the deployed application. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of service + * packages with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. + * + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.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. + * + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getDeployedApplicationHealthUsingPolicyWithHttpOperationResponse(nodeName, applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, 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 information about health of an application deployed on a + * Service Fabric node. using the specified policy. + * + * Gets the information about health of an application deployed on a Service + * Fabric node using the specified policy. Use EventsHealthStateFilter to + * optionally filter for the collection of HealthEvent objects reported on the + * deployed application based on health state. Use + * DeployedServicePackagesHealthStateFilter to optionally filter for + * DeployedServicePackageHealth children based on health state. Use + * ApplicationHealthPolicy to optionally override the health policies used to + * evaluate the health. This API only uses 'ConsiderWarningAsError' field of + * the ApplicationHealthPolicy. The rest of the fields are ignored while + * evaluating the health of the deployed application. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows + * filtering of the deployed service package health state objects returned in + * the result of deployed application health query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only deployed service packages that match the filter are returned. All + * deployed service packages are used to evaluate the aggregated health state + * of the deployed application. + * If not specified, all entries are returned. + * The state values are flag-based enumeration, so the value can be a + * combination of these values, obtained using the bitwise 'OR' operator. + * For example, if the provided value is 6 then health state of service + * packages with HealthState value of OK (2) and Warning (4) are returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. + * + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.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. + * + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {DeployedApplicationHealth} - 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 DeployedApplicationHealth} 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. + */ + getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback); + } + } + + /** + * @summary Sends a health report on the Service Fabric application deployed on + * a Service Fabric node. + * + * Reports health state of the application deployed on a Service Fabric node. + * The report must contain the information about the source of the health + * report and property on which it is reported. + * The report is sent to a Service Fabric gateway Service, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, get deployed + * application health and check that the report appears in the HealthEvents + * section. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + reportDeployedApplicationHealthWithHttpOperationResponse(nodeName, applicationId, healthInformation, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sends a health report on the Service Fabric application deployed on + * a Service Fabric node. + * + * Reports health state of the application deployed on a Service Fabric node. + * The report must contain the information about the source of the health + * report and property on which it is reported. + * The report is sent to a Service Fabric gateway Service, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, get deployed + * application health and check that the report appears in the HealthEvents + * section. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, optionalCallback); + } + } + + /** + * @summary Gets the manifest describing an application type. + * + * The response contains the application manifest XML as a string. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationManifestWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationManifest(applicationTypeName, applicationTypeVersion, 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 manifest describing an application type. + * + * The response contains the application manifest XML as a string. + * + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ApplicationTypeManifest} - 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 ApplicationTypeManifest} 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. + */ + getApplicationManifest(applicationTypeName, applicationTypeVersion, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, optionalCallback); + } + } + + /** + * @summary Gets the information about all services belonging to the + * application specified by the application ID. + * + * Returns the information about all services belonging to the application + * specified by the application ID. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceTypeName] The service type name used to + * filter the services to query for. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getServiceInfoListWithHttpOperationResponse(applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getServiceInfoList(applicationId, 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 information about all services belonging to the + * application specified by the application ID. + * + * Returns the information about all services belonging to the application + * specified by the application ID. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.serviceTypeName] The service type name used to + * filter the services to query for. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {PagedServiceInfoList} - 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 PagedServiceInfoList} 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. + */ + getServiceInfoList(applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getServiceInfoList(applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getServiceInfoList(applicationId, options, optionalCallback); + } + } + + /** + * @summary Gets the information about the specific service belonging to the + * Service Fabric application. + * + * Returns the information about the specified service belonging to the + * specified Service Fabric application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getServiceInfoWithHttpOperationResponse(applicationId, serviceId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getServiceInfo(applicationId, serviceId, 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 information about the specific service belonging to the + * Service Fabric application. + * + * Returns the information about the specified service belonging to the + * specified Service Fabric application. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ServiceInfo} - 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 ServiceInfo} 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. + */ + getServiceInfo(applicationId, serviceId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getServiceInfo(applicationId, serviceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getServiceInfo(applicationId, serviceId, options, optionalCallback); + } + } + + /** + * @summary Gets the name of the Service Fabric application for a service. + * + * Gets the name of the application for the specified service. A 404 + * FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the + * provided service ID does not exist. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getApplicationNameInfoWithHttpOperationResponse(serviceId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getApplicationNameInfo(serviceId, 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 name of the Service Fabric application for a service. + * + * Gets the name of the application for the specified service. A 404 + * FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the + * provided service ID does not exist. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ApplicationNameInfo} - 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 ApplicationNameInfo} 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. + */ + getApplicationNameInfo(serviceId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getApplicationNameInfo(serviceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getApplicationNameInfo(serviceId, options, optionalCallback); + } } /** - * @summary Get the Service Fabric cluster manifest. + * @summary Creates the specified Service Fabric service. * - * Get the Service Fabric cluster manifest. The cluster manifest contains - * properties of the cluster that include different node types on the cluster, - * security configurations, fault and upgrade domain topologies etc. + * This api allows creating a new Service Fabric stateless or stateful service + * under a specified Service Fabric application. The description for creating + * the service includes partitioning information and optional properties for + * placement and load balancing. Some of the properties can later be modified + * using `UpdateService` API. * - * These properties are specified as part of the ClusterConfig.JSON file while - * deploying a stand alone cluster. However, most of the information in the - * cluster manifest - * is generated internally by service fabric during cluster deployment in other - * deployment scenarios (for e.g when using azuer portal). + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * The contents of the cluster manifest are for informational purposes only and - * users are not expected to take a dependency on the format of the file - * contents or its interpretation. + * @param {object} serviceDescription The information necessary to create a + * service. + * + * @param {string} [serviceDescription.applicationName] The name of the + * application, including the 'fabric:' URI scheme. + * + * @param {string} serviceDescription.serviceName The full name of the service + * with 'fabric:' URI scheme. + * + * @param {string} serviceDescription.serviceTypeName Name of the service type + * as specified in the service manifest. + * + * @param {array} [serviceDescription.initializationData] The initialization + * data as an array of bytes. Initialization data is passed to service + * instances or replicas when they are created. + * + * @param {object} serviceDescription.partitionDescription The partition + * description as an object. + * + * @param {string} serviceDescription.partitionDescription.partitionScheme + * Polymorphic Discriminator + * + * @param {string} [serviceDescription.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} [serviceDescription.correlationScheme] The correlation + * scheme. + * + * @param {array} [serviceDescription.serviceLoadMetrics] The service load + * metrics. + * + * @param {array} [serviceDescription.servicePlacementPolicies] The service + * placement policies. + * + * @param {string} [serviceDescription.defaultMoveCost] The move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {boolean} [serviceDescription.isDefaultMoveCostSpecified] Indicates + * if the DefaultMoveCost property is specified. * + * @param {string} [serviceDescription.servicePackageActivationMode] The + * activation mode of service package to be used for a service. Possible values + * include: 'SharedProcess', 'ExclusiveProcess' + * + * @param {string} [serviceDescription.serviceDnsName] The DNS name of the + * service. It requires the DNS system service to be enabled in Service Fabric + * cluster. + * + * @param {array} [serviceDescription.scalingPolicies] Scaling policies for + * this service. + * + * @param {string} serviceDescription.serviceKind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterManifestWithHttpOperationResponse(options) { + createServiceWithHttpOperationResponse(applicationId, serviceDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterManifest(options, (err, result, request, response) => { + self._createService(applicationId, serviceDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -25202,29 +49476,84 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the Service Fabric cluster manifest. + * @summary Creates the specified Service Fabric service. * - * Get the Service Fabric cluster manifest. The cluster manifest contains - * properties of the cluster that include different node types on the cluster, - * security configurations, fault and upgrade domain topologies etc. + * This api allows creating a new Service Fabric stateless or stateful service + * under a specified Service Fabric application. The description for creating + * the service includes partitioning information and optional properties for + * placement and load balancing. Some of the properties can later be modified + * using `UpdateService` API. * - * These properties are specified as part of the ClusterConfig.JSON file while - * deploying a stand alone cluster. However, most of the information in the - * cluster manifest - * is generated internally by service fabric during cluster deployment in other - * deployment scenarios (for e.g when using azuer portal). + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * The contents of the cluster manifest are for informational purposes only and - * users are not expected to take a dependency on the format of the file - * contents or its interpretation. + * @param {object} serviceDescription The information necessary to create a + * service. + * + * @param {string} [serviceDescription.applicationName] The name of the + * application, including the 'fabric:' URI scheme. + * + * @param {string} serviceDescription.serviceName The full name of the service + * with 'fabric:' URI scheme. + * + * @param {string} serviceDescription.serviceTypeName Name of the service type + * as specified in the service manifest. + * + * @param {array} [serviceDescription.initializationData] The initialization + * data as an array of bytes. Initialization data is passed to service + * instances or replicas when they are created. + * + * @param {object} serviceDescription.partitionDescription The partition + * description as an object. + * + * @param {string} serviceDescription.partitionDescription.partitionScheme + * Polymorphic Discriminator + * + * @param {string} [serviceDescription.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} [serviceDescription.correlationScheme] The correlation + * scheme. + * + * @param {array} [serviceDescription.serviceLoadMetrics] The service load + * metrics. + * + * @param {array} [serviceDescription.servicePlacementPolicies] The service + * placement policies. + * + * @param {string} [serviceDescription.defaultMoveCost] The move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {boolean} [serviceDescription.isDefaultMoveCostSpecified] Indicates + * if the DefaultMoveCost property is specified. + * + * @param {string} [serviceDescription.servicePackageActivationMode] The + * activation mode of service package to be used for a service. Possible values + * include: 'SharedProcess', 'ExclusiveProcess' + * + * @param {string} [serviceDescription.serviceDnsName] The DNS name of the + * service. It requires the DNS system service to be enabled in Service Fabric + * cluster. * + * @param {array} [serviceDescription.scalingPolicies] Scaling policies for + * this service. + * + * @param {string} serviceDescription.serviceKind Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -25236,7 +49565,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterManifest} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -25244,14 +49573,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ClusterManifest} 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. */ - getClusterManifest(options, optionalCallback) { + createService(applicationId, serviceDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -25260,143 +49588,225 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterManifest(options, (err, result, request, response) => { + self._createService(applicationId, serviceDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterManifest(options, optionalCallback); + return self._createService(applicationId, serviceDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric cluster. + * @summary Creates a Service Fabric service from the service template. * - * Gets the health of a Service Fabric cluster. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the cluster based on the health state. - * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to - * filter the collection of nodes and applications returned based on their - * aggregated health state. + * Creates a Service Fabric service from the service template defined in the + * application manifest. A service template contains the properties that will + * be same for the service instance of the same type. The API allows overriding + * the properties that are usually different for different services of the same + * service type. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} serviceFromTemplateDescription Describes the service that + * needs to be created from the template defined in the application manifest. + * + * @param {string} serviceFromTemplateDescription.applicationName The name of + * the application, including the 'fabric:' URI scheme. + * + * @param {string} serviceFromTemplateDescription.serviceName The full name of + * the service with 'fabric:' URI scheme. + * + * @param {string} serviceFromTemplateDescription.serviceTypeName Name of the + * service type as specified in the service manifest. + * + * @param {array} [serviceFromTemplateDescription.initializationData] The + * initialization data for the newly created service instance. + * + * @param {string} + * [serviceFromTemplateDescription.servicePackageActivationMode] The activation + * mode of service package to be used for a service. Possible values include: + * 'SharedProcess', 'ExclusiveProcess' * + * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name + * of the service. It requires the DNS system service to be enabled in Service + * Fabric cluster. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.nodesHealthStateFilter] Allows filtering of the - * node health state objects returned in the result of cluster health query - * based on their health state. The possible values for this parameter include - * integer value of one of the - * following health states. Only nodes that match the filter are returned. All - * nodes are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of nodes with - * HealthState value of OK (2) and Warning (4) are returned. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * + * @returns {Promise} A promise is returned * - * @param {number} [options.applicationsHealthStateFilter] Allows filtering of - * the application health state objects returned in the result of cluster - * health - * query based on their health state. - * The possible values for this parameter include integer value obtained from - * members or bitwise operations - * on members of HealthStateFilter enumeration. Only applications that match - * the filter are returned. - * All applications are used to evaluate the aggregated health state. If not - * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of applications - * with HealthState value of OK (2) and Warning (4) are returned. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @reject {Error} - The error object. + */ + createServiceFromTemplateWithHttpOperationResponse(applicationId, serviceFromTemplateDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, 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 a Service Fabric service from the service template. * + * Creates a Service Fabric service from the service template defined in the + * application manifest. A service template contains the properties that will + * be same for the service instance of the same type. The API allows overriding + * the properties that are usually different for different services of the same + * service type. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {object} serviceFromTemplateDescription Describes the service that + * needs to be created from the template defined in the application manifest. * + * @param {string} serviceFromTemplateDescription.applicationName The name of + * the application, including the 'fabric:' URI scheme. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {string} serviceFromTemplateDescription.serviceName The full name of + * the service with 'fabric:' URI scheme. * + * @param {string} serviceFromTemplateDescription.serviceTypeName Name of the + * service type as specified in the service manifest. * - * @param {boolean} [options.includeSystemApplicationHealthStatistics] - * Indicates whether the health statistics should include the fabric:/System - * application health statistics. False by default. - * If IncludeSystemApplicationHealthStatistics is set to true, the health - * statistics include the entities that belong to the fabric:/System - * application. - * Otherwise, the query result includes health statistics only for user - * applications. - * The health statistics must be included in the query result for this - * parameter to be applied. + * @param {array} [serviceFromTemplateDescription.initializationData] The + * initialization data for the newly created service instance. + * + * @param {string} + * [serviceFromTemplateDescription.servicePackageActivationMode] The activation + * mode of service package to be used for a service. Possible values include: + * 'SharedProcess', 'ExclusiveProcess' + * + * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name + * of the service. It requires the DNS system service to be enabled in Service + * Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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. + */ + createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, optionalCallback); + } + } + + /** + * @summary Deletes an existing Service Fabric service. + * + * A service must be created before it can be deleted. By default, Service + * Fabric will try to close service replicas in a graceful manner and then + * delete the service. However, if the service is having issues closing the + * replica gracefully, the delete operation may take a long time or get stuck. + * Use the optional ForceRemove flag to skip the graceful close sequence and + * forcefully delete the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.forceRemove] Remove a Service Fabric application + * or service forcefully without going through the graceful shutdown sequence. + * This parameter can be used to forcefully delete an application or service + * for which delete is timing out due to issues in the service code that + * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterHealthWithHttpOperationResponse(options) { + deleteServiceWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterHealth(options, (err, result, request, response) => { + self._deleteService(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -25407,116 +49817,284 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric cluster. + * @summary Deletes an existing Service Fabric service. * - * Gets the health of a Service Fabric cluster. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the cluster based on the health state. - * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to - * filter the collection of nodes and applications returned based on their - * aggregated health state. + * A service must be created before it can be deleted. By default, Service + * Fabric will try to close service replicas in a graceful manner and then + * delete the service. However, if the service is having issues closing the + * replica gracefully, the delete operation may take a long time or get stuck. + * Use the optional ForceRemove flag to skip the graceful close sequence and + * forcefully delete the service. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.nodesHealthStateFilter] Allows filtering of the - * node health state objects returned in the result of cluster health query - * based on their health state. The possible values for this parameter include - * integer value of one of the - * following health states. Only nodes that match the filter are returned. All - * nodes are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of nodes with - * HealthState value of OK (2) and Warning (4) are returned. + * @param {boolean} [options.forceRemove] Remove a Service Fabric application + * or service forcefully without going through the graceful shutdown sequence. + * This parameter can be used to forcefully delete an application or service + * for which delete is timing out due to issues in the service code that + * prevents graceful close of replicas. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [options.applicationsHealthStateFilter] Allows filtering of - * the application health state objects returned in the result of cluster - * health - * query based on their health state. - * The possible values for this parameter include integer value obtained from - * members or bitwise operations - * on members of HealthStateFilter enumeration. Only applications that match - * the filter are returned. - * All applications are used to evaluate the aggregated health state. If not - * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of applications - * with HealthState value of OK (2) and Warning (4) are returned. + * @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. + */ + deleteService(serviceId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteService(serviceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteService(serviceId, options, optionalCallback); + } + } + + /** + * @summary Updates a Service Fabric service using the specified update + * description. + * + * This API allows updating properties of a running Service Fabric service. The + * set of properties that can be updated are a subset of the properties that + * were specified at the time of creating the service. The current set of + * properties can be obtained using `GetServiceDescription` API. Note that + * updating the properties of a running service is different than upgrading + * your application using `StartApplicationUpgrade` API. The upgrade is a long + * running background operation that involves moving the application from one + * version to another, one upgrade domain at a time, whereas update applies the + * new properties immediately to the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} serviceUpdateDescription The information necessary to update + * a service. + * + * @param {string} [serviceUpdateDescription.flags] Flags indicating whether + * other properties are set. Each of the associated properties corresponds to a + * flag, specified below, which, if set, indicate that the property is + * specified. + * This property can be a combination of those flags obtained using bitwise + * 'OR' operator. + * For example, if the provided value is 6 then the flags for + * ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. + * + * - None - Does not indicate any other properties are set. The value is zero. + * - TargetReplicaSetSize/InstanceCount - Indicates whether the + * TargetReplicaSetSize property (for Stateful services) or the InstanceCount + * property (for Stateless services) is set. The value is 1. + * - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration + * property is set. The value is 2. + * - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is + * set. The value is 4. + * - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration + * property is set. The value is 8. + * - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The + * value is 16. + * - PlacementConstraints - Indicates the PlacementConstraints property is set. + * The value is 32. + * - PlacementPolicyList - Indicates the ServicePlacementPolicies property is + * set. The value is 64. + * - Correlation - Indicates the CorrelationScheme property is set. The value + * is 128. + * - Metrics - Indicates the ServiceLoadMetrics property is set. The value is + * 256. + * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value + * is 512. + * - ScalingPolicy - Indicates the ScalingPolicies property is set. The value + * is 1024. + * + * @param {string} [serviceUpdateDescription.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} [serviceUpdateDescription.correlationScheme] The correlation + * scheme. + * + * @param {array} [serviceUpdateDescription.loadMetrics] The service load + * metrics. + * + * @param {array} [serviceUpdateDescription.servicePlacementPolicies] The + * service placement policies. + * + * @param {string} [serviceUpdateDescription.defaultMoveCost] The move cost for + * the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {array} [serviceUpdateDescription.scalingPolicies] Scaling policies + * for this service. + * + * @param {string} serviceUpdateDescription.serviceKind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + updateServiceWithHttpOperationResponse(serviceId, serviceUpdateDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateService(serviceId, serviceUpdateDescription, 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 using the specified update + * description. + * + * This API allows updating properties of a running Service Fabric service. The + * set of properties that can be updated are a subset of the properties that + * were specified at the time of creating the service. The current set of + * properties can be obtained using `GetServiceDescription` API. Note that + * updating the properties of a running service is different than upgrading + * your application using `StartApplicationUpgrade` API. The upgrade is a long + * running background operation that involves moving the application from one + * version to another, one upgrade domain at a time, whereas update applies the + * new properties immediately to the service. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * + * @param {object} serviceUpdateDescription The information necessary to update + * a service. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} [serviceUpdateDescription.flags] Flags indicating whether + * other properties are set. Each of the associated properties corresponds to a + * flag, specified below, which, if set, indicate that the property is + * specified. + * This property can be a combination of those flags obtained using bitwise + * 'OR' operator. + * For example, if the provided value is 6 then the flags for + * ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. * + * - None - Does not indicate any other properties are set. The value is zero. + * - TargetReplicaSetSize/InstanceCount - Indicates whether the + * TargetReplicaSetSize property (for Stateful services) or the InstanceCount + * property (for Stateless services) is set. The value is 1. + * - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration + * property is set. The value is 2. + * - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is + * set. The value is 4. + * - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration + * property is set. The value is 8. + * - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The + * value is 16. + * - PlacementConstraints - Indicates the PlacementConstraints property is set. + * The value is 32. + * - PlacementPolicyList - Indicates the ServicePlacementPolicies property is + * set. The value is 64. + * - Correlation - Indicates the CorrelationScheme property is set. The value + * is 128. + * - Metrics - Indicates the ServiceLoadMetrics property is set. The value is + * 256. + * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value + * is 512. + * - ScalingPolicy - Indicates the ScalingPolicies property is set. The value + * is 1024. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {string} [serviceUpdateDescription.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)". * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {array} [serviceUpdateDescription.correlationScheme] The correlation + * scheme. * + * @param {array} [serviceUpdateDescription.loadMetrics] The service load + * metrics. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {array} [serviceUpdateDescription.servicePlacementPolicies] The + * service placement policies. * + * @param {string} [serviceUpdateDescription.defaultMoveCost] The move cost for + * the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * - * @param {boolean} [options.includeSystemApplicationHealthStatistics] - * Indicates whether the health statistics should include the fabric:/System - * application health statistics. False by default. - * If IncludeSystemApplicationHealthStatistics is set to true, the health - * statistics include the entities that belong to the fabric:/System - * application. - * Otherwise, the query result includes health statistics only for user - * applications. - * The health statistics must be included in the query result for this - * parameter to be applied. + * @param {array} [serviceUpdateDescription.scalingPolicies] Scaling policies + * for this service. + * + * @param {string} serviceUpdateDescription.serviceKind Polymorphic + * Discriminator * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -25528,7 +50106,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -25536,14 +50114,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ClusterHealth} 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. */ - getClusterHealth(options, optionalCallback) { + updateService(serviceId, serviceUpdateDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -25552,205 +50129,52 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterHealth(options, (err, result, request, response) => { + self._updateService(serviceId, serviceUpdateDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterHealth(options, optionalCallback); + return self._updateService(serviceId, serviceUpdateDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric cluster using the specified - * policy. + * @summary Gets the description of an existing Service Fabric service. * - * Gets the health of a Service Fabric cluster. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the cluster based on the health state. - * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to - * filter the collection of nodes and applications returned based on their - * aggregated health state. - * Use ClusterHealthPolicies to override the health policies used to evaluate - * the health. + * Gets the description of an existing Service Fabric service. A service must + * be created before its description can be obtained. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.nodesHealthStateFilter] Allows filtering of the - * node health state objects returned in the result of cluster health query - * based on their health state. The possible values for this parameter include - * integer value of one of the - * following health states. Only nodes that match the filter are returned. All - * nodes are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of nodes with - * HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.applicationsHealthStateFilter] Allows filtering of - * the application health state objects returned in the result of cluster - * health - * query based on their health state. - * The possible values for this parameter include integer value obtained from - * members or bitwise operations - * on members of HealthStateFilter enumeration. Only applications that match - * the filter are returned. - * All applications are used to evaluate the aggregated health state. If not - * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of applications - * with HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. - * - * - * @param {boolean} [options.includeSystemApplicationHealthStatistics] - * Indicates whether the health statistics should include the fabric:/System - * application health statistics. False by default. - * If IncludeSystemApplicationHealthStatistics is set to true, the health - * statistics include the entities that belong to the fabric:/System - * application. - * Otherwise, the query result includes health statistics only for user - * applications. - * The health statistics must be included in the query result for this - * parameter to be applied. - * - * - * @param {object} [options.clusterHealthPolicies] Describes the health - * policies used to evaluate the cluster health. - * If not present, the health evaluation uses the cluster health policy defined - * in the cluster manifest or the default cluster health policy. - * By default, each application is evaluated using its specific application - * health policy, defined in the application manifest, or the default health - * policy, if no policy is defined in manifest. - * If the application health policy map is specified, and it has an entry for - * an application, the specified application health policy - * is used to evaluate the application health. - * - * - * @param {array} [options.clusterHealthPolicies.applicationHealthPolicyMap] - * - * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] - * - * @param {boolean} - * [options.clusterHealthPolicies.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.clusterHealthPolicies.clusterHealthPolicy.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} - * [options.clusterHealthPolicies.clusterHealthPolicy.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 {array} - * [options.clusterHealthPolicies.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterHealthUsingPolicyWithHttpOperationResponse(options) { + getServiceDescriptionWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterHealthUsingPolicy(options, (err, result, request, response) => { + self._getServiceDescription(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -25761,178 +50185,25 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric cluster using the specified - * policy. + * @summary Gets the description of an existing Service Fabric service. * - * Gets the health of a Service Fabric cluster. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the cluster based on the health state. - * Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to - * filter the collection of nodes and applications returned based on their - * aggregated health state. - * Use ClusterHealthPolicies to override the health policies used to evaluate - * the health. + * Gets the description of an existing Service Fabric service. A service must + * be created before its description can be obtained. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.nodesHealthStateFilter] Allows filtering of the - * node health state objects returned in the result of cluster health query - * based on their health state. The possible values for this parameter include - * integer value of one of the - * following health states. Only nodes that match the filter are returned. All - * nodes are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of nodes with - * HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.applicationsHealthStateFilter] Allows filtering of - * the application health state objects returned in the result of cluster - * health - * query based on their health state. - * The possible values for this parameter include integer value obtained from - * members or bitwise operations - * on members of HealthStateFilter enumeration. Only applications that match - * the filter are returned. - * All applications are used to evaluate the aggregated health state. If not - * specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these values obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of applications - * with HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. - * - * - * @param {boolean} [options.includeSystemApplicationHealthStatistics] - * Indicates whether the health statistics should include the fabric:/System - * application health statistics. False by default. - * If IncludeSystemApplicationHealthStatistics is set to true, the health - * statistics include the entities that belong to the fabric:/System - * application. - * Otherwise, the query result includes health statistics only for user - * applications. - * The health statistics must be included in the query result for this - * parameter to be applied. - * - * - * @param {object} [options.clusterHealthPolicies] Describes the health - * policies used to evaluate the cluster health. - * If not present, the health evaluation uses the cluster health policy defined - * in the cluster manifest or the default cluster health policy. - * By default, each application is evaluated using its specific application - * health policy, defined in the application manifest, or the default health - * policy, if no policy is defined in manifest. - * If the application health policy map is specified, and it has an entry for - * an application, the specified application health policy - * is used to evaluate the application health. - * - * - * @param {array} [options.clusterHealthPolicies.applicationHealthPolicyMap] - * - * @param {object} [options.clusterHealthPolicies.clusterHealthPolicy] - * - * @param {boolean} - * [options.clusterHealthPolicies.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.clusterHealthPolicies.clusterHealthPolicy.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} - * [options.clusterHealthPolicies.clusterHealthPolicy.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 {array} - * [options.clusterHealthPolicies.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -25944,7 +50215,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterHealth} - The deserialized result object. + * @resolve {ServiceDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -25953,13 +50224,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ClusterHealth} for more information. + * See {@link ServiceDescription} 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. */ - getClusterHealthUsingPolicy(options, optionalCallback) { + getServiceDescription(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -25968,49 +50239,110 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterHealthUsingPolicy(options, (err, result, request, response) => { + self._getServiceDescription(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterHealthUsingPolicy(options, optionalCallback); + return self._getServiceDescription(serviceId, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric cluster using health chunks. + * @summary Gets the health of the specified Service Fabric service. * - * Gets the health of a Service Fabric cluster using health chunks. Includes - * the aggregated health state of the cluster, but none of the cluster - * entities. - * To expand the cluster health and get the health state of all or some of the - * entities, use the POST URI and specify the cluster health chunk query - * description. + * Gets the health information of the specified service. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the service based on the health state. + * Use PartitionsHealthStateFilter to filter the collection of partitions + * returned. + * If you specify a service that does not exist in the health store, this + * request returns an error. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.partitionsHealthStateFilter] Allows filtering of + * the partitions health state objects returned in the result of service health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only partitions that match the filter are returned. All partitions are used + * to evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these value + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of partitions with HealthState value of OK (2) and + * Warning (4) will be returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterHealthChunkWithHttpOperationResponse(options) { + getServiceHealthWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterHealthChunk(options, (err, result, request, response) => { + self._getServiceHealth(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -26021,22 +50353,83 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric cluster using health chunks. + * @summary Gets the health of the specified Service Fabric service. * - * Gets the health of a Service Fabric cluster using health chunks. Includes - * the aggregated health state of the cluster, but none of the cluster - * entities. - * To expand the cluster health and get the health state of all or some of the - * entities, use the POST URI and specify the cluster health chunk query - * description. + * Gets the health information of the specified service. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the service based on the health state. + * Use PartitionsHealthStateFilter to filter the collection of partitions + * returned. + * If you specify a service that does not exist in the health store, this + * request returns an error. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.partitionsHealthStateFilter] Allows filtering of + * the partitions health state objects returned in the result of service health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only partitions that match the filter are returned. All partitions are used + * to evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these value + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of partitions with HealthState value of OK (2) and + * Warning (4) will be returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -26048,7 +50441,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterHealthChunk} - The deserialized result object. + * @resolve {ServiceHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -26057,13 +50450,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ClusterHealthChunk} for more information. + * See {@link ServiceHealth} 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. */ - getClusterHealthChunk(options, optionalCallback) { + getServiceHealth(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -26072,156 +50465,189 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterHealthChunk(options, (err, result, request, response) => { + self._getServiceHealth(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterHealthChunk(options, optionalCallback); + return self._getServiceHealth(serviceId, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric cluster using health chunks. + * @summary Gets the health of the specified Service Fabric service, by using + * the specified health policy. * - * Gets the health of a Service Fabric cluster using health chunks. The health - * evaluation is done based on the input cluster health chunk query - * description. - * The query description allows users to specify health policies for evaluating - * the cluster and its children. - * Users can specify very flexible filters to select which cluster entities to - * return. The selection can be done based on the entities health state and - * based on the hierarchy. - * The query can return multi-level children of the entities based on the - * specified filters. For example, it can return one application with a - * specified name, and for this application, return - * only services that are in Error or Warning, and all partitions and replicas - * for one of these services. + * Gets the health information of the specified service. + * If the application health policy is specified, the health evaluation uses it + * to get the aggregated health state. + * If the policy is not specified, the health evaluation uses the application + * health policy defined in the application manifest, or the default health + * policy, if no policy is defined in the manifest. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the service based on the health state. + * Use PartitionsHealthStateFilter to filter the collection of partitions + * returned. + * If you specify a service that does not exist in the health store, this + * request returns an error. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.clusterHealthChunkQueryDescription] Describes the - * cluster and application health policies used to evaluate the cluster health - * and the filters to select which cluster entities to be returned. - * If the cluster health policy is present, it is used to evaluate the cluster - * events and the cluster nodes. If not present, the health evaluation uses the - * cluster health policy defined in the cluster manifest or the default cluster - * health policy. - * By default, each application is evaluated using its specific application - * health policy, defined in the application manifest, or the default health - * policy, if no policy is defined in manifest. - * If the application health policy map is specified, and it has an entry for - * an application, the specified application health policy - * is used to evaluate the application health. - * Users can specify very flexible filters to select which cluster entities to - * include in response. The selection can be done based on the entities health - * state and based on the hierarchy. - * The query can return multi-level children of the entities based on the - * specified filters. For example, it can return one application with a - * specified name, and for this application, return - * only services that are in Error or Warning, and all partitions and replicas - * for one of these services. - * - * - * @param {array} [options.clusterHealthChunkQueryDescription.nodeFilters] - * Defines a list of filters that specify which nodes to be included in the - * returned cluster health chunk. - * If no filters are specified, no nodes are returned. All the nodes are used - * to evaluate the cluster's aggregated health state, regardless of the input - * filters. - * The cluster health chunk query may specify multiple node filters. - * For example, it can specify a filter to return all nodes with health state - * Error and another filter to always include a node identified by its - * NodeName. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * - * @param {array} - * [options.clusterHealthChunkQueryDescription.applicationFilters] Defines a - * list of filters that specify which applications to be included in the - * returned cluster health chunk. - * If no filters are specified, no applications are returned. All the - * applications are used to evaluate the cluster's aggregated health state, - * regardless of the input filters. - * The cluster health chunk query may specify multiple application filters. - * For example, it can specify a filter to return all applications with health - * state Error and another filter to always include applications of a specified - * application type. + * @param {number} [options.partitionsHealthStateFilter] Allows filtering of + * the partitions health state objects returned in the result of service health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only partitions that match the filter are returned. All partitions are used + * to evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these value + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of partitions with HealthState value of OK (2) and + * Warning (4) will be returned. * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * - * @param {object} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. * - * @param {boolean} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.considerWarningAsError] + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * * @param {number} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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. + * [options.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. * - * In large clusters, some nodes will always be down or out for repairs, so - * this percentage should be configured to tolerate that. - * + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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. + * [options.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 applications - * that can be unhealthy before the cluster is considered in error. + * 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 - * 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. + * 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 - * applications. Default percentage is zero. + * partitions. Default percentage is zero. * + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. * - * @param {array} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * 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 {object} - * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies] + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum maximum allowed percentage of unhealthy services. Allowed values + * are Byte values from zero to 100. * - * @param {array} - * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * 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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithHttpOperationResponse(options) { + getServiceHealthUsingPolicyWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, (err, result, request, response) => { + self._getServiceHealthUsingPolicy(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -26232,129 +50658,162 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric cluster using health chunks. + * @summary Gets the health of the specified Service Fabric service, by using + * the specified health policy. * - * Gets the health of a Service Fabric cluster using health chunks. The health - * evaluation is done based on the input cluster health chunk query - * description. - * The query description allows users to specify health policies for evaluating - * the cluster and its children. - * Users can specify very flexible filters to select which cluster entities to - * return. The selection can be done based on the entities health state and - * based on the hierarchy. - * The query can return multi-level children of the entities based on the - * specified filters. For example, it can return one application with a - * specified name, and for this application, return - * only services that are in Error or Warning, and all partitions and replicas - * for one of these services. + * Gets the health information of the specified service. + * If the application health policy is specified, the health evaluation uses it + * to get the aggregated health state. + * If the policy is not specified, the health evaluation uses the application + * health policy defined in the application manifest, or the default health + * policy, if no policy is defined in the manifest. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the service based on the health state. + * Use PartitionsHealthStateFilter to filter the collection of partitions + * returned. + * If you specify a service that does not exist in the health store, this + * request returns an error. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.clusterHealthChunkQueryDescription] Describes the - * cluster and application health policies used to evaluate the cluster health - * and the filters to select which cluster entities to be returned. - * If the cluster health policy is present, it is used to evaluate the cluster - * events and the cluster nodes. If not present, the health evaluation uses the - * cluster health policy defined in the cluster manifest or the default cluster - * health policy. - * By default, each application is evaluated using its specific application - * health policy, defined in the application manifest, or the default health - * policy, if no policy is defined in manifest. - * If the application health policy map is specified, and it has an entry for - * an application, the specified application health policy - * is used to evaluate the application health. - * Users can specify very flexible filters to select which cluster entities to - * include in response. The selection can be done based on the entities health - * state and based on the hierarchy. - * The query can return multi-level children of the entities based on the - * specified filters. For example, it can return one application with a - * specified name, and for this application, return - * only services that are in Error or Warning, and all partitions and replicas - * for one of these services. - * - * - * @param {array} [options.clusterHealthChunkQueryDescription.nodeFilters] - * Defines a list of filters that specify which nodes to be included in the - * returned cluster health chunk. - * If no filters are specified, no nodes are returned. All the nodes are used - * to evaluate the cluster's aggregated health state, regardless of the input - * filters. - * The cluster health chunk query may specify multiple node filters. - * For example, it can specify a filter to return all nodes with health state - * Error and another filter to always include a node identified by its - * NodeName. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * - * @param {array} - * [options.clusterHealthChunkQueryDescription.applicationFilters] Defines a - * list of filters that specify which applications to be included in the - * returned cluster health chunk. - * If no filters are specified, no applications are returned. All the - * applications are used to evaluate the cluster's aggregated health state, - * regardless of the input filters. - * The cluster health chunk query may specify multiple application filters. - * For example, it can specify a filter to return all applications with health - * state Error and another filter to always include applications of a specified - * application type. + * @param {number} [options.partitionsHealthStateFilter] Allows filtering of + * the partitions health state objects returned in the result of service health + * query based on their health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only partitions that match the filter are returned. All partitions are used + * to evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these value + * obtained using bitwise 'OR' operator. For example, if the provided value is + * 6 then health state of partitions with HealthState value of OK (2) and + * Warning (4) will be returned. * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * - * @param {object} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy] + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. * - * @param {boolean} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.considerWarningAsError] + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * * @param {number} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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. + * [options.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. * - * In large clusters, some nodes will always be down or out for repairs, so - * this percentage should be configured to tolerate that. - * + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.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. + * [options.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 applications - * that can be unhealthy before the cluster is considered in error. + * 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 - * 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. + * 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 - * applications. Default percentage is zero. + * partitions. Default percentage is zero. * + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. * - * @param {array} - * [options.clusterHealthChunkQueryDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * 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 {object} - * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies] + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum maximum allowed percentage of unhealthy services. Allowed values + * are Byte values from zero to 100. * - * @param {array} - * [options.clusterHealthChunkQueryDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * 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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -26366,7 +50825,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterHealthChunk} - The deserialized result object. + * @resolve {ServiceHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -26375,13 +50834,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ClusterHealthChunk} for more information. + * See {@link ServiceHealth} 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. */ - getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, optionalCallback) { + getServiceHealthUsingPolicy(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -26390,41 +50849,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, (err, result, request, response) => { + self._getServiceHealthUsingPolicy(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, optionalCallback); + return self._getServiceHealthUsingPolicy(serviceId, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric cluster. + * @summary Sends a health report on the Service Fabric service. * - * Sends a health report on a Service Fabric cluster. The report must contain - * the information about the source of the health report and property on which - * it is reported. - * The report is sent to a Service Fabric gateway node, which forwards to the - * health store. + * Reports health state of the specified Service Fabric service. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Service, which forwards to + * the health store. * The report may be accepted by the gateway, but rejected by the health store * after extra validation. * For example, the health store may reject the report because of an invalid * parameter, like a stale sequence number. * To see whether the report was applied in the health store, run - * GetClusterHealth and check that the report appears in the HealthEvents + * GetServiceHealth and check that the report appears in the HealthEvents * section. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -26441,12 +50906,13 @@ class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -26458,7 +50924,6 @@ class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -26470,7 +50935,6 @@ class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -26478,10 +50942,9 @@ class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -26491,33 +50954,31 @@ class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -26528,11 +50989,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - reportClusterHealthWithHttpOperationResponse(healthInformation, options) { + reportServiceHealthWithHttpOperationResponse(serviceId, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportClusterHealth(healthInformation, options, (err, result, request, response) => { + self._reportServiceHealth(serviceId, healthInformation, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -26543,29 +51004,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric cluster. + * @summary Sends a health report on the Service Fabric service. * - * Sends a health report on a Service Fabric cluster. The report must contain - * the information about the source of the health report and property on which - * it is reported. - * The report is sent to a Service Fabric gateway node, which forwards to the - * health store. + * Reports health state of the specified Service Fabric service. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Service, which forwards to + * the health store. * The report may be accepted by the gateway, but rejected by the health store * after extra validation. * For example, the health store may reject the report because of an invalid * parameter, like a stale sequence number. * To see whether the report was applied in the health store, run - * GetClusterHealth and check that the report appears in the HealthEvents + * GetServiceHealth and check that the report appears in the HealthEvents * section. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} healthInformation Describes the health information for the * health report. This information needs to be present in all of the health * reports sent to the health manager. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * * @param {string} healthInformation.property The property of the health * information. An entity can have health reports for different properties. @@ -26582,12 +51049,13 @@ class ServiceFabricClient extends ServiceClient { * Together with the SourceId, the property uniquely identifies the health * information. * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' * * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 + * duration for which this health report is valid. This field uses ISO8601 * format for specifying the duration. * When clients report periodically, they should send reports with higher * frequency than time to live. @@ -26599,7 +51067,6 @@ class ServiceFabricClient extends ServiceClient { * * If not specified, time to live defaults to infinite value. * - * * @param {string} [healthInformation.description] The description of the * health information. It represents free text used to add human readable * information about the report. @@ -26611,7 +51078,6 @@ class ServiceFabricClient extends ServiceClient { * Note that when truncated, the description has less than 4096 characters from * the original string. * - * * @param {string} [healthInformation.sequenceNumber] The sequence number for * this health report as a numeric string. * The report sequence number is used by the health store to detect stale @@ -26619,10 +51085,9 @@ class ServiceFabricClient extends ServiceClient { * If not specified, a sequence number is auto-generated by the health client * when a report is added. * - * * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it + * If set to true, the report is removed from the health store after it * expires. * If set to false, the report is treated as an error when expired. The value * of this property is false by default. @@ -26632,33 +51097,31 @@ class ServiceFabricClient extends ServiceClient { * entity is evaluated at error when the health report expires. * This flags the entity as being in Error health state. * - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the + * @param {boolean} [options.immediate] A flag that indicates whether the * report should be sent immediately. * A health report is sent to a Service Fabric gateway Application, which * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http + * If Immediate is set to true, the report is sent immediately from HTTP * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. + * the HTTP Gateway Application is using. * This is useful for critical reports that should be sent as soon as possible. * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the + * for example if the HTTP Gateway is closed or the message doesn't reach the * Gateway. * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to + * settings from the HTTP Gateway. Therefore, it will be batched according to * the HealthReportSendInterval configuration. * This is the recommended setting because it allows the health client to * optimize health reporting messages to health store as well as health report * processing. * By default, reports are not sent immediately. * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -26684,7 +51147,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - reportClusterHealth(healthInformation, options, optionalCallback) { + reportServiceHealth(serviceId, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -26693,48 +51156,72 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportClusterHealth(healthInformation, options, (err, result, request, response) => { + self._reportServiceHealth(serviceId, healthInformation, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportClusterHealth(healthInformation, options, optionalCallback); + return self._reportServiceHealth(serviceId, healthInformation, options, optionalCallback); } } /** - * @summary Gets a list of fabric code versions that are provisioned in a - * Service Fabric cluster. + * @summary Resolve a Service Fabric partition. * - * Gets a list of information about fabric code versions that are provisioned - * in the cluster. The parameter CodeVersion can be used to optionally filter - * the output to only that particular version. + * Resolve a Service Fabric service partition to get the endpoints of the + * service replicas. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.codeVersion] The product version of Service Fabric. + * @param {number} [options.partitionKeyType] Key type for the partition. This + * parameter is required if the partition scheme for the service is Int64Range + * or Named. The possible values are following. + * - None (1) - Indicates that the PartitionKeyValue parameter is not + * specified. This is valid for the partitions with partitioning scheme as + * Singleton. This is the default value. The value is 1. + * - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an + * int64 partition key. This is valid for the partitions with partitioning + * scheme as Int64Range. The value is 2. + * - Named (3) - Indicates that the PartitionKeyValue parameter is a name of + * the partition. This is valid for the partitions with partitioning scheme as + * Named. The value is 3. + * + * @param {string} [options.partitionKeyValue] Partition key. This is required + * if the partition scheme for the service is Int64Range or Named. + * + * @param {string} [options.previousRspVersion] The value in the Version field + * of the response that was received previously. This is required if the user + * knows that the result that was gotten previously is stale. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getProvisionedFabricCodeVersionInfoListWithHttpOperationResponse(options) { + resolveServiceWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getProvisionedFabricCodeVersionInfoList(options, (err, result, request, response) => { + self._resolveService(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -26745,21 +51232,45 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a list of fabric code versions that are provisioned in a - * Service Fabric cluster. + * @summary Resolve a Service Fabric partition. * - * Gets a list of information about fabric code versions that are provisioned - * in the cluster. The parameter CodeVersion can be used to optionally filter - * the output to only that particular version. + * Resolve a Service Fabric service partition to get the endpoints of the + * service replicas. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.codeVersion] The product version of Service Fabric. + * @param {number} [options.partitionKeyType] Key type for the partition. This + * parameter is required if the partition scheme for the service is Int64Range + * or Named. The possible values are following. + * - None (1) - Indicates that the PartitionKeyValue parameter is not + * specified. This is valid for the partitions with partitioning scheme as + * Singleton. This is the default value. The value is 1. + * - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an + * int64 partition key. This is valid for the partitions with partitioning + * scheme as Int64Range. The value is 2. + * - Named (3) - Indicates that the PartitionKeyValue parameter is a name of + * the partition. This is valid for the partitions with partitioning scheme as + * Named. The value is 3. + * + * @param {string} [options.partitionKeyValue] Partition key. This is required + * if the partition scheme for the service is Int64Range or Named. + * + * @param {string} [options.previousRspVersion] The value in the Version field + * of the response that was received previously. This is required if the user + * knows that the result that was gotten previously is stale. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -26771,7 +51282,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {ResolvedServicePartition} - The deserialized result object. * * @reject {Error} - The error object. * @@ -26779,13 +51290,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResolvedServicePartition} 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. */ - getProvisionedFabricCodeVersionInfoList(options, optionalCallback) { + resolveService(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -26794,49 +51307,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getProvisionedFabricCodeVersionInfoList(options, (err, result, request, response) => { + self._resolveService(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getProvisionedFabricCodeVersionInfoList(options, optionalCallback); + return self._resolveService(serviceId, options, optionalCallback); } } /** - * @summary Gets a list of fabric config versions that are provisioned in a - * Service Fabric cluster. + * @summary Gets the list of partitions of a Service Fabric service. * - * Gets a list of information about fabric config versions that are provisioned - * in the cluster. The parameter ConfigVersion can be used to optionally filter - * the output to only that particular version. + * The response includes the partition ID, partitioning scheme information, + * keys supported by the partition, status, health, and other details about the + * partition. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.configVersion] The config version of Service - * Fabric. + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getProvisionedFabricConfigVersionInfoListWithHttpOperationResponse(options) { + getPartitionInfoListWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getProvisionedFabricConfigVersionInfoList(options, (err, result, request, response) => { + self._getPartitionInfoList(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -26847,22 +51372,34 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a list of fabric config versions that are provisioned in a - * Service Fabric cluster. + * @summary Gets the list of partitions of a Service Fabric service. * - * Gets a list of information about fabric config versions that are provisioned - * in the cluster. The parameter ConfigVersion can be used to optionally filter - * the output to only that particular version. + * The response includes the partition ID, partitioning scheme information, + * keys supported by the partition, status, health, and other details about the + * partition. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.configVersion] The config version of Service - * Fabric. + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -26874,7 +51411,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {PagedServicePartitionInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -26882,13 +51419,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedServicePartitionInfoList} 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. */ - getProvisionedFabricConfigVersionInfoList(options, optionalCallback) { + getPartitionInfoList(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -26897,44 +51436,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getProvisionedFabricConfigVersionInfoList(options, (err, result, request, response) => { + self._getPartitionInfoList(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getProvisionedFabricConfigVersionInfoList(options, optionalCallback); + return self._getPartitionInfoList(serviceId, options, optionalCallback); } } /** - * @summary Gets the progress of the current cluster upgrade. + * @summary Gets the information about a Service Fabric partition. * - * Gets the current progress of the ongoing cluster upgrade. If no upgrade is - * currently in progress, gets the last state of the previous cluster upgrade. + * Gets the information about the specified partition. The response includes + * the partition ID, partitioning scheme information, keys supported by the + * partition, status, health, and other details about the partition. + * + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterUpgradeProgressWithHttpOperationResponse(options) { + getPartitionInfoWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterUpgradeProgress(options, (err, result, request, response) => { + self._getPartitionInfo(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -26945,17 +51487,20 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the progress of the current cluster upgrade. + * @summary Gets the information about a Service Fabric partition. * - * Gets the current progress of the ongoing cluster upgrade. If no upgrade is - * currently in progress, gets the last state of the previous cluster upgrade. + * Gets the information about the specified partition. The response includes + * the partition ID, partitioning scheme information, keys supported by the + * partition, status, health, and other details about the partition. + * + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -26967,7 +51512,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterUpgradeProgressObject} - The deserialized result object. + * @resolve {ServicePartitionInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -26976,14 +51521,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ClusterUpgradeProgressObject} for more - * information. + * See {@link ServicePartitionInfo} 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. */ - getClusterUpgradeProgress(options, optionalCallback) { + getPartitionInfo(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -26992,50 +51536,46 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterUpgradeProgress(options, (err, result, request, response) => { + self._getPartitionInfo(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterUpgradeProgress(options, optionalCallback); + return self._getPartitionInfo(partitionId, options, optionalCallback); } } /** - * @summary Get the Service Fabric standalone cluster configuration. - * - * Get the Service Fabric standalone cluster configuration. The cluster - * configuration contains properties of the cluster that include different node - * types on the cluster, - * security configurations, fault and upgrade domain topologies etc. + * @summary Gets the name of the Service Fabric service for a partition. * + * Gets name of the service for the specified partition. A 404 error is + * returned if the partition ID does not exist in the cluster. * - * @param {string} configurationApiVersion The API version of the Standalone - * cluster json configuration. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterConfigurationWithHttpOperationResponse(configurationApiVersion, options) { + getServiceNameInfoWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterConfiguration(configurationApiVersion, options, (err, result, request, response) => { + self._getServiceNameInfo(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -27046,23 +51586,229 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the Service Fabric standalone cluster configuration. + * @summary Gets the name of the Service Fabric service for a partition. + * + * Gets name of the service for the specified partition. A 404 error is + * returned if the partition ID does not exist in the cluster. * - * Get the Service Fabric standalone cluster configuration. The cluster - * configuration contains properties of the cluster that include different node - * types on the cluster, - * security configurations, fault and upgrade domain topologies etc. + * @param {uuid} partitionId The identity of the partition. * + * @param {object} [options] Optional Parameters. * - * @param {string} configurationApiVersion The API version of the Standalone - * cluster json configuration. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ServiceNameInfo} - 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 ServiceNameInfo} 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. + */ + getServiceNameInfo(partitionId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getServiceNameInfo(partitionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getServiceNameInfo(partitionId, options, optionalCallback); + } + } + + /** + * @summary Gets the health of the specified Service Fabric partition. + * + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the service based on the health state. + * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState + * objects on the partition. + * If you specify a partition that does not exist in the health store, this + * request returns an error. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.replicasHealthStateFilter] Allows filtering the + * collection of ReplicaHealthState objects on the partition. The value can be + * obtained from members or bitwise operations on members of HealthStateFilter. + * Only replicas that match the filter will be returned. All replicas will be + * used to evaluate the aggregated health state. If not specified, all entries + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. + * For example, If the provided value is 6 then all of the events with + * HealthState value of OK (2) and Warning (4) will be returned. The possible + * values for this parameter include integer value of one of the following + * health states. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [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. + */ + getPartitionHealthWithHttpOperationResponse(partitionId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getPartitionHealth(partitionId, 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 health of the specified Service Fabric partition. + * + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the service based on the health state. + * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState + * objects on the partition. + * If you specify a partition that does not exist in the health store, this + * request returns an error. + * + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.replicasHealthStateFilter] Allows filtering the + * collection of ReplicaHealthState objects on the partition. The value can be + * obtained from members or bitwise operations on members of HealthStateFilter. + * Only replicas that match the filter will be returned. All replicas will be + * used to evaluate the aggregated health state. If not specified, all entries + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. + * For example, If the provided value is 6 then all of the events with + * HealthState value of OK (2) and Warning (4) will be returned. The possible + * values for this parameter include integer value of one of the following + * health states. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27074,7 +51820,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterConfiguration} - The deserialized result object. + * @resolve {PartitionHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -27082,62 +51828,199 @@ class ServiceFabricClient extends ServiceClient { * * {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 ClusterConfiguration} for more information. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionHealth} 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. + */ + getPartitionHealth(partitionId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getPartitionHealth(partitionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPartitionHealth(partitionId, options, optionalCallback); + } + } + + /** + * @summary Gets the health of the specified Service Fabric partition, by using + * the specified health policy. + * + * Gets the health information of the specified partition. + * If the application health policy is specified, the health evaluation uses it + * to get the aggregated health state. + * If the policy is not specified, the health evaluation uses the application + * health policy defined in the application manifest, or the default health + * policy, if no policy is defined in the manifest. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the partition based on the health state. + * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState + * objects on the partition. Use ApplicationHealthPolicy in the POST body to + * override the health policies used to evaluate the health. + * If you specify a partition that does not exist in the health store, this + * request returns an error. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {number} [options.replicasHealthStateFilter] Allows filtering the + * collection of ReplicaHealthState objects on the partition. The value can be + * obtained from members or bitwise operations on members of HealthStateFilter. + * Only replicas that match the filter will be returned. All replicas will be + * used to evaluate the aggregated health state. If not specified, all entries + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. + * For example, If the provided value is 6 then all of the events with + * HealthState value of OK (2) and Warning (4) will be returned. The possible + * values for this parameter include integer value of one of the following + * health states. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. + * + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [options.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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. * - * {object} [request] - The HTTP Request object if an error did not occur. + * 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. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getClusterConfiguration(configurationApiVersion, options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getClusterConfiguration(configurationApiVersion, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getClusterConfiguration(configurationApiVersion, options, optionalCallback); - } - } - - /** - * @summary Get the cluster configuration upgrade status of a Service Fabric - * standalone cluster. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum maximum allowed percentage of unhealthy services. Allowed values + * are Byte values from zero to 100. * - * Get the cluster configuration upgrade status of a Service Fabric standalone - * cluster. + * 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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getClusterConfigurationUpgradeStatusWithHttpOperationResponse(options) { + getPartitionHealthUsingPolicyWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterConfigurationUpgradeStatus(options, (err, result, request, response) => { + self._getPartitionHealthUsingPolicy(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -27148,134 +52031,156 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the cluster configuration upgrade status of a Service Fabric - * standalone cluster. + * @summary Gets the health of the specified Service Fabric partition, by using + * the specified health policy. * - * Get the cluster configuration upgrade status of a Service Fabric standalone - * cluster. + * Gets the health information of the specified partition. + * If the application health policy is specified, the health evaluation uses it + * to get the aggregated health state. + * If the policy is not specified, the health evaluation uses the application + * health policy defined in the application manifest, or the default health + * policy, if no policy is defined in the manifest. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the partition based on the health state. + * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState + * objects on the partition. Use ApplicationHealthPolicy in the POST body to + * override the health policies used to evaluate the health. + * If you specify a partition that does not exist in the health store, this + * request returns an error. * + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * - * @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 {ClusterConfigurationUpgradeStatusInfo} - 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 ClusterConfigurationUpgradeStatusInfo} 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. - */ - getClusterConfigurationUpgradeStatus(options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getClusterConfigurationUpgradeStatus(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getClusterConfigurationUpgradeStatus(options, optionalCallback); - } - } - - /** - * @summary Provision the code or configuration packages of a Service Fabric - * cluster. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. * - * Validate and provision the code or configuration packages of a Service - * Fabric cluster. + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * - * @param {object} provisionFabricDescription Describes the parameters for - * provisioning a cluster. + * @param {number} [options.replicasHealthStateFilter] Allows filtering the + * collection of ReplicaHealthState objects on the partition. The value can be + * obtained from members or bitwise operations on members of HealthStateFilter. + * Only replicas that match the filter will be returned. All replicas will be + * used to evaluate the aggregated health state. If not specified, all entries + * will be returned.The state values are flag-based enumeration, so the value + * could be a combination of these values obtained using bitwise 'OR' operator. + * For example, If the provided value is 6 then all of the events with + * HealthState value of OK (2) and Warning (4) will be returned. The possible + * values for this parameter include integer value of one of the following + * health states. * - * @param {string} [provisionFabricDescription.codeFilePath] The cluster code - * package file path. + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * - * @param {string} [provisionFabricDescription.clusterManifestFilePath] The - * cluster manifest file path. + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {number} + * [options.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} [options.customHeaders] Headers that will be added to the - * request + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * - * @returns {Promise} A promise is returned + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] + * The maximum allowed percentage of unhealthy partitions per service. Allowed + * values are Byte values from zero to 100 * - * @resolve {HttpOperationResponse} - The deserialized result object. + * 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. * - * @reject {Error} - The error object. - */ - provisionClusterWithHttpOperationResponse(provisionFabricDescription, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._provisionCluster(provisionFabricDescription, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Provision the code or configuration packages of a Service Fabric - * cluster. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. * - * Validate and provision the code or configuration packages of a Service - * Fabric cluster. + * 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 {object} provisionFabricDescription Describes the parameters for - * provisioning a cluster. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum maximum allowed percentage of unhealthy services. Allowed values + * are Byte values from zero to 100. * - * @param {string} [provisionFabricDescription.codeFilePath] The cluster code - * package file path. + * 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} [provisionFabricDescription.clusterManifestFilePath] The - * cluster manifest file path. + * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.excludeHealthStatistics] Indicates whether the + * health statistics should be returned as part of the query result. False by + * default. + * The statistics show the number of children entities in health state Ok, + * Warning, and Error. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27287,7 +52192,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PartitionHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -27295,13 +52200,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionHealth} 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. */ - provisionCluster(provisionFabricDescription, options, optionalCallback) { + getPartitionHealthUsingPolicy(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -27310,38 +52216,130 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._provisionCluster(provisionFabricDescription, options, (err, result, request, response) => { + self._getPartitionHealthUsingPolicy(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._provisionCluster(provisionFabricDescription, options, optionalCallback); + return self._getPartitionHealthUsingPolicy(partitionId, options, optionalCallback); } } /** - * @summary Unprovision the code or configuration packages of a Service Fabric - * cluster. + * @summary Sends a health report on the Service Fabric partition. * - * Unprovision the code or configuration packages of a Service Fabric cluster. + * Reports health state of the specified Service Fabric partition. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Partition, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run + * GetPartitionHealth and check that the report appears in the HealthEvents + * section. * - * @param {object} unprovisionFabricDescription Describes the parameters for - * unprovisioning a cluster. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} [unprovisionFabricDescription.codeVersion] The cluster code - * package version. + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. * - * @param {string} [unprovisionFabricDescription.configVersion] The cluster - * manifest version. + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27352,11 +52350,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - unprovisionClusterWithHttpOperationResponse(unprovisionFabricDescription, options) { + reportPartitionHealthWithHttpOperationResponse(partitionId, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._unprovisionCluster(unprovisionFabricDescription, options, (err, result, request, response) => { + self._reportPartitionHealth(partitionId, healthInformation, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -27367,26 +52365,118 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Unprovision the code or configuration packages of a Service Fabric - * cluster. + * @summary Sends a health report on the Service Fabric partition. * - * Unprovision the code or configuration packages of a Service Fabric cluster. + * Reports health state of the specified Service Fabric partition. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Partition, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run + * GetPartitionHealth and check that the report appears in the HealthEvents + * section. * - * @param {object} unprovisionFabricDescription Describes the parameters for - * unprovisioning a cluster. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} [unprovisionFabricDescription.codeVersion] The cluster code - * package version. + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. * - * @param {string} [unprovisionFabricDescription.configVersion] The cluster - * manifest version. + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27412,7 +52502,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - unprovisionCluster(unprovisionFabricDescription, options, optionalCallback) { + reportPartitionHealth(partitionId, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -27421,43 +52511,49 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._unprovisionCluster(unprovisionFabricDescription, options, (err, result, request, response) => { + self._reportPartitionHealth(partitionId, healthInformation, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._unprovisionCluster(unprovisionFabricDescription, options, optionalCallback); + return self._reportPartitionHealth(partitionId, healthInformation, options, optionalCallback); } } /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Gets the load information of the specified Service Fabric + * partition. + * + * Returns information about the load of a specified partition. + * The response includes a list of load reports for a Service Fabric partition. + * Each report includes the load metric name, value, and last reported time in + * UTC. * - * Rollback the upgrade of a Service Fabric cluster. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - rollbackClusterUpgradeWithHttpOperationResponse(options) { + getPartitionLoadInformationWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._rollbackClusterUpgrade(options, (err, result, request, response) => { + self._getPartitionLoadInformation(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -27468,16 +52564,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Gets the load information of the specified Service Fabric + * partition. + * + * Returns information about the load of a specified partition. + * The response includes a list of load reports for a Service Fabric partition. + * Each report includes the load metric name, value, and last reported time in + * UTC. * - * Rollback the upgrade of a Service Fabric cluster. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27489,7 +52591,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PartitionLoadInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -27497,13 +52599,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PartitionLoadInformation} 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. */ - rollbackClusterUpgrade(options, optionalCallback) { + getPartitionLoadInformation(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -27512,34 +52616,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._rollbackClusterUpgrade(options, (err, result, request, response) => { + self._getPartitionLoadInformation(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._rollbackClusterUpgrade(options, optionalCallback); + return self._getPartitionLoadInformation(partitionId, options, optionalCallback); } } /** - * @summary Make the cluster upgrade move on to the next upgrade domain. - * - * Make the cluster upgrade move on to the next upgrade domain. + * @summary Resets the current load of a Service Fabric partition. * - * @param {object} resumeClusterUpgradeDescription Describes the parameters for - * resuming a cluster upgrade. + * Resets the current load of a Service Fabric partition to the default load + * for the service. * - * @param {string} resumeClusterUpgradeDescription.upgradeDomain The next - * upgrade domain for this cluster upgrade. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27550,11 +52651,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - resumeClusterUpgradeWithHttpOperationResponse(resumeClusterUpgradeDescription, options) { + resetPartitionLoadWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { + self._resetPartitionLoad(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -27565,22 +52666,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Make the cluster upgrade move on to the next upgrade domain. - * - * Make the cluster upgrade move on to the next upgrade domain. + * @summary Resets the current load of a Service Fabric partition. * - * @param {object} resumeClusterUpgradeDescription Describes the parameters for - * resuming a cluster upgrade. + * Resets the current load of a Service Fabric partition to the default load + * for the service. * - * @param {string} resumeClusterUpgradeDescription.upgradeDomain The next - * upgrade domain for this cluster upgrade. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27606,7 +52704,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resumeClusterUpgrade(resumeClusterUpgradeDescription, options, optionalCallback) { + resetPartitionLoad(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -27615,149 +52713,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { + self._resetPartitionLoad(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, optionalCallback); + return self._resetPartitionLoad(partitionId, options, optionalCallback); } } /** - * @summary Start upgrading the code or configuration version of a Service - * Fabric cluster. - * - * Validate the supplied upgrade parameters and start upgrading the code or - * configuration version of a Service Fabric cluster if the parameters are - * valid. - * - * @param {object} startClusterUpgradeDescription Describes the parameters for - * starting a cluster upgrade. - * - * @param {string} [startClusterUpgradeDescription.codeVersion] The cluster - * code version. - * - * @param {string} [startClusterUpgradeDescription.configVersion] The cluster - * configuration version. - * - * @param {string} [startClusterUpgradeDescription.upgradeKind] Possible values - * include: 'Invalid', 'Rolling' - * - * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {number} - * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * - * @param {boolean} [startClusterUpgradeDescription.forceRestart] - * - * @param {object} [startClusterUpgradeDescription.monitoringPolicy] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * - * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] - * - * @param {boolean} - * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [startClusterUpgradeDescription.clusterHealthPolicy.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} - * [startClusterUpgradeDescription.clusterHealthPolicy.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 {array} - * [startClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * - * @param {boolean} - * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, - * enables delta health evaluation rather than absolute health evaluation after - * completion of each upgrade domain. - * - * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] - * - * @param {number} - * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. - * - * @param {number} - * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover a specific partition that is currently stuck in quorum loss. * - * @param {object} [startClusterUpgradeDescription.applicationHealthPolicyMap] + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * - * @param {array} - * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27768,11 +52750,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startClusterUpgradeWithHttpOperationResponse(startClusterUpgradeDescription, options) { + recoverPartitionWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { + self._recoverPartition(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -27783,137 +52765,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Start upgrading the code or configuration version of a Service - * Fabric cluster. - * - * Validate the supplied upgrade parameters and start upgrading the code or - * configuration version of a Service Fabric cluster if the parameters are - * valid. - * - * @param {object} startClusterUpgradeDescription Describes the parameters for - * starting a cluster upgrade. - * - * @param {string} [startClusterUpgradeDescription.codeVersion] The cluster - * code version. - * - * @param {string} [startClusterUpgradeDescription.configVersion] The cluster - * configuration version. - * - * @param {string} [startClusterUpgradeDescription.upgradeKind] Possible values - * include: 'Invalid', 'Rolling' - * - * @param {string} [startClusterUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {number} - * [startClusterUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * - * @param {boolean} [startClusterUpgradeDescription.forceRestart] - * - * @param {object} [startClusterUpgradeDescription.monitoringPolicy] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] - * - * @param {string} - * [startClusterUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * - * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] - * - * @param {boolean} - * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [startClusterUpgradeDescription.clusterHealthPolicy.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} - * [startClusterUpgradeDescription.clusterHealthPolicy.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 {array} - * [startClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * - * @param {boolean} - * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, - * enables delta health evaluation rather than absolute health evaluation after - * completion of each upgrade domain. - * - * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] - * - * @param {number} - * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. - * - * @param {number} - * [startClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover a specific partition that is currently stuck in quorum loss. * - * @param {object} [startClusterUpgradeDescription.applicationHealthPolicyMap] + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * - * @param {array} - * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -27939,7 +52805,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startClusterUpgrade(startClusterUpgradeDescription, options, optionalCallback) { + recoverPartition(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -27948,78 +52814,41 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { + self._recoverPartition(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startClusterUpgrade(startClusterUpgradeDescription, options, optionalCallback); + return self._recoverPartition(partitionId, options, optionalCallback); } } /** - * @summary Start upgrading the configuration of a Service Fabric standalone - * cluster. - * - * Validate the supplied configuration upgrade parameters and start upgrading - * the cluster configuration if the parameters are valid. - * - * @param {object} clusterConfigurationUpgradeDescription Parameters for a - * standalone cluster configuration upgrade. - * - * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The - * cluster configuration. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length - * of time between attempts to perform a health checks if the application or - * cluster is not healthy. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckWaitDurationInSeconds] - * The length of time to wait after completing an upgrade domain before - * starting the health checks process. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] - * The length of time that the application or cluster must remain healthy. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The - * timeout for the upgrade domain. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.upgradeTimeoutInSeconds] The upgrade - * timeout. - * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyApplications] The - * maximum allowed percentage of unhealthy applications during the upgrade. - * Allowed values are integer values from zero to 100. - * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyNodes] The - * maximum allowed percentage of unhealthy nodes during the upgrade. Allowed - * values are integer values from zero to 100. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover the specified service that is currently stuck in quorum loss. * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentDeltaUnhealthyNodes] The - * maximum allowed percentage of delta health degradation during the upgrade. - * Allowed values are integer values from zero to 100. + * Indicates to the Service Fabric cluster that it should attempt to recover + * the specified service that is currently stuck in quorum loss. This operation + * should only be performed if it is known that the replicas that are down + * cannot be recovered. Incorrect use of this API can cause potential data + * loss. * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentUpgradeDomainDeltaUnhealthyNodes] - * The maximum allowed percentage of upgrade domain delta health degradation - * during the upgrade. Allowed values are integer values from zero to 100. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28030,11 +52859,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startClusterConfigurationUpgradeWithHttpOperationResponse(clusterConfigurationUpgradeDescription, options) { + recoverServicePartitionsWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { + self._recoverServicePartitions(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -28045,66 +52874,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Start upgrading the configuration of a Service Fabric standalone - * cluster. - * - * Validate the supplied configuration upgrade parameters and start upgrading - * the cluster configuration if the parameters are valid. - * - * @param {object} clusterConfigurationUpgradeDescription Parameters for a - * standalone cluster configuration upgrade. - * - * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The - * cluster configuration. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length - * of time between attempts to perform a health checks if the application or - * cluster is not healthy. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckWaitDurationInSeconds] - * The length of time to wait after completing an upgrade domain before - * starting the health checks process. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] - * The length of time that the application or cluster must remain healthy. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The - * timeout for the upgrade domain. - * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.upgradeTimeoutInSeconds] The upgrade - * timeout. - * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyApplications] The - * maximum allowed percentage of unhealthy applications during the upgrade. - * Allowed values are integer values from zero to 100. - * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyNodes] The - * maximum allowed percentage of unhealthy nodes during the upgrade. Allowed - * values are integer values from zero to 100. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover the specified service that is currently stuck in quorum loss. * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentDeltaUnhealthyNodes] The - * maximum allowed percentage of delta health degradation during the upgrade. - * Allowed values are integer values from zero to 100. + * Indicates to the Service Fabric cluster that it should attempt to recover + * the specified service that is currently stuck in quorum loss. This operation + * should only be performed if it is known that the replicas that are down + * cannot be recovered. Incorrect use of this API can cause potential data + * loss. * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentUpgradeDomainDeltaUnhealthyNodes] - * The maximum allowed percentage of upgrade domain delta health degradation - * during the upgrade. Allowed values are integer values from zero to 100. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28130,7 +52922,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback) { + recoverServicePartitions(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -28139,140 +52931,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { + self._recoverServicePartitions(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback); - } - } - - /** - * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. - * - * Update the upgrade parameters of a Service Fabric cluster upgrade. - * - * @param {object} updateClusterUpgradeDescription Parameters for updating a - * cluster upgrade. - * - * @param {string} [updateClusterUpgradeDescription.upgradeKind] Possible - * values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart' - * - * @param {object} [updateClusterUpgradeDescription.updateDescription] - * - * @param {string} - * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {boolean} - * [updateClusterUpgradeDescription.updateDescription.forceRestart] - * - * @param {number} - * [updateClusterUpgradeDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] - * - * @param {object} [updateClusterUpgradeDescription.clusterHealthPolicy] - * - * @param {boolean} - * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [updateClusterUpgradeDescription.clusterHealthPolicy.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} - * [updateClusterUpgradeDescription.clusterHealthPolicy.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 {array} - * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * - * @param {boolean} - * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] - * - * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] - * - * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. - * - * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. - * - * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + return self._recoverServicePartitions(serviceId, options, optionalCallback); + } + } + + /** + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover the system services that are currently stuck in quorum loss. * - * @param {array} - * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * Indicates to the Service Fabric cluster that it should attempt to recover + * the system services that are currently stuck in quorum loss. This operation + * should only be performed if it is known that the replicas that are down + * cannot be recovered. Incorrect use of this API can cause potential data + * loss. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28283,11 +52968,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - updateClusterUpgradeWithHttpOperationResponse(updateClusterUpgradeDescription, options) { + recoverSystemPartitionsWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateClusterUpgrade(updateClusterUpgradeDescription, options, (err, result, request, response) => { + self._recoverSystemPartitions(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -28298,128 +52983,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. - * - * Update the upgrade parameters of a Service Fabric cluster upgrade. - * - * @param {object} updateClusterUpgradeDescription Parameters for updating a - * cluster upgrade. - * - * @param {string} [updateClusterUpgradeDescription.upgradeKind] Possible - * values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart' - * - * @param {object} [updateClusterUpgradeDescription.updateDescription] - * - * @param {string} - * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {boolean} - * [updateClusterUpgradeDescription.updateDescription.forceRestart] - * - * @param {number} - * [updateClusterUpgradeDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] - * - * @param {string} - * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] - * - * @param {object} [updateClusterUpgradeDescription.clusterHealthPolicy] - * - * @param {boolean} - * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [updateClusterUpgradeDescription.clusterHealthPolicy.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} - * [updateClusterUpgradeDescription.clusterHealthPolicy.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 {array} - * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] - * - * @param {boolean} - * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] - * - * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] - * - * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 10%. - * - * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.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. The default value is 15%. - * - * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover the system services that are currently stuck in quorum loss. * - * @param {array} - * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * Indicates to the Service Fabric cluster that it should attempt to recover + * the system services that are currently stuck in quorum loss. This operation + * should only be performed if it is known that the replicas that are down + * cannot be recovered. Incorrect use of this API can cause potential data + * loss. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28445,7 +53023,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateClusterUpgrade(updateClusterUpgradeDescription, options, optionalCallback) { + recoverSystemPartitions(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -28454,49 +53032,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateClusterUpgrade(updateClusterUpgradeDescription, options, (err, result, request, response) => { + self._recoverSystemPartitions(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateClusterUpgrade(updateClusterUpgradeDescription, options, optionalCallback); + return self._recoverSystemPartitions(options, optionalCallback); } } /** - * @summary Gets the Azure Active Directory metadata used for secured - * connection to cluster. - * - * Gets the Azure Active Directory metadata used for secured connection to - * cluster. - * This API is not supposed to be called separately. It provides information - * needed to set up an Azure Active Directory secured connection with a Service - * Fabric cluster. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover any services (including system services) which are currently stuck + * in quorum loss. * + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getAadMetadataWithHttpOperationResponse(options) { + recoverAllPartitionsWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getAadMetadata(options, (err, result, request, response) => { + self._recoverAllPartitions(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -28507,22 +53083,20 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the Azure Active Directory metadata used for secured - * connection to cluster. - * - * Gets the Azure Active Directory metadata used for secured connection to - * cluster. - * This API is not supposed to be called separately. It provides information - * needed to set up an Azure Active Directory secured connection with a Service - * Fabric cluster. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover any services (including system services) which are currently stuck + * in quorum loss. * + * This operation should only be performed if it is known that the replicas + * that are down cannot be recovered. Incorrect use of this API can cause + * potential data loss. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28534,7 +53108,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {AadMetadataObject} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -28542,14 +53116,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 AadMetadataObject} 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. */ - getAadMetadata(options, optionalCallback) { + recoverAllPartitions(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -28558,77 +53131,176 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAadMetadata(options, (err, result, request, response) => { + self._recoverAllPartitions(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getAadMetadata(options, optionalCallback); + return self._recoverAllPartitions(options, optionalCallback); } } /** - * @summary Gets the list of nodes in the Service Fabric cluster. + * @summary Creates a new repair task. * - * The Nodes endpoint returns information about the nodes in the Service Fabric - * Cluster. The respons include the name, status, id, health, uptime and other - * details about the node. + * For clusters that have the Repair Manager Service configured, + * this API provides a way to create repair tasks that run automatically or + * manually. + * For repair tasks that run automatically, an appropriate repair executor + * must be running for each repair action to run automatically. + * These are currently only available in specially-configured Azure Cloud + * Services. * - * @param {object} [options] Optional Parameters. + * To create a manual repair task, provide the set of impacted node names and + * the + * expected impact. When the state of the created repair task changes to + * approved, + * you can safely perform repair actions on those nodes. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {string} [options.nodeStatusFilter] Allows filtering the nodes based - * on the NodeStatus. Only the nodes that are matching the specified filter - * value will be returned. The filter value can be one of the following. + * @param {object} repairTask Describes the repair task to be created or + * updated. * - * - default - This filter value will match all of the nodes excepts the ones - * with with status as Unknown or Removed. - * - all - This filter value will match all of the nodes. - * - up - This filter value will match nodes that are Up. - * - down - This filter value will match nodes that are Down. - * - enabling - This filter value will match nodes that are in the process of - * being enabled with status as Enabling. - * - disabling - This filter value will match nodes that are in the process of - * being disabled with status as Disabling. - * - disabled - This filter value will match nodes that are Disabled. - * - unknown - This filter value will match nodes whose status is Unknown. A - * node would be in Unknown state if Service Fabric does not have authoritative - * information about that node. This can happen if the system learns about a - * node at runtime. - * - removed - This filter value will match nodes whose status is Removed. - * These are the nodes that are removed from the cluster using the - * RemoveNodeState API. - * . Possible values include: 'default', 'all', 'up', 'down', 'enabling', - * 'disabling', 'disabled', 'unknown', 'removed' + * @param {string} repairTask.taskId The ID of the repair task. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} [repairTask.version] The version of the repair task. + * When creating a new repair task, the version must be set to zero. When + * updating a repair task, + * the version is used for optimistic concurrency checks. If the version is + * set to zero, the update will not check for write conflicts. If the version + * is set to a non-zero value, then the + * update will only succeed if the actual current version of the repair task + * matches this value. + * + * @param {string} [repairTask.description] A description of the purpose of the + * repair task, or other informational details. + * May be set when the repair task is created, and is immutable once set. + * + * @param {string} repairTask.state The workflow state of the repair task. + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' + * + * @param {number} [repairTask.flags] A bitwise-OR of the following values, + * which gives additional details about the status of the repair task. + * - 1 - Cancellation of the repair has been requested + * - 2 - Abort of the repair has been requested + * - 4 - Approval of the repair was forced via client request + * + * @param {string} repairTask.action The requested repair action. Must be + * specified when the repair task is created, and is immutable once set. + * + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. + * + * @param {string} repairTask.target.kind Polymorphic Discriminator + * + * @param {string} [repairTask.executor] The name of the repair executor. Must + * be specified in Claimed and later states, and is immutable once set. + * + * @param {string} [repairTask.executorData] A data string that the repair + * executor can use to store its internal state. + * + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. + * + * @param {string} repairTask.impact.kind Polymorphic Discriminator + * + * @param {string} [repairTask.resultStatus] A value describing the overall + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' + * + * @param {number} [repairTask.resultCode] A numeric value providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {string} [repairTask.resultDetails] A string providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. + * + * @param {date} [repairTask.history.createdUtcTimestamp] The time when the + * repair task entered the Created state. + * + * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the + * repair task entered the Claimed state. + * + * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the + * repair task entered the Preparing state. + * + * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the + * repair task entered the Approved state + * + * @param {date} [repairTask.history.executingUtcTimestamp] The time when the + * repair task entered the Executing state + * + * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the + * repair task entered the Restoring state + * + * @param {date} [repairTask.history.completedUtcTimestamp] The time when the + * repair task entered the Completed state + * + * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Preparing state. + * + * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Preparing state. + * + * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Restoring state. + * + * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Restoring state. + * + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {boolean} [repairTask.performPreparingHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Preparing state. + * + * @param {boolean} [repairTask.performRestoringHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Restoring state. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getNodeInfoListWithHttpOperationResponse(options) { + createRepairTaskWithHttpOperationResponse(repairTask, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeInfoList(options, (err, result, request, response) => { + self._createRepairTask(repairTask, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -28639,50 +53311,149 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of nodes in the Service Fabric cluster. + * @summary Creates a new repair task. * - * The Nodes endpoint returns information about the nodes in the Service Fabric - * Cluster. The respons include the name, status, id, health, uptime and other - * details about the node. + * For clusters that have the Repair Manager Service configured, + * this API provides a way to create repair tasks that run automatically or + * manually. + * For repair tasks that run automatically, an appropriate repair executor + * must be running for each repair action to run automatically. + * These are currently only available in specially-configured Azure Cloud + * Services. * - * @param {object} [options] Optional Parameters. + * To create a manual repair task, provide the set of impacted node names and + * the + * expected impact. When the state of the created repair task changes to + * approved, + * you can safely perform repair actions on those nodes. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {string} [options.nodeStatusFilter] Allows filtering the nodes based - * on the NodeStatus. Only the nodes that are matching the specified filter - * value will be returned. The filter value can be one of the following. + * @param {object} repairTask Describes the repair task to be created or + * updated. * - * - default - This filter value will match all of the nodes excepts the ones - * with with status as Unknown or Removed. - * - all - This filter value will match all of the nodes. - * - up - This filter value will match nodes that are Up. - * - down - This filter value will match nodes that are Down. - * - enabling - This filter value will match nodes that are in the process of - * being enabled with status as Enabling. - * - disabling - This filter value will match nodes that are in the process of - * being disabled with status as Disabling. - * - disabled - This filter value will match nodes that are Disabled. - * - unknown - This filter value will match nodes whose status is Unknown. A - * node would be in Unknown state if Service Fabric does not have authoritative - * information about that node. This can happen if the system learns about a - * node at runtime. - * - removed - This filter value will match nodes whose status is Removed. - * These are the nodes that are removed from the cluster using the - * RemoveNodeState API. - * . Possible values include: 'default', 'all', 'up', 'down', 'enabling', - * 'disabling', 'disabled', 'unknown', 'removed' + * @param {string} repairTask.taskId The ID of the repair task. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} [repairTask.version] The version of the repair task. + * When creating a new repair task, the version must be set to zero. When + * updating a repair task, + * the version is used for optimistic concurrency checks. If the version is + * set to zero, the update will not check for write conflicts. If the version + * is set to a non-zero value, then the + * update will only succeed if the actual current version of the repair task + * matches this value. + * + * @param {string} [repairTask.description] A description of the purpose of the + * repair task, or other informational details. + * May be set when the repair task is created, and is immutable once set. + * + * @param {string} repairTask.state The workflow state of the repair task. + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' + * + * @param {number} [repairTask.flags] A bitwise-OR of the following values, + * which gives additional details about the status of the repair task. + * - 1 - Cancellation of the repair has been requested + * - 2 - Abort of the repair has been requested + * - 4 - Approval of the repair was forced via client request + * + * @param {string} repairTask.action The requested repair action. Must be + * specified when the repair task is created, and is immutable once set. + * + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. + * + * @param {string} repairTask.target.kind Polymorphic Discriminator + * + * @param {string} [repairTask.executor] The name of the repair executor. Must + * be specified in Claimed and later states, and is immutable once set. + * + * @param {string} [repairTask.executorData] A data string that the repair + * executor can use to store its internal state. + * + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. + * + * @param {string} repairTask.impact.kind Polymorphic Discriminator + * + * @param {string} [repairTask.resultStatus] A value describing the overall + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' + * + * @param {number} [repairTask.resultCode] A numeric value providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {string} [repairTask.resultDetails] A string providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. + * + * @param {date} [repairTask.history.createdUtcTimestamp] The time when the + * repair task entered the Created state. + * + * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the + * repair task entered the Claimed state. + * + * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the + * repair task entered the Preparing state. + * + * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the + * repair task entered the Approved state + * + * @param {date} [repairTask.history.executingUtcTimestamp] The time when the + * repair task entered the Executing state + * + * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the + * repair task entered the Restoring state + * + * @param {date} [repairTask.history.completedUtcTimestamp] The time when the + * repair task entered the Completed state + * + * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Preparing state. + * + * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Preparing state. + * + * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Restoring state. + * + * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Restoring state. + * + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {boolean} [repairTask.performPreparingHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Preparing state. + * + * @param {boolean} [repairTask.performRestoringHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Restoring state. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28694,7 +53465,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedNodeInfoList} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -28703,13 +53474,13 @@ class ServiceFabricClient extends ServiceClient { * {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 PagedNodeInfoList} for more information. + * See {@link RepairTaskUpdateInfo} 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. */ - getNodeInfoList(options, optionalCallback) { + createRepairTask(repairTask, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -28718,47 +53489,55 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeInfoList(options, (err, result, request, response) => { + self._createRepairTask(repairTask, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeInfoList(options, optionalCallback); + return self._createRepairTask(repairTask, options, optionalCallback); } } /** - * @summary Gets the list of nodes in the Service Fabric cluster. + * @summary Requests the cancellation of the given repair task. * - * Gets the information about a specific node in the Service Fabric Cluster.The - * respons include the name, status, id, health, uptime and other details about - * the node. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {string} nodeName The name of the node. + * @param {object} repairTaskCancelDescription Describes the repair task to be + * cancelled. * - * @param {object} [options] Optional Parameters. + * @param {string} repairTaskCancelDescription.taskId The ID of the repair + * task. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} [repairTaskCancelDescription.version] The current version + * number of the repair task. If non-zero, then the request will only succeed + * if this value matches the actual current version of the repair task. If + * zero, then no version check is performed. + * + * @param {boolean} [repairTaskCancelDescription.requestAbort] _True_ if the + * repair should be stopped as soon as possible even if it has already started + * executing. _False_ if the repair should be cancelled only if execution has + * not yet started. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getNodeInfoWithHttpOperationResponse(nodeName, options) { + cancelRepairTaskWithHttpOperationResponse(repairTaskCancelDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeInfo(nodeName, options, (err, result, request, response) => { + self._cancelRepairTask(repairTaskCancelDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -28769,20 +53548,28 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of nodes in the Service Fabric cluster. + * @summary Requests the cancellation of the given repair task. * - * Gets the information about a specific node in the Service Fabric Cluster.The - * respons include the name, status, id, health, uptime and other details about - * the node. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {string} nodeName The name of the node. + * @param {object} repairTaskCancelDescription Describes the repair task to be + * cancelled. * - * @param {object} [options] Optional Parameters. + * @param {string} repairTaskCancelDescription.taskId The ID of the repair + * task. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} [repairTaskCancelDescription.version] The current version + * number of the repair task. If non-zero, then the request will only succeed + * if this value matches the actual current version of the repair task. If + * zero, then no version check is performed. + * + * @param {boolean} [repairTaskCancelDescription.requestAbort] _True_ if the + * repair should be stopped as soon as possible even if it has already started + * executing. _False_ if the repair should be cancelled only if execution has + * not yet started. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28794,7 +53581,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {NodeInfo} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -28803,13 +53590,13 @@ class ServiceFabricClient extends ServiceClient { * {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 NodeInfo} for more information. + * See {@link RepairTaskUpdateInfo} 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. */ - getNodeInfo(nodeName, options, optionalCallback) { + cancelRepairTask(repairTaskCancelDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -28818,72 +53605,50 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeInfo(nodeName, options, (err, result, request, response) => { + self._cancelRepairTask(repairTaskCancelDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeInfo(nodeName, options, optionalCallback); + return self._cancelRepairTask(repairTaskCancelDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric node. - * - * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to - * filter the collection of health events reported on the node based on the - * health state. If the node that you specify by name does not exist in the - * health store, this returns an error. - * - * @param {string} nodeName The name of the node. - * - * @param {object} [options] Optional Parameters. + * @summary Deletes a completed repair task. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {object} repairTaskDeleteDescription Describes the repair task to be + * deleted. + * + * @param {string} repairTaskDeleteDescription.taskId The ID of the completed + * repair task to be deleted. * + * @param {string} [repairTaskDeleteDescription.version] The current version + * number of the repair task. If non-zero, then the request will only succeed + * if this value matches the actual current version of the repair task. If + * zero, then no version check is performed. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getNodeHealthWithHttpOperationResponse(nodeName, options) { + deleteRepairTaskWithHttpOperationResponse(repairTaskDeleteDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeHealth(nodeName, options, (err, result, request, response) => { + self._deleteRepairTask(repairTaskDeleteDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -28894,45 +53659,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric node. - * - * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to - * filter the collection of health events reported on the node based on the - * health state. If the node that you specify by name does not exist in the - * health store, this returns an error. - * - * @param {string} nodeName The name of the node. + * @summary Deletes a completed repair task. * - * @param {object} [options] Optional Parameters. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {object} repairTaskDeleteDescription Describes the repair task to be + * deleted. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} repairTaskDeleteDescription.taskId The ID of the completed + * repair task to be deleted. * + * @param {string} [repairTaskDeleteDescription.version] The current version + * number of the repair task. If non-zero, then the request will only succeed + * if this value matches the actual current version of the repair task. If + * zero, then no version check is performed. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -28944,7 +53687,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {NodeHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -28952,14 +53695,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 NodeHealth} 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. */ - getNodeHealth(nodeName, options, optionalCallback) { + deleteRepairTask(repairTaskDeleteDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -28968,119 +53710,56 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeHealth(nodeName, options, (err, result, request, response) => { + self._deleteRepairTask(repairTaskDeleteDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeHealth(nodeName, options, optionalCallback); + return self._deleteRepairTask(repairTaskDeleteDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric node, by using the specified - * health policy. - * - * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to - * filter the collection of health events reported on the node based on the - * health state. Use ClusterHealthPolicy in the POST body to override the - * health policies used to evaluate the health. If the node that you specify by - * name does not exist in the health store, this returns an error. + * @summary Gets a list of repair tasks matching the given filters. * - * @param {string} nodeName The name of the node. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.clusterHealthPolicy] Describes the health policies - * used to evaluate the health of a cluster or node. If not present, the health - * evaluation uses the health policy from cluster manifest or the default - * health policy. - * - * @param {boolean} [options.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} [options.clusterHealthPolicy.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} - * [options.clusterHealthPolicy.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} [options.taskIdFilter] The repair task ID prefix to be + * matched. * + * @param {number} [options.stateFilter] A bitwise-OR of the following values, + * specifying which task states should be included in the result list. * - * @param {array} [options.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * - 1 - Created + * - 2 - Claimed + * - 4 - Preparing + * - 8 - Approved + * - 16 - Executing + * - 32 - Restoring + * - 64 - Completed * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} [options.executorFilter] The name of the repair executor + * whose claimed tasks should be included in the list. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getNodeHealthUsingPolicyWithHttpOperationResponse(nodeName, options) { + getRepairTaskListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeHealthUsingPolicy(nodeName, options, (err, result, request, response) => { + self._getRepairTaskList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -29091,92 +53770,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric node, by using the specified - * health policy. - * - * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to - * filter the collection of health events reported on the node based on the - * health state. Use ClusterHealthPolicy in the POST body to override the - * health policies used to evaluate the health. If the node that you specify by - * name does not exist in the health store, this returns an error. + * @summary Gets a list of repair tasks matching the given filters. * - * @param {string} nodeName The name of the node. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.clusterHealthPolicy] Describes the health policies - * used to evaluate the health of a cluster or node. If not present, the health - * evaluation uses the health policy from cluster manifest or the default - * health policy. - * - * @param {boolean} [options.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} [options.clusterHealthPolicy.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} - * [options.clusterHealthPolicy.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} [options.taskIdFilter] The repair task ID prefix to be + * matched. * + * @param {number} [options.stateFilter] A bitwise-OR of the following values, + * specifying which task states should be included in the result list. * - * @param {array} [options.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * - 1 - Created + * - 2 - Claimed + * - 4 - Preparing + * - 8 - Approved + * - 16 - Executing + * - 32 - Restoring + * - 64 - Completed * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} [options.executorFilter] The name of the repair executor + * whose claimed tasks should be included in the list. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -29188,7 +53804,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {NodeHealth} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -29196,14 +53812,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 NodeHealth} for more information. + * {array} [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. */ - getNodeHealthUsingPolicy(nodeName, options, optionalCallback) { + getRepairTaskList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -29212,150 +53827,50 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeHealthUsingPolicy(nodeName, options, (err, result, request, response) => { + self._getRepairTaskList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeHealthUsingPolicy(nodeName, options, optionalCallback); + return self._getRepairTaskList(options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric node. - * - * Reports health state of the specified Service Fabric node. The report must - * contain the information about the source of the health report and property - * on which it is reported. - * The report is sent to a Service Fabric gateway node, which forwards to the - * health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run GetNodeHealth - * and check that the report appears in the HealthEvents section. - * - * - * @param {string} nodeName The name of the node. - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. - * - * If not specified, time to live defaults to infinite value. - * - * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. - * + * @summary Forces the approval of the given repair task. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * + * @param {object} repairTaskApproveDescription Describes the repair task to be + * approved. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {string} repairTaskApproveDescription.taskId The ID of the repair + * task. * + * @param {string} [repairTaskApproveDescription.version] The current version + * number of the repair task. If non-zero, then the request will only succeed + * if this value matches the actual current version of the repair task. If + * zero, then no version check is performed. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - reportNodeHealthWithHttpOperationResponse(nodeName, healthInformation, options) { + forceApproveRepairTaskWithHttpOperationResponse(repairTaskApproveDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { + self._forceApproveRepairTask(repairTaskApproveDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -29366,124 +53881,24 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric node. - * - * Reports health state of the specified Service Fabric node. The report must - * contain the information about the source of the health report and property - * on which it is reported. - * The report is sent to a Service Fabric gateway node, which forwards to the - * health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run GetNodeHealth - * and check that the report appears in the HealthEvents section. - * - * - * @param {string} nodeName The name of the node. - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. - * - * If not specified, time to live defaults to infinite value. - * - * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. - * + * @summary Forces the approval of the given repair task. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * + * @param {object} repairTaskApproveDescription Describes the repair task to be + * approved. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {string} repairTaskApproveDescription.taskId The ID of the repair + * task. * + * @param {string} [repairTaskApproveDescription.version] The current version + * number of the repair task. If non-zero, then the request will only succeed + * if this value matches the actual current version of the repair task. If + * zero, then no version check is performed. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -29494,7 +53909,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -29502,13 +53917,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RepairTaskUpdateInfo} 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. */ - reportNodeHealth(nodeName, healthInformation, options, optionalCallback) { + forceApproveRepairTask(repairTaskApproveDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -29517,45 +53933,62 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { + self._forceApproveRepairTask(repairTaskApproveDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportNodeHealth(nodeName, healthInformation, options, optionalCallback); + return self._forceApproveRepairTask(repairTaskApproveDescription, options, optionalCallback); } } /** - * @summary Gets the load information of a Service Fabric node. + * @summary Updates the health policy of the given repair task. + * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @param {object} repairTaskUpdateHealthPolicyDescription Describes the repair + * task healthy policy to be updated. * - * Gets the load information of a Service Fabric node. + * @param {string} repairTaskUpdateHealthPolicyDescription.taskId The ID of the + * repair task to be updated. * - * @param {string} nodeName The name of the node. + * @param {string} [repairTaskUpdateHealthPolicyDescription.version] The + * current version number of the repair task. If non-zero, then the request + * will only succeed if this value matches the actual current value of the + * repair task. If zero, then no version check is performed. * - * @param {object} [options] Optional Parameters. + * @param {boolean} + * [repairTaskUpdateHealthPolicyDescription.performPreparingHealthCheck] A + * boolean indicating if health check is to be performed in the Preparing stage + * of the repair task. If not specified the existing value should not be + * altered. Otherwise, specify the desired new value. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {boolean} + * [repairTaskUpdateHealthPolicyDescription.performRestoringHealthCheck] A + * boolean indicating if health check is to be performed in the Restoring stage + * of the repair task. If not specified the existing value should not be + * altered. Otherwise, specify the desired new value. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getNodeLoadInfoWithHttpOperationResponse(nodeName, options) { + updateRepairTaskHealthPolicyWithHttpOperationResponse(repairTaskUpdateHealthPolicyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeLoadInfo(nodeName, options, (err, result, request, response) => { + self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -29566,18 +53999,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the load information of a Service Fabric node. + * @summary Updates the health policy of the given repair task. + * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * Gets the load information of a Service Fabric node. + * @param {object} repairTaskUpdateHealthPolicyDescription Describes the repair + * task healthy policy to be updated. * - * @param {string} nodeName The name of the node. + * @param {string} repairTaskUpdateHealthPolicyDescription.taskId The ID of the + * repair task to be updated. * - * @param {object} [options] Optional Parameters. + * @param {string} [repairTaskUpdateHealthPolicyDescription.version] The + * current version number of the repair task. If non-zero, then the request + * will only succeed if this value matches the actual current value of the + * repair task. If zero, then no version check is performed. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {boolean} + * [repairTaskUpdateHealthPolicyDescription.performPreparingHealthCheck] A + * boolean indicating if health check is to be performed in the Preparing stage + * of the repair task. If not specified the existing value should not be + * altered. Otherwise, specify the desired new value. + * + * @param {boolean} + * [repairTaskUpdateHealthPolicyDescription.performRestoringHealthCheck] A + * boolean indicating if health check is to be performed in the Restoring stage + * of the repair task. If not specified the existing value should not be + * altered. Otherwise, specify the desired new value. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -29589,7 +54039,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {NodeLoadInfo} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -29598,13 +54048,13 @@ class ServiceFabricClient extends ServiceClient { * {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 NodeLoadInfo} for more information. + * See {@link RepairTaskUpdateInfo} 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. */ - getNodeLoadInfo(nodeName, options, optionalCallback) { + updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -29613,67 +54063,162 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeLoadInfo(nodeName, options, (err, result, request, response) => { + self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeLoadInfo(nodeName, options, optionalCallback); + return self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, optionalCallback); } } /** - * @summary Deactivate a Service Fabric cluster node with the specified - * deactivation intent. + * @summary Updates the execution state of a repair task. * - * Deactivate a Service Fabric cluster node with the specified deactivation - * intent. Once the deactivation is in progress, the deactivation intent can be - * increased, but not decreased (for example, a node which is was deactivated - * with the Pause intent can be deactivated further with Restart, but not the - * other way around. Nodes may be reactivated using the Activate a node - * operation any time after they are deactivated. If the deactivation is not - * complete this will cancel the deactivation. A node which goes down and comes - * back up while deactivated will still need to be reactivated before services - * will be placed on that node. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {string} nodeName The name of the node. + * @param {object} repairTask Describes the repair task to be created or + * updated. * - * @param {object} deactivationIntentDescription Describes the intent or reason - * for deactivating the node. + * @param {string} repairTask.taskId The ID of the repair task. * - * @param {string} [deactivationIntentDescription.deactivationIntent] Describes - * the intent or reason for deactivating the node. The possible values are - * following. - * - Pause - Indicates that the node should be paused. The value is 1. - * - Restart - Indicates that the intent is for the node to be restarted after - * a short period of time. The value is 2. - * - RemoveData - Indicates the intent is for the node to remove data. The - * value is 3. - * . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @param {string} [repairTask.version] The version of the repair task. + * When creating a new repair task, the version must be set to zero. When + * updating a repair task, + * the version is used for optimistic concurrency checks. If the version is + * set to zero, the update will not check for write conflicts. If the version + * is set to a non-zero value, then the + * update will only succeed if the actual current version of the repair task + * matches this value. * - * @param {object} [options] Optional Parameters. + * @param {string} [repairTask.description] A description of the purpose of the + * repair task, or other informational details. + * May be set when the repair task is created, and is immutable once set. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} repairTask.state The workflow state of the repair task. + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' + * + * @param {number} [repairTask.flags] A bitwise-OR of the following values, + * which gives additional details about the status of the repair task. + * - 1 - Cancellation of the repair has been requested + * - 2 - Abort of the repair has been requested + * - 4 - Approval of the repair was forced via client request + * + * @param {string} repairTask.action The requested repair action. Must be + * specified when the repair task is created, and is immutable once set. + * + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. + * + * @param {string} repairTask.target.kind Polymorphic Discriminator + * + * @param {string} [repairTask.executor] The name of the repair executor. Must + * be specified in Claimed and later states, and is immutable once set. + * + * @param {string} [repairTask.executorData] A data string that the repair + * executor can use to store its internal state. + * + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. + * + * @param {string} repairTask.impact.kind Polymorphic Discriminator + * + * @param {string} [repairTask.resultStatus] A value describing the overall + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' + * + * @param {number} [repairTask.resultCode] A numeric value providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {string} [repairTask.resultDetails] A string providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. + * + * @param {date} [repairTask.history.createdUtcTimestamp] The time when the + * repair task entered the Created state. + * + * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the + * repair task entered the Claimed state. + * + * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the + * repair task entered the Preparing state. + * + * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the + * repair task entered the Approved state + * + * @param {date} [repairTask.history.executingUtcTimestamp] The time when the + * repair task entered the Executing state + * + * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the + * repair task entered the Restoring state + * + * @param {date} [repairTask.history.completedUtcTimestamp] The time when the + * repair task entered the Completed state + * + * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Preparing state. + * + * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Preparing state. + * + * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Restoring state. + * + * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Restoring state. + * + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {boolean} [repairTask.performPreparingHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Preparing state. + * + * @param {boolean} [repairTask.performRestoringHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Restoring state. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - disableNodeWithHttpOperationResponse(nodeName, deactivationIntentDescription, options) { + updateRepairExecutionStateWithHttpOperationResponse(repairTask, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { + self._updateRepairExecutionState(repairTask, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -29684,40 +54229,135 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deactivate a Service Fabric cluster node with the specified - * deactivation intent. + * @summary Updates the execution state of a repair task. * - * Deactivate a Service Fabric cluster node with the specified deactivation - * intent. Once the deactivation is in progress, the deactivation intent can be - * increased, but not decreased (for example, a node which is was deactivated - * with the Pause intent can be deactivated further with Restart, but not the - * other way around. Nodes may be reactivated using the Activate a node - * operation any time after they are deactivated. If the deactivation is not - * complete this will cancel the deactivation. A node which goes down and comes - * back up while deactivated will still need to be reactivated before services - * will be placed on that node. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {string} nodeName The name of the node. + * @param {object} repairTask Describes the repair task to be created or + * updated. * - * @param {object} deactivationIntentDescription Describes the intent or reason - * for deactivating the node. + * @param {string} repairTask.taskId The ID of the repair task. * - * @param {string} [deactivationIntentDescription.deactivationIntent] Describes - * the intent or reason for deactivating the node. The possible values are - * following. - * - Pause - Indicates that the node should be paused. The value is 1. - * - Restart - Indicates that the intent is for the node to be restarted after - * a short period of time. The value is 2. - * - RemoveData - Indicates the intent is for the node to remove data. The - * value is 3. - * . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @param {string} [repairTask.version] The version of the repair task. + * When creating a new repair task, the version must be set to zero. When + * updating a repair task, + * the version is used for optimistic concurrency checks. If the version is + * set to zero, the update will not check for write conflicts. If the version + * is set to a non-zero value, then the + * update will only succeed if the actual current version of the repair task + * matches this value. * - * @param {object} [options] Optional Parameters. + * @param {string} [repairTask.description] A description of the purpose of the + * repair task, or other informational details. + * May be set when the repair task is created, and is immutable once set. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} repairTask.state The workflow state of the repair task. + * Valid initial states are Created, Claimed, and Preparing. Possible values + * include: 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', + * 'Executing', 'Restoring', 'Completed' + * + * @param {number} [repairTask.flags] A bitwise-OR of the following values, + * which gives additional details about the status of the repair task. + * - 1 - Cancellation of the repair has been requested + * - 2 - Abort of the repair has been requested + * - 4 - Approval of the repair was forced via client request + * + * @param {string} repairTask.action The requested repair action. Must be + * specified when the repair task is created, and is immutable once set. + * + * @param {object} [repairTask.target] The target object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * May be set when the repair task is created, and is immutable once set. + * + * @param {string} repairTask.target.kind Polymorphic Discriminator + * + * @param {string} [repairTask.executor] The name of the repair executor. Must + * be specified in Claimed and later states, and is immutable once set. + * + * @param {string} [repairTask.executorData] A data string that the repair + * executor can use to store its internal state. + * + * @param {object} [repairTask.impact] The impact object determines what + * actions the system will take to prepare for the impact of the repair, prior + * to approving execution of the repair. + * Impact must be specified by the repair executor when transitioning to the + * Preparing state, and is immutable once set. + * + * @param {string} repairTask.impact.kind Polymorphic Discriminator + * + * @param {string} [repairTask.resultStatus] A value describing the overall + * result of the repair task execution. Must be specified in the Restoring and + * later states, and is immutable once set. Possible values include: 'Invalid', + * 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending' + * + * @param {number} [repairTask.resultCode] A numeric value providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {string} [repairTask.resultDetails] A string providing additional + * details about the result of the repair task execution. + * May be specified in the Restoring and later states, and is immutable once + * set. + * + * @param {object} [repairTask.history] An object that contains timestamps of + * the repair task's state transitions. + * These timestamps are updated by the system, and cannot be directly modified. + * + * @param {date} [repairTask.history.createdUtcTimestamp] The time when the + * repair task entered the Created state. + * + * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the + * repair task entered the Claimed state. + * + * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the + * repair task entered the Preparing state. + * + * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the + * repair task entered the Approved state + * + * @param {date} [repairTask.history.executingUtcTimestamp] The time when the + * repair task entered the Executing state + * + * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the + * repair task entered the Restoring state + * + * @param {date} [repairTask.history.completedUtcTimestamp] The time when the + * repair task entered the Completed state + * + * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Preparing state. + * + * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Preparing state. + * + * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The + * time when the repair task started the health check in the Restoring state. + * + * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The + * time when the repair task completed the health check in the Restoring state. + * + * @param {string} [repairTask.preparingHealthCheckState] The workflow state of + * the health check when the repair task is in the Preparing state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {string} [repairTask.restoringHealthCheckState] The workflow state of + * the health check when the repair task is in the Restoring state. Possible + * values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', + * 'TimedOut' + * + * @param {boolean} [repairTask.performPreparingHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Preparing state. + * + * @param {boolean} [repairTask.performRestoringHealthCheck] A value to + * determine if health checks will be performed when the repair task enters the + * Restoring state. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -29729,7 +54369,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -29737,13 +54377,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RepairTaskUpdateInfo} 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. */ - disableNode(nodeName, deactivationIntentDescription, options, optionalCallback) { + updateRepairExecutionState(repairTask, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -29752,49 +54393,56 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { + self._updateRepairExecutionState(repairTask, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._disableNode(nodeName, deactivationIntentDescription, options, optionalCallback); + return self._updateRepairExecutionState(repairTask, options, optionalCallback); } } /** - * @summary Activate a Service Fabric cluster node which is currently - * deactivated. + * @summary Gets the information about replicas of a Service Fabric service + * partition. * - * Activates a Service Fabric cluster node which is currently deactivated. Once - * activated, the node will again become a viable target for placing new - * replicas, and any deactivated replicas remaining on the node will be - * reactivated. + * The GetReplicas endpoint returns information about the replicas of the + * specified partition. The response includes the ID, role, status, health, + * node name, uptime, and other details about the replica. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - enableNodeWithHttpOperationResponse(nodeName, options) { + getReplicaInfoListWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._enableNode(nodeName, options, (err, result, request, response) => { + self._getReplicaInfoList(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -29805,22 +54453,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Activate a Service Fabric cluster node which is currently - * deactivated. + * @summary Gets the information about replicas of a Service Fabric service + * partition. * - * Activates a Service Fabric cluster node which is currently deactivated. Once - * activated, the node will again become a viable target for placing new - * replicas, and any deactivated replicas remaining on the node will be - * reactivated. + * The GetReplicas endpoint returns information about the replicas of the + * specified partition. The response includes the ID, role, status, health, + * node name, uptime, and other details about the replica. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -29832,7 +54487,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedReplicaInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -29840,13 +54495,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedReplicaInfoList} 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. */ - enableNode(nodeName, options, optionalCallback) { + getReplicaInfoList(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -29855,54 +54511,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._enableNode(nodeName, options, (err, result, request, response) => { + self._getReplicaInfoList(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._enableNode(nodeName, options, optionalCallback); + return self._getReplicaInfoList(partitionId, options, optionalCallback); } } /** - * @summary Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. + * @summary Gets the information about a replica of a Service Fabric partition. * - * Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. This implies that it is not possible to - * recover the persisted state of that node. This generally happens if a hard - * disk has been wiped clean, or if a hard disk crashes. The node has to be - * down for this operation to be successful. This operation lets Service Fabric - * know that the replicas on that node no longer exist, and that Service Fabric - * should stop waiting for those replicas to come back up. Do not run this - * cmdlet if the state on the node has not been removed and the node can comes - * back up with its state intact. + * The response includes the ID, role, status, health, node name, uptime, and + * other details about the replica. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - removeNodeStateWithHttpOperationResponse(nodeName, options) { + getReplicaInfoWithHttpOperationResponse(partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._removeNodeState(nodeName, options, (err, result, request, response) => { + self._getReplicaInfo(partitionId, replicaId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -29913,27 +54563,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. + * @summary Gets the information about a replica of a Service Fabric partition. * - * Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. This implies that it is not possible to - * recover the persisted state of that node. This generally happens if a hard - * disk has been wiped clean, or if a hard disk crashes. The node has to be - * down for this operation to be successful. This operation lets Service Fabric - * know that the replicas on that node no longer exist, and that Service Fabric - * should stop waiting for those replicas to come back up. Do not run this - * cmdlet if the state on the node has not been removed and the node can comes - * back up with its state intact. + * The response includes the ID, role, status, health, node name, uptime, and + * other details about the replica. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -29945,7 +54589,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ReplicaInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -29953,13 +54597,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ReplicaInfo} 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. */ - removeNodeState(nodeName, options, optionalCallback) { + getReplicaInfo(partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -29968,57 +54613,73 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._removeNodeState(nodeName, options, (err, result, request, response) => { + self._getReplicaInfo(partitionId, replicaId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._removeNodeState(nodeName, options, optionalCallback); + return self._getReplicaInfo(partitionId, replicaId, options, optionalCallback); } } /** - * @summary Restarts a Service Fabric cluster node. + * @summary Gets the health of a Service Fabric stateful service replica or + * stateless service instance. * - * Restarts a Service Fabric cluster node that is already started. + * Gets the health of a Service Fabric replica. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the replica based on the health state. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} restartNodeDescription The instance of the node to be - * restarted and a flag indicating the need to take dump of the fabric process. + * @param {string} replicaId The identifier of the replica. * - * @param {string} restartNodeDescription.nodeInstanceId The instance id of the - * target node. If instance id is specified the node is restarted only if it - * matches with the current instance of the node. A default value of "0" would - * match any instance id. The instance id can be obtained using get node query. + * @param {object} [options] Optional Parameters. * - * @param {string} [restartNodeDescription.createFabricDump] Specify True to - * create a dump of the fabric node process. This is case sensitive. Possible - * values include: 'False', 'True' + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. * - * @param {object} [options] Optional Parameters. + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - restartNodeWithHttpOperationResponse(nodeName, restartNodeDescription, options) { + getReplicaHealthWithHttpOperationResponse(partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { + self._getReplicaHealth(partitionId, replicaId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30029,30 +54690,46 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Restarts a Service Fabric cluster node. + * @summary Gets the health of a Service Fabric stateful service replica or + * stateless service instance. * - * Restarts a Service Fabric cluster node that is already started. + * Gets the health of a Service Fabric replica. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the replica based on the health state. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} restartNodeDescription The instance of the node to be - * restarted and a flag indicating the need to take dump of the fabric process. + * @param {string} replicaId The identifier of the replica. * - * @param {string} restartNodeDescription.nodeInstanceId The instance id of the - * target node. If instance id is specified the node is restarted only if it - * matches with the current instance of the node. A default value of "0" would - * match any instance id. The instance id can be obtained using get node query. + * @param {object} [options] Optional Parameters. * - * @param {string} [restartNodeDescription.createFabricDump] Specify True to - * create a dump of the fabric node process. This is case sensitive. Possible - * values include: 'False', 'True' + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. * - * @param {object} [options] Optional Parameters. + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30064,7 +54741,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ReplicaHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30072,13 +54749,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ReplicaHealth} 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. */ - restartNode(nodeName, restartNodeDescription, options, optionalCallback) { + getReplicaHealth(partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30087,86 +54765,151 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { + self._getReplicaHealth(partitionId, replicaId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restartNode(nodeName, restartNodeDescription, options, optionalCallback); + return self._getReplicaHealth(partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the list of application types in the Service Fabric cluster. + * @summary Gets the health of a Service Fabric stateful service replica or + * stateless service instance using the specified policy. + * + * Gets the health of a Service Fabric stateful service replica or stateless + * service instance. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the cluster based on the health state. + * Use ApplicationHealthPolicy to optionally override the health policies used + * to evaluate the health. This API only uses 'ConsiderWarningAsError' field of + * the ApplicationHealthPolicy. The rest of the fields are ignored while + * evaluating the health of the replica. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. + * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. + * + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * Returns the information about the application types that are provisioned or - * in the process of being provisioned in the Service Fabric cluster. Each - * version of an application type is returned as one application type. The - * response includes the name, version, status and other details about the - * application type. This is a paged query, meaning that if not all of the - * application types fit in a page, one page of results is returned as well as - * a continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * @param {number} + * [options.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} [options] Optional Parameters. + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * - * @param {number} [options.applicationTypeDefinitionKindFilter] Used to filter - * on ApplicationTypeDefinitionKind for application type query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationTypeDefinitionKind value. The value is 0. - * - All - Filter that matches input with any ApplicationTypeDefinitionKind - * value. The value is 65535. - * - ServiceFabricApplicationPackage - Filter that matches input with - * ApplicationTypeDefinitionKind value ServiceFabricApplicationPackage. The - * value is 1. - * - Compose - Filter that matches input with ApplicationTypeDefinitionKind - * value Compose. The value is 2. + * @param {number} + * [options.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 {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * 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 {number} [options.maxResults] The maximum number of results to be - * returned as part of the paged queries. This parameter defines the upper - * bound on the number of results returned. The results returned can be less - * than the specified maximum results if they do not fit in the message as per - * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationTypeInfoListWithHttpOperationResponse(options) { + getReplicaHealthUsingPolicyWithHttpOperationResponse(partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationTypeInfoList(options, (err, result, request, response) => { + self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30177,59 +54920,124 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of application types in the Service Fabric cluster. + * @summary Gets the health of a Service Fabric stateful service replica or + * stateless service instance using the specified policy. * - * Returns the information about the application types that are provisioned or - * in the process of being provisioned in the Service Fabric cluster. Each - * version of an application type is returned as one application type. The - * response includes the name, version, status and other details about the - * application type. This is a paged query, meaning that if not all of the - * application types fit in a page, one page of results is returned as well as - * a continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * Gets the health of a Service Fabric stateful service replica or stateless + * service instance. + * Use EventsHealthStateFilter to filter the collection of health events + * reported on the cluster based on the health state. + * Use ApplicationHealthPolicy to optionally override the health policies used + * to evaluate the health. This API only uses 'ConsiderWarningAsError' field of + * the ApplicationHealthPolicy. The rest of the fields are ignored while + * evaluating the health of the replica. + * + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.applicationTypeDefinitionKindFilter] Used to filter - * on ApplicationTypeDefinitionKind for application type query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationTypeDefinitionKind value. The value is 0. - * - All - Filter that matches input with any ApplicationTypeDefinitionKind - * value. The value is 65535. - * - ServiceFabricApplicationPackage - Filter that matches input with - * ApplicationTypeDefinitionKind value ServiceFabricApplicationPackage. The - * value is 1. - * - Compose - Filter that matches input with ApplicationTypeDefinitionKind - * value Compose. The value is 2. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {number} + * [options.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 {number} [options.maxResults] The maximum number of results to be - * returned as part of the paged queries. This parameter defines the upper - * bound on the number of results returned. The results returned can be less - * than the specified maximum results if they do not fit in the message as per - * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.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. + * + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30241,7 +55049,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedApplicationTypeInfoList} - The deserialized result object. + * @resolve {ReplicaHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30250,14 +55058,13 @@ class ServiceFabricClient extends ServiceClient { * {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 PagedApplicationTypeInfoList} for more - * information. + * See {@link ReplicaHealth} 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. */ - getApplicationTypeInfoList(options, optionalCallback) { + getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30266,79 +55073,151 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationTypeInfoList(options, (err, result, request, response) => { + self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationTypeInfoList(options, optionalCallback); + return self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the list of application types in the Service Fabric cluster - * matching exactly the specified name. + * @summary Sends a health report on the Service Fabric replica. * - * Returns the information about the application types that are provisioned or - * in the process of being provisioned in the Service Fabric cluster. These - * results are of application types whose name match exactly the one specified - * as the parameter, and which comply with the given query parameters. All - * versions of the application type matching the application type name are - * returned, with each version returned as one application type. The response - * includes the name, version, status and other details about the application - * type. This is a paged query, meaning that if not all of the application - * types fit in a page, one page of results is returned as well as a - * continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * Reports health state of the specified Service Fabric replica. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Replica, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run + * GetReplicaHealth and check that the report appears in the HealthEvents + * section. * - * @param {string} applicationTypeName The name of the application type. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} [options] Optional Parameters. + * @param {string} replicaId The identifier of the replica. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {string} replicaHealthReportServiceKind The kind of service replica + * (Stateless or Stateful) for which the health is being reported. Following + * are the possible values. Possible values include: 'Stateless', 'Stateful' * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. * - * @param {number} [options.maxResults] The maximum number of results to be - * returned as part of the paged queries. This parameter defines the upper - * bound on the number of results returned. The results returned can be less - * than the specified maximum results if they do not fit in the message as per - * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationTypeInfoListByNameWithHttpOperationResponse(applicationTypeName, options) { + reportReplicaHealthWithHttpOperationResponse(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationTypeInfoListByName(applicationTypeName, options, (err, result, request, response) => { + self._reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30349,52 +55228,124 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of application types in the Service Fabric cluster - * matching exactly the specified name. + * @summary Sends a health report on the Service Fabric replica. * - * Returns the information about the application types that are provisioned or - * in the process of being provisioned in the Service Fabric cluster. These - * results are of application types whose name match exactly the one specified - * as the parameter, and which comply with the given query parameters. All - * versions of the application type matching the application type name are - * returned, with each version returned as one application type. The response - * includes the name, version, status and other details about the application - * type. This is a paged query, meaning that if not all of the application - * types fit in a page, one page of results is returned as well as a - * continuation token which can be used to get the next page. For example, if - * there are 10 application types but a page only fits the first 3 application - * types, or if max results is set to 3, then 3 is returned. To access the rest - * of the results, retrieve subsequent pages by using the returned continuation - * token in the next query. An empty continuation token is returned if there - * are no subsequent pages. + * Reports health state of the specified Service Fabric replica. The report + * must contain the information about the source of the health report and + * property on which it is reported. + * The report is sent to a Service Fabric gateway Replica, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, run + * GetReplicaHealth and check that the report appears in the HealthEvents + * section. * - * @param {string} applicationTypeName The name of the application type. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} [options] Optional Parameters. + * @param {string} replicaId The identifier of the replica. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {string} replicaHealthReportServiceKind The kind of service replica + * (Stateless or Stateful) for which the health is being reported. Following + * are the possible values. Possible values include: 'Stateless', 'Stateful' * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. * - * @param {number} [options.maxResults] The maximum number of results to be - * returned as part of the paged queries. This parameter defines the upper - * bound on the number of results returned. The results returned can be less - * than the specified maximum results if they do not fit in the message as per - * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30406,7 +55357,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedApplicationTypeInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30414,15 +55365,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 PagedApplicationTypeInfoList} 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. */ - getApplicationTypeInfoListByName(applicationTypeName, options, optionalCallback) { + reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30431,52 +55380,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationTypeInfoListByName(applicationTypeName, options, (err, result, request, response) => { + self._reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationTypeInfoListByName(applicationTypeName, options, optionalCallback); + return self._reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, optionalCallback); } } /** - * @summary Provisions or registers a Service Fabric application type with the - * cluster. + * @summary Gets the list of replicas deployed on a Service Fabric node. * - * Provisions or registers a Service Fabric application type with the cluster. - * This is required before any new applications can be instantiated. + * Gets the list containing the information about replicas deployed on a + * Service Fabric node. The information include partition ID, replica ID, + * status of the replica, name of the service, name of the service type, and + * other information. Use PartitionId or ServiceManifestName query parameters + * to return information about the deployed replicas matching the specified + * values for those parameters. * - * @param {object} applicationTypeImageStorePath The relative path for the - * application package in the image store specified during the prior copy - * operation. + * @param {string} nodeName The name of the node. * - * @param {string} applicationTypeImageStorePath.applicationTypeBuildPath The - * relative image store path to the application package. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {uuid} [options.partitionId] The identity of the partition. + * + * @param {string} [options.serviceManifestName] The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - provisionApplicationTypeWithHttpOperationResponse(applicationTypeImageStorePath, options) { + getDeployedServiceReplicaInfoListWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._provisionApplicationType(applicationTypeImageStorePath, options, (err, result, request, response) => { + self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30487,25 +55447,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Provisions or registers a Service Fabric application type with the - * cluster. + * @summary Gets the list of replicas deployed on a Service Fabric node. * - * Provisions or registers a Service Fabric application type with the cluster. - * This is required before any new applications can be instantiated. + * Gets the list containing the information about replicas deployed on a + * Service Fabric node. The information include partition ID, replica ID, + * status of the replica, name of the service, name of the service type, and + * other information. Use PartitionId or ServiceManifestName query parameters + * to return information about the deployed replicas matching the specified + * values for those parameters. * - * @param {object} applicationTypeImageStorePath The relative path for the - * application package in the image store specified during the prior copy - * operation. + * @param {string} nodeName The name of the node. * - * @param {string} applicationTypeImageStorePath.applicationTypeBuildPath The - * relative image store path to the application package. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {uuid} [options.partitionId] The identity of the partition. + * + * @param {string} [options.serviceManifestName] The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30517,7 +55488,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30525,13 +55496,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - provisionApplicationType(applicationTypeImageStorePath, options, optionalCallback) { + getDeployedServiceReplicaInfoList(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30540,55 +55511,52 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._provisionApplicationType(applicationTypeImageStorePath, options, (err, result, request, response) => { + self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._provisionApplicationType(applicationTypeImageStorePath, options, optionalCallback); + return self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Removes or unregisters a Service Fabric application type from the - * cluster. + * @summary Gets the details of replica deployed on a Service Fabric node. * - * Removes or unregisters a Service Fabric application type from the cluster. - * This operation can only be performed if all application instance of the - * application type has been deleted. Once the application type is - * unregistered, no new application instance can be created for this particular - * application type. + * Gets the details of the replica deployed on a Service Fabric node. The + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * - * @param {string} applicationTypeName The name of the application type. + * @param {string} nodeName The name of the node. * - * @param {object} applicationTypeImageStoreVersion The version of the - * application type in the image store. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} applicationTypeImageStoreVersion.applicationTypeVersion + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - unprovisionApplicationTypeWithHttpOperationResponse(applicationTypeName, applicationTypeImageStoreVersion, options) { + getDeployedServiceReplicaDetailInfoWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._unprovisionApplicationType(applicationTypeName, applicationTypeImageStoreVersion, options, (err, result, request, response) => { + self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30599,28 +55567,25 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Removes or unregisters a Service Fabric application type from the - * cluster. + * @summary Gets the details of replica deployed on a Service Fabric node. * - * Removes or unregisters a Service Fabric application type from the cluster. - * This operation can only be performed if all application instance of the - * application type has been deleted. Once the application type is - * unregistered, no new application instance can be created for this particular - * application type. + * Gets the details of the replica deployed on a Service Fabric node. The + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * - * @param {string} applicationTypeName The name of the application type. + * @param {string} nodeName The name of the node. * - * @param {object} applicationTypeImageStoreVersion The version of the - * application type in the image store. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} applicationTypeImageStoreVersion.applicationTypeVersion + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30632,7 +55597,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {DeployedServiceReplicaDetailInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30640,13 +55605,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeployedServiceReplicaDetailInfo} 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. */ - unprovisionApplicationType(applicationTypeName, applicationTypeImageStoreVersion, options, optionalCallback) { + getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30655,52 +55622,50 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._unprovisionApplicationType(applicationTypeName, applicationTypeImageStoreVersion, options, (err, result, request, response) => { + self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._unprovisionApplicationType(applicationTypeName, applicationTypeImageStoreVersion, options, optionalCallback); + return self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the list containing the information about service types that - * are supported by a provisioned application type in a Service Fabric cluster. + * @summary Gets the details of replica deployed on a Service Fabric node. * - * Gets the list containing the information about service types that are - * supported by a provisioned application type in a Service Fabric cluster. The - * response includes the name of the service type, the name and version of the - * service manifest the type is defined in, kind (stateless or stateless) of - * the service type and other information about it. + * Gets the details of the replica deployed on a Service Fabric node. The + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * - * @param {string} applicationTypeName The name of the application type. + * @param {string} nodeName The name of the node. * - * @param {string} applicationTypeVersion The version of the application type. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceTypeInfoListWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, options) { + getDeployedServiceReplicaDetailInfoByPartitionIdWithHttpOperationResponse(nodeName, partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30711,25 +55676,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list containing the information about service types that - * are supported by a provisioned application type in a Service Fabric cluster. + * @summary Gets the details of replica deployed on a Service Fabric node. * - * Gets the list containing the information about service types that are - * supported by a provisioned application type in a Service Fabric cluster. The - * response includes the name of the service type, the name and version of the - * service manifest the type is defined in, kind (stateless or stateless) of - * the service type and other information about it. + * Gets the details of the replica deployed on a Service Fabric node. The + * information includes service kind, service name, current service operation, + * current service operation start date time, partition ID, replica/instance + * ID, reported load, and other information. * - * @param {string} applicationTypeName The name of the application type. + * @param {string} nodeName The name of the node. * - * @param {string} applicationTypeVersion The version of the application type. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30741,7 +55704,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {DeployedServiceReplicaDetailInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30749,13 +55712,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeployedServiceReplicaDetailInfo} 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. */ - getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback) { + getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30764,51 +55729,52 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback); + return self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback); } } /** - * @summary Gets the manifest describing a service type. + * @summary Restarts a service replica of a persisted service running on a + * node. * - * Gets the manifest describing a service type. The response contains the - * service manifest XML as a string. + * Restarts a service replica of a persisted service running on a node. Warning + * - There are no safety checks performed when this API is used. Incorrect use + * of this API can lead to availability loss for stateful services. * - * @param {string} applicationTypeName The name of the application type. + * @param {string} nodeName The name of the node. * - * @param {string} applicationTypeVersion The version of the application type. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} serviceManifestName The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceManifestWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, serviceManifestName, options) { + restartReplicaWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, (err, result, request, response) => { + self._restartReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30819,24 +55785,25 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the manifest describing a service type. + * @summary Restarts a service replica of a persisted service running on a + * node. * - * Gets the manifest describing a service type. The response contains the - * service manifest XML as a string. + * Restarts a service replica of a persisted service running on a node. Warning + * - There are no safety checks performed when this API is used. Incorrect use + * of this API can lead to availability loss for stateful services. * - * @param {string} applicationTypeName The name of the application type. + * @param {string} nodeName The name of the node. * - * @param {string} applicationTypeVersion The version of the application type. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} serviceManifestName The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30848,7 +55815,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceTypeManifest} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30856,14 +55823,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ServiceTypeManifest} 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. */ - getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, optionalCallback) { + restartReplica(nodeName, partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30872,61 +55838,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, (err, result, request, response) => { + self._restartReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, optionalCallback); + return self._restartReplica(nodeName, partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the list containing the information about service types from - * the applications deployed on a node in a Service Fabric cluster. + * @summary Removes a service replica running on a node. * - * Gets the list containing the information about service types from the - * applications deployed on a node in a Service Fabric cluster. The response - * includes the name of the service type, its registration status, the code - * package that registered it and activation id of the service package. + * This API simulates a Service Fabric replica failure by removing a replica + * from a Service Fabric cluster. The removal closes the replica, transitions + * the replica to the role None, and then removes all of the state information + * of the replica from the cluster. This API tests the replica state removal + * path, and simulates the report fault permanent path through client APIs. + * Warning - There are no safety checks performed when this API is used. + * Incorrect use of this API can lead to data loss for stateful services. In + * addition, the forceRemove flag impacts all other replicas hosted in the same + * process. * * @param {string} nodeName The name of the node. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceManifestName] The name of the service - * manifest to filter the list of deployed service type information. If - * specified, the response will only contain the information about service - * types that are defined in this service manifest. + * @param {boolean} [options.forceRemove] Remove a Service Fabric application + * or service forcefully without going through the graceful shutdown sequence. + * This parameter can be used to forcefully delete an application or service + * for which delete is timing out due to issues in the service code that + * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServiceTypeInfoListWithHttpOperationResponse(nodeName, applicationId, options) { + removeReplicaWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._removeReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -30937,34 +55905,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list containing the information about service types from - * the applications deployed on a node in a Service Fabric cluster. + * @summary Removes a service replica running on a node. * - * Gets the list containing the information about service types from the - * applications deployed on a node in a Service Fabric cluster. The response - * includes the name of the service type, its registration status, the code - * package that registered it and activation id of the service package. + * This API simulates a Service Fabric replica failure by removing a replica + * from a Service Fabric cluster. The removal closes the replica, transitions + * the replica to the role None, and then removes all of the state information + * of the replica from the cluster. This API tests the replica state removal + * path, and simulates the report fault permanent path through client APIs. + * Warning - There are no safety checks performed when this API is used. + * Incorrect use of this API can lead to data loss for stateful services. In + * addition, the forceRemove flag impacts all other replicas hosted in the same + * process. * * @param {string} nodeName The name of the node. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceManifestName] The name of the service - * manifest to filter the list of deployed service type information. If - * specified, the response will only contain the information about service - * types that are defined in this service manifest. + * @param {boolean} [options.forceRemove] Remove a Service Fabric application + * or service forcefully without going through the graceful shutdown sequence. + * This parameter can be used to forcefully delete an application or service + * for which delete is timing out due to issues in the service code that + * prevents graceful close of replicas. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -30976,7 +55946,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -30984,13 +55954,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {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. */ - getDeployedServiceTypeInfoList(nodeName, applicationId, options, optionalCallback) { + removeReplica(nodeName, partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -30999,51 +55969,40 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._removeReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, optionalCallback); + return self._removeReplica(nodeName, partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the information about a specified service type of the - * application deployed on a node in a Service Fabric cluster. + * @summary Gets the list of service packages deployed on a Service Fabric + * node. * - * Gets the list containing the information about a specific service type from - * the applications deployed on a node in a Service Fabric cluster. The - * response includes the name of the service type, its registration status, the - * code package that registered it and activation id of the service package. - * Each entry represents one activation of a service type, differentiated by - * the activation id. + * Returns the information about the service packages deployed on a Service + * Fabric node for the given application. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {string} serviceTypeName Specifies the name of a Service Fabric - * service type. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceManifestName] The name of the service - * manifest to filter the list of deployed service type information. If - * specified, the response will only contain the information about service - * types that are defined in this service manifest. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -31054,11 +56013,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - getDeployedServiceTypeInfoByNameWithHttpOperationResponse(nodeName, applicationId, serviceTypeName, options) { + getDeployedServicePackageInfoListWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, (err, result, request, response) => { + self._getDeployedServicePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -31069,39 +56028,28 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about a specified service type of the - * application deployed on a node in a Service Fabric cluster. + * @summary Gets the list of service packages deployed on a Service Fabric + * node. * - * Gets the list containing the information about a specific service type from - * the applications deployed on a node in a Service Fabric cluster. The - * response includes the name of the service type, its registration status, the - * code package that registered it and activation id of the service package. - * Each entry represents one activation of a service type, differentiated by - * the activation id. + * Returns the information about the service packages deployed on a Service + * Fabric node for the given application. * * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {string} serviceTypeName Specifies the name of a Service Fabric - * service type. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceManifestName] The name of the service - * manifest to filter the list of deployed service type information. If - * specified, the response will only contain the information about service - * types that are defined in this service manifest. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -31127,7 +56075,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback) { + getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -31136,73 +56084,59 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, (err, result, request, response) => { + self._getDeployedServicePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback); + return self._getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Creates a Service Fabric application. - * - * Creates a Service Fabric application using the specified description. - * - * @param {object} applicationDescription Description for creating an - * application. - * - * @param {string} applicationDescription.name - * - * @param {string} applicationDescription.typeName - * - * @param {string} applicationDescription.typeVersion - * - * @param {array} [applicationDescription.parameterList] + * @summary Gets the list of service packages deployed on a Service Fabric node + * matching exactly the specified name. * - * @param {object} [applicationDescription.applicationCapacity] + * Returns the information about the service packages deployed on a Service + * Fabric node for the given application. These results are of service packages + * whose name match exactly the service package name specified as the + * parameter. * - * @param {number} [applicationDescription.applicationCapacity.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} nodeName The name of the node. * - * @param {number} [applicationDescription.applicationCapacity.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 {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {array} - * [applicationDescription.applicationCapacity.applicationMetrics] + * @param {string} servicePackageName The name of the service package. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createApplicationWithHttpOperationResponse(applicationDescription, options) { + getDeployedServicePackageInfoListByNameWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createApplication(applicationDescription, options, (err, result, request, response) => { + self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -31213,46 +56147,32 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates a Service Fabric application. - * - * Creates a Service Fabric application using the specified description. - * - * @param {object} applicationDescription Description for creating an - * application. - * - * @param {string} applicationDescription.name - * - * @param {string} applicationDescription.typeName - * - * @param {string} applicationDescription.typeVersion - * - * @param {array} [applicationDescription.parameterList] + * @summary Gets the list of service packages deployed on a Service Fabric node + * matching exactly the specified name. * - * @param {object} [applicationDescription.applicationCapacity] + * Returns the information about the service packages deployed on a Service + * Fabric node for the given application. These results are of service packages + * whose name match exactly the service package name specified as the + * parameter. * - * @param {number} [applicationDescription.applicationCapacity.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} nodeName The name of the node. * - * @param {number} [applicationDescription.applicationCapacity.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 {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {array} - * [applicationDescription.applicationCapacity.applicationMetrics] + * @param {string} servicePackageName The name of the service package. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -31264,7 +56184,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -31272,13 +56192,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - createApplication(applicationDescription, options, optionalCallback) { + getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -31287,63 +56207,82 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createApplication(applicationDescription, options, (err, result, request, response) => { + self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createApplication(applicationDescription, options, optionalCallback); + return self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, optionalCallback); } } /** - * @summary Deletes an existing Service Fabric application. + * @summary Gets the information about health of a service package for a + * specific application deployed for a Service Fabric node and application. + * + * Gets the information about health of a service package for a specific + * application deployed on a Service Fabric node. Use EventsHealthStateFilter + * to optionally filter for the collection of HealthEvent objects reported on + * the deployed service package based on health state. * - * Deletes an existing Service Fabric application. An application must be - * created before it can be deleted. Deleting an application will delete all - * services that are part of that application. By default Service Fabric will - * try to close service replicas in a graceful manner and then delete the - * service. However if service is having issues closing the replica gracefully, - * the delete operation may take a long time or get stuck. Use the optional - * ForceRemove flag to skip the graceful close sequence and forcefully delete - * the application and all of the its services. + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * + * @param {string} servicePackageName The name of the service package. + * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.forceRemove] Remove a Service Fabric application - * or service forcefully without going through the graceful shutdown sequence. - * This parameter can be used to forcefully delete an application or service - * for which delete is timing out due to issues in the service code that - * prevents graceful close of replicas. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteApplicationWithHttpOperationResponse(applicationId, options) { + getDeployedServicePackageHealthWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteApplication(applicationId, options, (err, result, request, response) => { + self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -31354,36 +56293,55 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes an existing Service Fabric application. + * @summary Gets the information about health of a service package for a + * specific application deployed for a Service Fabric node and application. * - * Deletes an existing Service Fabric application. An application must be - * created before it can be deleted. Deleting an application will delete all - * services that are part of that application. By default Service Fabric will - * try to close service replicas in a graceful manner and then delete the - * service. However if service is having issues closing the replica gracefully, - * the delete operation may take a long time or get stuck. Use the optional - * ForceRemove flag to skip the graceful close sequence and forcefully delete - * the application and all of the its services. + * Gets the information about health of a service package for a specific + * application deployed on a Service Fabric node. Use EventsHealthStateFilter + * to optionally filter for the collection of HealthEvent objects reported on + * the deployed service package based on health state. + * + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * + * @param {string} servicePackageName The name of the service package. + * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.forceRemove] Remove a Service Fabric application - * or service forcefully without going through the graceful shutdown sequence. - * This parameter can be used to forcefully delete an application or service - * for which delete is timing out due to issues in the service code that - * prevents graceful close of replicas. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -31395,7 +56353,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {DeployedServicePackageHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -31403,13 +56361,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeployedServicePackageHealth} 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. */ - deleteApplication(applicationId, options, optionalCallback) { + getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -31418,191 +56378,160 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteApplication(applicationId, options, (err, result, request, response) => { + self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteApplication(applicationId, options, optionalCallback); + return self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback); } } /** - * @summary Gets load information about a Service Fabric application. - * - * Returns the load information about the application that was created or in - * the process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * minimum nodes, maximum nodes, the number of nodes the app is occupying - * currently, and application load metric information about the application. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @summary Gets the information about health of service package for a specific + * application deployed on a Service Fabric node using the specified policy. * - * @reject {Error} - The error object. - */ - getApplicationLoadInfoWithHttpOperationResponse(applicationId, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._getApplicationLoadInfo(applicationId, 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 load information about a Service Fabric application. + * Gets the information about health of a service package for a specific + * application deployed on a Service Fabric node. using the specified policy. + * Use EventsHealthStateFilter to optionally filter for the collection of + * HealthEvent objects reported on the deployed service package based on health + * state. Use ApplicationHealthPolicy to optionally override the health + * policies used to evaluate the health. This API only uses + * 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of + * the fields are ignored while evaluating the health of the deployed service + * package. * - * Returns the load information about the application that was created or in - * the process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * minimum nodes, maximum nodes, the number of nodes the app is occupying - * currently, and application load metric information about the application. + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * - * @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 + * @param {string} servicePackageName The name of the service package. * - * @resolve {ApplicationLoadInfo} - The deserialized result object. + * @param {object} [options] Optional Parameters. * - * @reject {Error} - The error object. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. * - * {function} optionalCallback(err, result, request, response) + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationLoadInfo} for more information. + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {number} + * [options.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. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getApplicationLoadInfo(applicationId, options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getApplicationLoadInfo(applicationId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getApplicationLoadInfo(applicationId, options, optionalCallback); - } - } - - /** - * @summary Gets the list of applications created in the Service Fabric cluster - * that match filters specified as the parameter. + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * - * Gets the information about the applications that were created or in the - * process of being created in the Service Fabric cluster and match filters - * specified as the parameter. The response includes the name, type, status, - * parameters and other details about the application. If the applications do - * not fit in a page, one page of results is returned as well as a continuation - * token which can be used to get the next page. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] + * The maximum allowed percentage of unhealthy partitions per service. Allowed + * values are Byte values from zero to 100 * - * @param {object} [options] Optional Parameters. + * 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} [options.applicationDefinitionKindFilter] Used to filter on - * ApplicationDefinitionKind for application query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationDefinitionKind value. The value is 0. - * - All - Filter that matches input with any ApplicationDefinitionKind value. - * The value is 65535. - * - ServiceFabricApplicationDescription - Filter that matches input with - * ApplicationDefinitionKind value ServiceFabricApplicationDescription. The - * value is 1. - * - Compose - Filter that matches input with ApplicationDefinitionKind value - * Compose. The value is 2. + * @param {number} + * [options.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. * - * @param {string} [options.applicationTypeName] The application type name used - * to filter the applications to query for. This value should not contain the - * application type version. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum maximum allowed percentage of unhealthy services. Allowed values + * are Byte values from zero to 100. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * 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} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationInfoListWithHttpOperationResponse(options) { + getDeployedServicePackageHealthUsingPolicyWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationInfoList(options, (err, result, request, response) => { + self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -31613,50 +56542,133 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of applications created in the Service Fabric cluster - * that match filters specified as the parameter. + * @summary Gets the information about health of service package for a specific + * application deployed on a Service Fabric node using the specified policy. * - * Gets the information about the applications that were created or in the - * process of being created in the Service Fabric cluster and match filters - * specified as the parameter. The response includes the name, type, status, - * parameters and other details about the application. If the applications do - * not fit in a page, one page of results is returned as well as a continuation - * token which can be used to get the next page. + * Gets the information about health of a service package for a specific + * application deployed on a Service Fabric node. using the specified policy. + * Use EventsHealthStateFilter to optionally filter for the collection of + * HealthEvent objects reported on the deployed service package based on health + * state. Use ApplicationHealthPolicy to optionally override the health + * policies used to evaluate the health. This API only uses + * 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of + * the fields are ignored while evaluating the health of the deployed service + * package. + * + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} servicePackageName The name of the service package. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.applicationDefinitionKindFilter] Used to filter on - * ApplicationDefinitionKind for application query operations. - * - Default - Default value. Filter that matches input with any - * ApplicationDefinitionKind value. The value is 0. - * - All - Filter that matches input with any ApplicationDefinitionKind value. - * The value is 65535. - * - ServiceFabricApplicationDescription - Filter that matches input with - * ApplicationDefinitionKind value ServiceFabricApplicationDescription. The - * value is 1. - * - Compose - Filter that matches input with ApplicationDefinitionKind value - * Compose. The value is 2. + * @param {number} [options.eventsHealthStateFilter] Allows filtering the + * collection of HealthEvent objects returned based on health state. + * The possible values for this parameter include integer value of one of the + * following health states. + * Only events that match the filter are returned. All events are used to + * evaluate the aggregated health state. + * If not specified, all entries are returned. The state values are flag-based + * enumeration, so the value could be a combination of these values, obtained + * using the bitwise 'OR' operator. For example, If the provided value is 6 + * then all of the events with HealthState value of OK (2) and Warning (4) are + * returned. + * + * - Default - Default value. Matches any HealthState. The value is zero. + * - None - Filter that doesn't match any HealthState value. Used in order to + * return no results on a given collection of states. The value is 1. + * - Ok - Filter that matches input with HealthState value Ok. The value is 2. + * - Warning - Filter that matches input with HealthState value Warning. The + * value is 4. + * - Error - Filter that matches input with HealthState value Error. The value + * is 8. + * - All - Filter that matches input with any HealthState value. The value is + * 65535. * + * @param {object} [options.applicationHealthPolicy] Describes the health + * policies used to evaluate the health of an application or one of its + * children. + * If not present, the health evaluation uses the health policy from + * application manifest or the default health policy. * - * @param {string} [options.applicationTypeName] The application type name used - * to filter the applications to query for. This value should not contain the - * application type version. + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {number} + * [options.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} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. + * + * @param {number} + * [options.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} + * [options.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. + * + * @param {number} + * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -31668,7 +56680,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedApplicationInfoList} - The deserialized result object. + * @resolve {DeployedServicePackageHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -31677,14 +56689,14 @@ class ServiceFabricClient extends ServiceClient { * {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 PagedApplicationInfoList} for more + * See {@link DeployedServicePackageHealth} 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. */ - getApplicationInfoList(options, optionalCallback) { + getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -31693,56 +56705,156 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationInfoList(options, (err, result, request, response) => { + self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationInfoList(options, optionalCallback); + return self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback); } } /** - * @summary Gets information about a Service Fabric application. + * @summary Sends a health report on the Service Fabric deployed service + * package. * - * Returns the information about the application that was created or in the - * process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * type, status, parameters and other details about the application. + * Reports health state of the service package of the application deployed on a + * Service Fabric node. The report must contain the information about the + * source of the health report and property on which it is reported. + * The report is sent to a Service Fabric gateway Service, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, get deployed + * service package health and check that the report appears in the HealthEvents + * section. + * + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * + * @param {string} servicePackageName The name of the service package. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationInfoWithHttpOperationResponse(applicationId, options) { + reportDeployedServicePackageHealthWithHttpOperationResponse(nodeName, applicationId, servicePackageName, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationInfo(applicationId, options, (err, result, request, response) => { + self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -31753,29 +56865,129 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets information about a Service Fabric application. + * @summary Sends a health report on the Service Fabric deployed service + * package. * - * Returns the information about the application that was created or in the - * process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * type, status, parameters and other details about the application. + * Reports health state of the service package of the application deployed on a + * Service Fabric node. The report must contain the information about the + * source of the health report and property on which it is reported. + * The report is sent to a Service Fabric gateway Service, which forwards to + * the health store. + * The report may be accepted by the gateway, but rejected by the health store + * after extra validation. + * For example, the health store may reject the report because of an invalid + * parameter, like a stale sequence number. + * To see whether the report was applied in the health store, get deployed + * service package health and check that the report appears in the HealthEvents + * section. + * + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * + * @param {string} servicePackageName The name of the service package. + * + * @param {object} healthInformation Describes the health information for the + * health report. This information needs to be present in all of the health + * reports sent to the health manager. + * + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. + * + * @param {string} healthInformation.property The property of the health + * information. An entity can have health reports for different properties. + * The property is a string and not a fixed enumeration to allow the reporter + * flexibility to categorize the state condition that triggers the report. + * For example, a reporter with SourceId "LocalWatchdog" can monitor the state + * of the available disk on a node, + * so it can report "AvailableDisk" property on that node. + * The same reporter can monitor the node connectivity, so it can report a + * property "Connectivity" on the same node. + * In the health store, these reports are treated as separate health events for + * the specified node. + * + * Together with the SourceId, the property uniquely identifies the health + * information. + * + * @param {string} healthInformation.healthState The health state of a Service + * Fabric entity such as Cluster, Node, Application, Service, Partition, + * Replica etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * + * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The + * duration for which this health report is valid. This field uses ISO8601 + * format for specifying the duration. + * When clients report periodically, they should send reports with higher + * frequency than time to live. + * If clients report on transition, they can set the time to live to infinite. + * When time to live expires, the health event that contains the health + * information + * is either removed from health store, if RemoveWhenExpired is true, or + * evaluated at error, if RemoveWhenExpired false. + * + * If not specified, time to live defaults to infinite value. + * + * @param {string} [healthInformation.description] The description of the + * health information. It represents free text used to add human readable + * information about the report. + * The maximum string length for the description is 4096 characters. + * If the provided string is longer, it will be automatically truncated. + * When truncated, the last characters of the description contain a marker + * "[Truncated]", and total string size is 4096 characters. + * The presence of the marker indicates to users that truncation occurred. + * Note that when truncated, the description has less than 4096 characters from + * the original string. + * + * @param {string} [healthInformation.sequenceNumber] The sequence number for + * this health report as a numeric string. + * The report sequence number is used by the health store to detect stale + * reports. + * If not specified, a sequence number is auto-generated by the health client + * when a report is added. + * + * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates + * whether the report is removed from health store when it expires. + * If set to true, the report is removed from the health store after it + * expires. + * If set to false, the report is treated as an error when expired. The value + * of this property is false by default. + * When clients report periodically, they should set RemoveWhenExpired false + * (default). + * This way, is the reporter has issues (eg. deadlock) and can't report, the + * entity is evaluated at error when the health report expires. + * This flags the entity as being in Error health state. + * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {boolean} [options.immediate] A flag that indicates whether the + * report should be sent immediately. + * A health report is sent to a Service Fabric gateway Application, which + * forwards to the health store. + * If Immediate is set to true, the report is sent immediately from HTTP + * Gateway to the health store, regardless of the fabric client settings that + * the HTTP Gateway Application is using. + * This is useful for critical reports that should be sent as soon as possible. + * Depending on timing and other conditions, sending the report may still fail, + * for example if the HTTP Gateway is closed or the message doesn't reach the + * Gateway. + * If Immediate is set to false, the report is sent based on the health client + * settings from the HTTP Gateway. Therefore, it will be batched according to + * the HealthReportSendInterval configuration. + * This is the recommended setting because it allows the health client to + * optimize health reporting messages to health store as well as health report + * processing. + * By default, reports are not sent immediately. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -31787,7 +56999,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -31795,14 +57007,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ApplicationInfo} 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. */ - getApplicationInfo(applicationId, options, optionalCallback) { + reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -31811,133 +57022,69 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationInfo(applicationId, options, (err, result, request, response) => { + self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationInfo(applicationId, options, optionalCallback); + return self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback); } } /** - * @summary Gets the health of the service fabric application. - * - * Returns the heath state of the service fabric application. The response - * reports either Ok, Error or Warning health state. If the entity is not found - * in the helath store, it will return Error. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} [options] Optional Parameters. + * @summary Downloads all of the code packages associated with specified + * service manifest on the specified node. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.deployedApplicationsHealthStateFilter] Allows - * filtering of the deployed applications health state objects returned in the - * result of application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. Only deployed applications that match the filter - * will be returned.\ - * All deployed applications are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of deployed - * applications with HealthState value of OK (2) and Warning (4) are returned. + * This API provides a way to download code packages including the container + * images on a specific node outside of the normal application deployment and + * upgrade path. This is useful for the large code packages and container + * images to be present on the node before the actual application deployment + * and upgrade, thus significantly reducing the total time required for the + * deployment or upgrade. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} nodeName The name of the node. * + * @param {object} deployServicePackageToNodeDescription Describes information + * for deploying a service package to a Service Fabric node. * - * @param {number} [options.servicesHealthStateFilter] Allows filtering of the - * services health state objects returned in the result of services health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only services that match the filter are returned. All services are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of services with HealthState value of OK (2) and Warning - * (4) will be returned. + * @param {string} deployServicePackageToNodeDescription.serviceManifestName + * The name of service manifest whose packages need to be downloaded. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} deployServicePackageToNodeDescription.applicationTypeName + * The application type name as defined in the application manifest. * + * @param {string} deployServicePackageToNodeDescription.applicationTypeVersion + * The version of the application type as defined in the application manifest. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {string} deployServicePackageToNodeDescription.nodeName The name of a + * Service Fabric node. * + * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] + * List of package sharing policy information. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationHealthWithHttpOperationResponse(applicationId, options) { + deployServicePackageToNodeWithHttpOperationResponse(nodeName, deployServicePackageToNodeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationHealth(applicationId, options, (err, result, request, response) => { + self._deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -31948,106 +57095,42 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the service fabric application. - * - * Returns the heath state of the service fabric application. The response - * reports either Ok, Error or Warning health state. If the entity is not found - * in the helath store, it will return Error. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @summary Downloads all of the code packages associated with specified + * service manifest on the specified node. * + * This API provides a way to download code packages including the container + * images on a specific node outside of the normal application deployment and + * upgrade path. This is useful for the large code packages and container + * images to be present on the node before the actual application deployment + * and upgrade, thus significantly reducing the total time required for the + * deployment or upgrade. * - * @param {number} [options.deployedApplicationsHealthStateFilter] Allows - * filtering of the deployed applications health state objects returned in the - * result of application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. Only deployed applications that match the filter - * will be returned.\ - * All deployed applications are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of deployed - * applications with HealthState value of OK (2) and Warning (4) are returned. + * @param {string} nodeName The name of the node. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {object} deployServicePackageToNodeDescription Describes information + * for deploying a service package to a Service Fabric node. * + * @param {string} deployServicePackageToNodeDescription.serviceManifestName + * The name of service manifest whose packages need to be downloaded. * - * @param {number} [options.servicesHealthStateFilter] Allows filtering of the - * services health state objects returned in the result of services health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only services that match the filter are returned. All services are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of services with HealthState value of OK (2) and Warning - * (4) will be returned. + * @param {string} deployServicePackageToNodeDescription.applicationTypeName + * The application type name as defined in the application manifest. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} deployServicePackageToNodeDescription.applicationTypeVersion + * The version of the application type as defined in the application manifest. * + * @param {string} deployServicePackageToNodeDescription.nodeName The name of a + * Service Fabric node. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] + * List of package sharing policy information. * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -32059,7 +57142,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -32067,14 +57150,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ApplicationHealth} 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. */ - getApplicationHealth(applicationId, options, optionalCallback) { + deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -32083,210 +57165,212 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationHealth(applicationId, options, (err, result, request, response) => { + self._deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationHealth(applicationId, options, optionalCallback); + return self._deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric application using the specified - * policy. + * @summary Gets the list of code packages deployed on a Service Fabric node. * - * Gets the health of a Service Fabric application. Use EventsHealthStateFilter - * to filter the collection of health events reported on the node based on the - * health state. Use ClusterHealthPolicies to override the health policies used - * to evaluate the health. + * Gets the list of code packages deployed on a Service Fabric node for the + * given application. + * + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {string} [options.serviceManifestName] The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} [options.codePackageName] The name of code package specified + * in service manifest registered as part of an application type in a Service + * Fabric cluster. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {number} [options.deployedApplicationsHealthStateFilter] Allows - * filtering of the deployed applications health state objects returned in the - * result of application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. Only deployed applications that match the filter - * will be returned.\ - * All deployed applications are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of deployed - * applications with HealthState value of OK (2) and Warning (4) are returned. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @returns {Promise} A promise is returned * + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [options.servicesHealthStateFilter] Allows filtering of the - * services health state objects returned in the result of services health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only services that match the filter are returned. All services are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of services with HealthState value of OK (2) and Warning - * (4) will be returned. + * @reject {Error} - The error object. + */ + getDeployedCodePackageInfoListWithHttpOperationResponse(nodeName, applicationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedCodePackageInfoList(nodeName, applicationId, 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 code packages deployed on a Service Fabric node. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * Gets the list of code packages deployed on a Service Fabric node for the + * given application. * + * @param {string} nodeName The name of the node. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * + * @param {object} [options] Optional Parameters. * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. + * @param {string} [options.serviceManifestName] The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * + * @param {string} [options.codePackageName] The name of code package specified + * in service manifest registered as part of an application type in a Service + * Fabric cluster. * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {number} - * [options.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} [options.customHeaders] Headers that will be added to the + * request * + * @param {function} [optionalCallback] - The optional callback. * - * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * {Promise} A promise is returned * - * 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. + * @resolve {Array} - The deserialized result object. * + * @reject {Error} - The error object. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * {function} optionalCallback(err, result, request, response) * - * 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. + * {Error} err - The Error object if an error occurred, null otherwise. * + * {array} [result] - The deserialized result object if an error did not occur. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * {object} [request] - The HTTP Request object if an error did not occur. * - * 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. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeployedCodePackageInfoList(nodeName, applicationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeployedCodePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployedCodePackageInfoList(nodeName, applicationId, options, optionalCallback); + } + } + + /** + * @summary Restarts a code package deployed on a Service Fabric node in a + * cluster. * + * Restarts a code package deployed on a Service Fabric node in a cluster. This + * aborts the code package process, which will restart all the user service + * replicas hosted in that process. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} nodeName The name of the node. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {object} restartDeployedCodePackageDescription Describes the deployed + * code package on Service Fabric node to restart. + * + * @param {string} restartDeployedCodePackageDescription.serviceManifestName + * The name of service manifest that specified this code package. + * + * @param {string} + * [restartDeployedCodePackageDescription.servicePackageActivationId] The + * ActivationId of a deployed service package. If ServicePackageActivationMode + * specified at the time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * + * @param {string} restartDeployedCodePackageDescription.codePackageName The + * name of the code package defined in the service manifest. + * + * @param {string} restartDeployedCodePackageDescription.codePackageInstanceId + * The instance ID for currently running entry point. For a code package setup + * entry point (if specified) runs first and after it finishes main entry point + * is started. + * Each time entry point executable is run, its instance ID will change. If 0 + * is passed in as the code package instance ID, the API will restart the code + * package with whatever instance ID it is currently running. + * If an instance ID other than 0 is passed in, the API will restart the code + * package only if the current Instance ID matches the passed in instance ID. + * Note, passing in the exact instance ID (not 0) in the API is safer, because + * if ensures at most one restart of the code package. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationHealthUsingPolicyWithHttpOperationResponse(applicationId, options) { + restartDeployedCodePackageWithHttpOperationResponse(nodeName, applicationId, restartDeployedCodePackageDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationHealthUsingPolicy(applicationId, options, (err, result, request, response) => { + self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -32297,183 +57381,199 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric application using the specified - * policy. + * @summary Restarts a code package deployed on a Service Fabric node in a + * cluster. * - * Gets the health of a Service Fabric application. Use EventsHealthStateFilter - * to filter the collection of health events reported on the node based on the - * health state. Use ClusterHealthPolicies to override the health policies used - * to evaluate the health. + * Restarts a code package deployed on a Service Fabric node in a cluster. This + * aborts the code package process, which will restart all the user service + * replicas hosted in that process. + * + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * + * @param {object} restartDeployedCodePackageDescription Describes the deployed + * code package on Service Fabric node to restart. + * + * @param {string} restartDeployedCodePackageDescription.serviceManifestName + * The name of service manifest that specified this code package. + * + * @param {string} + * [restartDeployedCodePackageDescription.servicePackageActivationId] The + * ActivationId of a deployed service package. If ServicePackageActivationMode + * specified at the time of creating the service + * is 'SharedProcess' (or if it is not specified, in which case it defaults to + * 'SharedProcess'), then value of ServicePackageActivationId + * is always an empty string. + * + * @param {string} restartDeployedCodePackageDescription.codePackageName The + * name of the code package defined in the service manifest. + * + * @param {string} restartDeployedCodePackageDescription.codePackageInstanceId + * The instance ID for currently running entry point. For a code package setup + * entry point (if specified) runs first and after it finishes main entry point + * is started. + * Each time entry point executable is run, its instance ID will change. If 0 + * is passed in as the code package instance ID, the API will restart the code + * package with whatever instance ID it is currently running. + * If an instance ID other than 0 is passed in, the API will restart the code + * package only if the current Instance ID matches the passed in instance ID. + * Note, passing in the exact instance ID (not 0) in the API is safer, because + * if ensures at most one restart of the code package. + * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * + * @param {function} [optionalCallback] - The optional callback. * - * @param {number} [options.deployedApplicationsHealthStateFilter] Allows - * filtering of the deployed applications health state objects returned in the - * result of application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. Only deployed applications that match the filter - * will be returned.\ - * All deployed applications are used to evaluate the aggregated health state. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value could be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of deployed - * applications with HealthState value of OK (2) and Warning (4) are returned. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * {Promise} A promise is returned * + * @resolve {null} - The deserialized result object. * - * @param {number} [options.servicesHealthStateFilter] Allows filtering of the - * services health state objects returned in the result of services health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only services that match the filter are returned. All services are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of services with HealthState value of OK (2) and Warning - * (4) will be returned. + * @reject {Error} - The error object. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * {function} optionalCallback(err, result, request, response) * + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * {null} [result] - The deserialized result object if an error did not occur. * + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the container logs for container deployed on a Service Fabric + * node. * + * Gets the container logs for container deployed on a Service Fabric node for + * the given code package. * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * @param {string} nodeName The name of the node. * - * @param {number} - * [options.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} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * - * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * @param {object} [options] Optional Parameters. * - * 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} [options.tail] Number of lines to show from the end of the + * logs. Default is 100. 'all' to show the complete logs. + * + * @param {boolean} [options.previous] Specifies whether to get container logs + * from exited/dead containers of the code package instance. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * + * @returns {Promise} A promise is returned * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * 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. + * @reject {Error} - The error object. + */ + getContainerLogsDeployedOnNodeWithHttpOperationResponse(nodeName, applicationId, serviceManifestName, codePackageName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, 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 container logs for container deployed on a Service Fabric + * node. * + * Gets the container logs for container deployed on a Service Fabric node for + * the given code package. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * @param {string} nodeName The name of the node. * - * 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} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.tail] Number of lines to show from the end of the + * logs. Default is 100. 'all' to show the complete logs. + * + * @param {boolean} [options.previous] Specifies whether to get container logs + * from exited/dead containers of the code package instance. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -32485,7 +57585,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationHealth} - The deserialized result object. + * @resolve {ContainerLogs} - The deserialized result object. * * @reject {Error} - The error object. * @@ -32494,13 +57594,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ApplicationHealth} for more information. + * See {@link ContainerLogs} 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. */ - getApplicationHealthUsingPolicy(applicationId, options, optionalCallback) { + getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -32509,155 +57609,80 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationHealthUsingPolicy(applicationId, options, (err, result, request, response) => { + self._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationHealthUsingPolicy(applicationId, options, optionalCallback); + return self._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric application. + * @summary Invoke container API on a container deployed on a Service Fabric + * node. * - * Reports health state of the specified Service Fabric application. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Application, which forwards - * to the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, get application - * health and check that the report appears in the HealthEvents section. + * Invoke container API on a container deployed on a Service Fabric node for + * the given code package. * + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. - * - * If not specified, time to live defaults to infinite value. + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * @param {string} codePackageInstanceId ID that uniquely identifies a code + * package instance deployed on a service fabric node. * + * @param {object} containerApiRequestBody Parameters for making container API + * call * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @param {string} [containerApiRequestBody.httpVerb] HTTP verb of container + * REST API, defaults to "GET" * + * @param {string} containerApiRequestBody.uriPath URI path of container REST + * API * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {string} [containerApiRequestBody.contentType] Content type of + * container REST API request, defaults to "application/json" * + * @param {string} [containerApiRequestBody.body] HTTP request body of + * container REST API * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - reportApplicationHealthWithHttpOperationResponse(applicationId, healthInformation, options) { + invokeContainerApiWithHttpOperationResponse(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { + self._invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -32668,128 +57693,53 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric application. + * @summary Invoke container API on a container deployed on a Service Fabric + * node. * - * Reports health state of the specified Service Fabric application. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Application, which forwards - * to the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, get application - * health and check that the report appears in the HealthEvents section. + * Invoke container API on a container deployed on a Service Fabric node for + * the given code package. * + * @param {string} nodeName The name of the node. * * @param {string} applicationId The identity of the application. This is * typically the full name of the application without the 'fabric:' URI scheme. * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. - * - * If not specified, time to live defaults to infinite value. + * @param {string} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric cluster. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * @param {string} codePackageInstanceId ID that uniquely identifies a code + * package instance deployed on a service fabric node. * + * @param {object} containerApiRequestBody Parameters for making container API + * call * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @param {string} [containerApiRequestBody.httpVerb] HTTP verb of container + * REST API, defaults to "GET" * + * @param {string} containerApiRequestBody.uriPath URI path of container REST + * API * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {string} [containerApiRequestBody.contentType] Content type of + * container REST API request, defaults to "application/json" * + * @param {string} [containerApiRequestBody.body] HTTP request body of + * container REST API * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -32801,7 +57751,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ContainerApiResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -32809,13 +57759,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerApiResponse} 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. */ - reportApplicationHealth(applicationId, healthInformation, options, optionalCallback) { + invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -32824,150 +57775,55 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { + self._invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportApplicationHealth(applicationId, healthInformation, options, optionalCallback); + return self._invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, optionalCallback); } } /** - * @summary Starts upgrading an application in the Service Fabric cluster. - * - * Validates the supplied application upgrade parameters and starts upgrading - * the application if the parameters are valid. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} applicationUpgradeDescription Parameters for an application - * upgrade. - * - * @param {string} applicationUpgradeDescription.name - * - * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion - * - * @param {array} applicationUpgradeDescription.parameters - * - * @param {string} applicationUpgradeDescription.upgradeKind Possible values - * include: 'Invalid', 'Rolling' - * - * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {number} - * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * - * @param {boolean} [applicationUpgradeDescription.forceRestart] + * @summary Creates a Service Fabric compose deployment. * - * @param {object} [applicationUpgradeDescription.monitoringPolicy] + * Compose is a file format that describes multi-container applications. This + * API allows deploying container based applications defined in compose format + * in a Service Fabric cluster. Once the deployment is created, its status can + * be tracked via the `GetComposeDeploymentStatus` API. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * @param {object} createComposeDeploymentDescription Describes the compose + * deployment that needs to be created. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * @param {string} createComposeDeploymentDescription.deploymentName The name + * of the deployment. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * @param {string} createComposeDeploymentDescription.composeFileContent The + * content of the compose file that describes the deployment to create. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * @param {object} [createComposeDeploymentDescription.registryCredential] + * Credential information to connect to container registry. * * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * [createComposeDeploymentDescription.registryCredential.registryUserName] The + * user name to connect to container registry. * * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * - * @param {object} [applicationUpgradeDescription.applicationHealthPolicy] + * [createComposeDeploymentDescription.registryCredential.registryPassword] The + * password for supplied username to connect to container registry. * * @param {boolean} - * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [applicationUpgradeDescription.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} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [applicationUpgradeDescription.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} - * [applicationUpgradeDescription.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. - * - * - * @param {number} - * [applicationUpgradeDescription.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} - * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] + * Indicates that supplied container registry password is encrypted. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -32978,11 +57834,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startApplicationUpgradeWithHttpOperationResponse(applicationId, applicationUpgradeDescription, options) { + createComposeDeploymentWithHttpOperationResponse(createComposeDeploymentDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { + self._createComposeDeployment(createComposeDeploymentDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -32993,138 +57849,144 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Starts upgrading an application in the Service Fabric cluster. - * - * Validates the supplied application upgrade parameters and starts upgrading - * the application if the parameters are valid. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @summary Creates a Service Fabric compose deployment. * - * @param {object} applicationUpgradeDescription Parameters for an application - * upgrade. + * Compose is a file format that describes multi-container applications. This + * API allows deploying container based applications defined in compose format + * in a Service Fabric cluster. Once the deployment is created, its status can + * be tracked via the `GetComposeDeploymentStatus` API. * - * @param {string} applicationUpgradeDescription.name + * @param {object} createComposeDeploymentDescription Describes the compose + * deployment that needs to be created. * - * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion + * @param {string} createComposeDeploymentDescription.deploymentName The name + * of the deployment. * - * @param {array} applicationUpgradeDescription.parameters + * @param {string} createComposeDeploymentDescription.composeFileContent The + * content of the compose file that describes the deployment to create. * - * @param {string} applicationUpgradeDescription.upgradeKind Possible values - * include: 'Invalid', 'Rolling' + * @param {object} [createComposeDeploymentDescription.registryCredential] + * Credential information to connect to container registry. * - * @param {string} [applicationUpgradeDescription.rollingUpgradeMode] Possible - * values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @param {string} + * [createComposeDeploymentDescription.registryCredential.registryUserName] The + * user name to connect to container registry. * - * @param {number} - * [applicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * @param {string} + * [createComposeDeploymentDescription.registryCredential.registryPassword] The + * password for supplied username to connect to container registry. * - * @param {boolean} [applicationUpgradeDescription.forceRestart] + * @param {boolean} + * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] + * Indicates that supplied container registry password is encrypted. * - * @param {object} [applicationUpgradeDescription.monitoringPolicy] + * @param {object} [options] Optional Parameters. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.failureAction] Possible - * values include: 'Invalid', 'Rollback', 'Manual' + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * {Promise} A promise is returned * - * @param {string} - * [applicationUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * @resolve {null} - The deserialized result object. * - * @param {object} [applicationUpgradeDescription.applicationHealthPolicy] + * @reject {Error} - The error object. * - * @param {boolean} - * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * {function} optionalCallback(err, result, request, response) * - * @param {number} - * [applicationUpgradeDescription.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. + * {Error} err - The Error object if an error occurred, null otherwise. * + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {object} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {number} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createComposeDeployment(createComposeDeploymentDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback); + } + } + + /** + * @summary Gets information about a Service Fabric compose deployment. * - * 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. + * Returns the status of the compose deployment that was created or in the + * process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * status, and other details about the deployment. * + * @param {string} deploymentName The identity of the deployment. * - * @param {number} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * @param {object} [options] Optional Parameters. * - * 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 {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * @returns {Promise} A promise is returned * - * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * + * @reject {Error} - The error object. + */ + getComposeDeploymentStatusWithHttpOperationResponse(deploymentName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getComposeDeploymentStatus(deploymentName, 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 information about a Service Fabric compose deployment. * - * @param {array} - * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * Returns the status of the compose deployment that was created or in the + * process of being created in the Service Fabric cluster and whose name + * matches the one specified as the parameter. The response includes the name, + * status, and other details about the deployment. + * + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33136,7 +57998,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ComposeDeploymentStatusInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -33144,13 +58006,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ComposeDeploymentStatusInfo} 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. */ - startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, optionalCallback) { + getComposeDeploymentStatus(deploymentName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -33159,51 +58023,65 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { + self._getComposeDeploymentStatus(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, optionalCallback); + return self._getComposeDeploymentStatus(deploymentName, options, optionalCallback); } } /** - * @summary Gets details for the latest upgrade performed on this application. - * - * Returns information about the state of the latest application upgrade along - * with details to aid debugging application health issues. + * @summary Gets the list of compose deployments created in the Service Fabric + * cluster. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * Gets the status about the compose deployments that were created or in the + * process of being created in the Service Fabric cluster. The response + * includes the name, status, and other details about the compose deployments. + * If the list of deployments do not fit in a page, one page of results is + * returned as well as a continuation token, which can be used to get the next + * page. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationUpgradeWithHttpOperationResponse(applicationId, options) { + getComposeDeploymentStatusListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationUpgrade(applicationId, options, (err, result, request, response) => { + self._getComposeDeploymentStatusList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -33214,24 +58092,38 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets details for the latest upgrade performed on this application. - * - * Returns information about the state of the latest application upgrade along - * with details to aid debugging application health issues. + * @summary Gets the list of compose deployments created in the Service Fabric + * cluster. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * Gets the status about the compose deployments that were created or in the + * process of being created in the Service Fabric cluster. The response + * includes the name, status, and other details about the compose deployments. + * If the list of deployments do not fit in a page, one page of results is + * returned as well as a continuation token, which can be used to get the next + * page. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33243,7 +58135,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationUpgradeProgressInfo} - The deserialized result object. + * @resolve {PagedComposeDeploymentStatusInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -33252,14 +58144,14 @@ class ServiceFabricClient extends ServiceClient { * {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 ApplicationUpgradeProgressInfo} for more - * information. + * See {@link PagedComposeDeploymentStatusInfoList} 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. */ - getApplicationUpgrade(applicationId, options, optionalCallback) { + getComposeDeploymentStatusList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -33268,167 +58160,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationUpgrade(applicationId, options, (err, result, request, response) => { + self._getComposeDeploymentStatusList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationUpgrade(applicationId, options, optionalCallback); + return self._getComposeDeploymentStatusList(options, optionalCallback); } } /** - * @summary Updates an ongoing application upgrade in the Service Fabric - * cluster. - * - * Updates the parameters of an ongoing application upgrade from the ones - * specified at the time of starting the application upgrade. This may be - * required to mitigate stuck application upgrades due to incorrect parameters - * or issues in the application to make progress. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} applicationUpgradeUpdateDescription Parameters for updating - * an existing application upgrade. - * - * @param {string} applicationUpgradeUpdateDescription.name - * - * @param {string} applicationUpgradeUpdateDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' - * - * @param {object} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy] - * - * @param {boolean} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [applicationUpgradeUpdateDescription.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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [applicationUpgradeUpdateDescription.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} - * [applicationUpgradeUpdateDescription.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. - * - * - * @param {number} - * [applicationUpgradeUpdateDescription.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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * - * @param {object} [applicationUpgradeUpdateDescription.updateDescription] - * - * @param {string} - * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {boolean} - * [applicationUpgradeUpdateDescription.updateDescription.forceRestart] - * - * @param {number} - * [applicationUpgradeUpdateDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.healthCheckWaitDurationInMilliseconds] - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.healthCheckStableDurationInMilliseconds] - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * @summary Gets details for the latest upgrade performed on this Service + * Fabric compose deployment. * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.upgradeTimeoutInMilliseconds] + * Returns the information about the state of the compose deployment upgrade + * along with details to aid debugging application health issues. * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateApplicationUpgradeWithHttpOperationResponse(applicationId, applicationUpgradeUpdateDescription, options) { + getComposeDeploymentUpgradeProgressWithHttpOperationResponse(deploymentName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, (err, result, request, response) => { + self._getComposeDeploymentUpgradeProgress(deploymentName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -33439,140 +58211,20 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Updates an ongoing application upgrade in the Service Fabric - * cluster. - * - * Updates the parameters of an ongoing application upgrade from the ones - * specified at the time of starting the application upgrade. This may be - * required to mitigate stuck application upgrades due to incorrect parameters - * or issues in the application to make progress. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} applicationUpgradeUpdateDescription Parameters for updating - * an existing application upgrade. - * - * @param {string} applicationUpgradeUpdateDescription.name - * - * @param {string} applicationUpgradeUpdateDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' - * - * @param {object} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy] - * - * @param {boolean} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [applicationUpgradeUpdateDescription.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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [applicationUpgradeUpdateDescription.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} - * [applicationUpgradeUpdateDescription.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. - * - * - * @param {number} - * [applicationUpgradeUpdateDescription.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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * - * @param {object} [applicationUpgradeUpdateDescription.updateDescription] - * - * @param {string} - * applicationUpgradeUpdateDescription.updateDescription.rollingUpgradeMode - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {boolean} - * [applicationUpgradeUpdateDescription.updateDescription.forceRestart] - * - * @param {number} - * [applicationUpgradeUpdateDescription.updateDescription.replicaSetCheckTimeoutInMilliseconds] - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.healthCheckWaitDurationInMilliseconds] - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.healthCheckStableDurationInMilliseconds] - * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * @summary Gets details for the latest upgrade performed on this Service + * Fabric compose deployment. * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.upgradeTimeoutInMilliseconds] + * Returns the information about the state of the compose deployment upgrade + * along with details to aid debugging application health issues. * - * @param {string} - * [applicationUpgradeUpdateDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33584,7 +58236,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ComposeDeploymentUpgradeProgressInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -33592,13 +58244,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ComposeDeploymentUpgradeProgressInfo} 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. */ - updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, optionalCallback) { + getComposeDeploymentUpgradeProgress(deploymentName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -33607,44 +58261,30 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, (err, result, request, response) => { + self._getComposeDeploymentUpgradeProgress(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, optionalCallback); + return self._getComposeDeploymentUpgradeProgress(deploymentName, options, optionalCallback); } } /** - * @summary Resumes upgrading an application in the Service Fabric cluster. - * - * Resumes an unmonitored manual Service Fabric application upgrade. Service - * Fabric upgrades one upgrade domain at a time. For unmonitored manual - * upgrades, after Service Fabric finishes an upgrade domain, it waits for you - * to call this API before proceeding to the next upgrade domain. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @summary Deletes an existing Service Fabric compose deployment from cluster. * - * @param {object} resumeApplicationUpgradeDescription Describes the parameters - * for resuming an application upgrade. + * Deletes an existing Service Fabric compose deployment. * - * @param {string} resumeApplicationUpgradeDescription.upgradeDomainName The - * name of the upgrade domain in which to resume the upgrade. + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33655,11 +58295,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - resumeApplicationUpgradeWithHttpOperationResponse(applicationId, resumeApplicationUpgradeDescription, options) { + removeComposeDeploymentWithHttpOperationResponse(deploymentName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, (err, result, request, response) => { + self._removeComposeDeployment(deploymentName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -33670,32 +58310,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resumes upgrading an application in the Service Fabric cluster. - * - * Resumes an unmonitored manual Service Fabric application upgrade. Service - * Fabric upgrades one upgrade domain at a time. For unmonitored manual - * upgrades, after Service Fabric finishes an upgrade domain, it waits for you - * to call this API before proceeding to the next upgrade domain. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @summary Deletes an existing Service Fabric compose deployment from cluster. * - * @param {object} resumeApplicationUpgradeDescription Describes the parameters - * for resuming an application upgrade. + * Deletes an existing Service Fabric compose deployment. * - * @param {string} resumeApplicationUpgradeDescription.upgradeDomainName The - * name of the upgrade domain in which to resume the upgrade. + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33721,7 +58347,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, optionalCallback) { + removeComposeDeployment(deploymentName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -33730,40 +58356,201 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, (err, result, request, response) => { + self._removeComposeDeployment(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, optionalCallback); + return self._removeComposeDeployment(deploymentName, options, optionalCallback); } } /** - * @summary Starts rolling back the currently on-going upgrade of an - * application in the Service Fabric cluster. + * @summary Starts upgrading a compose deployment in the Service Fabric + * cluster. + * + * Validates the supplied upgrade parameters and starts upgrading the + * deployment if the parameters are valid. + * + * @param {string} deploymentName The identity of the deployment. + * + * @param {object} composeDeploymentUpgradeDescription Parameters for upgrading + * compose deployment. + * + * @param {string} composeDeploymentUpgradeDescription.deploymentName The name + * of the deployment. + * + * @param {string} composeDeploymentUpgradeDescription.composeFileContent The + * content of the compose file that describes the deployment to create. + * + * @param {object} [composeDeploymentUpgradeDescription.registryCredential] + * Credential information to connect to container registry. + * + * @param {string} + * [composeDeploymentUpgradeDescription.registryCredential.registryUserName] + * The user name to connect to container registry. + * + * @param {string} + * [composeDeploymentUpgradeDescription.registryCredential.registryPassword] + * The password for supplied username to connect to container registry. + * + * @param {boolean} + * [composeDeploymentUpgradeDescription.registryCredential.passwordEncrypted] + * Indicates that supplied container registry password is encrypted. + * + * @param {string} composeDeploymentUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {number} + * [composeDeploymentUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * 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} [composeDeploymentUpgradeDescription.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} [composeDeploymentUpgradeDescription.monitoringPolicy] + * Describes the parameters for monitoring an upgrade in Monitored mode. + * + * @param {string} + * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * @param {boolean} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [composeDeploymentUpgradeDescription.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} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [composeDeploymentUpgradeDescription.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} + * [composeDeploymentUpgradeDescription.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. * - * Starts rolling back the current application upgrade to the previous version. - * This API can only be used to rollback the current in-progress upgrade that - * is rolling forward to new version. If the application is not currently being - * upgraded use StartApplicationUpgrade API to upgrade it to desired version - * including rolling back to a previous version. + * @param {number} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum maximum allowed percentage of unhealthy services. Allowed values + * are Byte values from zero to 100. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * 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} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33774,11 +58561,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - rollbackApplicationUpgradeWithHttpOperationResponse(applicationId, options) { + startComposeDeploymentUpgradeWithHttpOperationResponse(deploymentName, composeDeploymentUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._rollbackApplicationUpgrade(applicationId, options, (err, result, request, response) => { + self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -33789,28 +58576,189 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Starts rolling back the currently on-going upgrade of an - * application in the Service Fabric cluster. + * @summary Starts upgrading a compose deployment in the Service Fabric + * cluster. * - * Starts rolling back the current application upgrade to the previous version. - * This API can only be used to rollback the current in-progress upgrade that - * is rolling forward to new version. If the application is not currently being - * upgraded use StartApplicationUpgrade API to upgrade it to desired version - * including rolling back to a previous version. + * Validates the supplied upgrade parameters and starts upgrading the + * deployment if the parameters are valid. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} deploymentName The identity of the deployment. + * + * @param {object} composeDeploymentUpgradeDescription Parameters for upgrading + * compose deployment. + * + * @param {string} composeDeploymentUpgradeDescription.deploymentName The name + * of the deployment. + * + * @param {string} composeDeploymentUpgradeDescription.composeFileContent The + * content of the compose file that describes the deployment to create. + * + * @param {object} [composeDeploymentUpgradeDescription.registryCredential] + * Credential information to connect to container registry. + * + * @param {string} + * [composeDeploymentUpgradeDescription.registryCredential.registryUserName] + * The user name to connect to container registry. + * + * @param {string} + * [composeDeploymentUpgradeDescription.registryCredential.registryPassword] + * The password for supplied username to connect to container registry. + * + * @param {boolean} + * [composeDeploymentUpgradeDescription.registryCredential.passwordEncrypted] + * Indicates that supplied container registry password is encrypted. + * + * @param {string} composeDeploymentUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' + * + * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] The + * mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: + * 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + * + * @param {number} + * [composeDeploymentUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * 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} [composeDeploymentUpgradeDescription.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} [composeDeploymentUpgradeDescription.monitoringPolicy] + * Describes the parameters for monitoring an upgrade in Monitored mode. + * + * @param {string} + * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] The + * compensating action to perform when a Monitored upgrade encounters + * monitoring policy or health policy violations. + * Invalid indicates the failure action is invalid. Rollback specifies that the + * upgrade will start rolling back automatically. + * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade + * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' + * + * @param {string} + * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * 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} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * @param {boolean} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [composeDeploymentUpgradeDescription.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} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [composeDeploymentUpgradeDescription.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} + * [composeDeploymentUpgradeDescription.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. + * + * @param {number} + * [composeDeploymentUpgradeDescription.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} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33836,7 +58784,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - rollbackApplicationUpgrade(applicationId, options, optionalCallback) { + startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -33845,45 +58793,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._rollbackApplicationUpgrade(applicationId, options, (err, result, request, response) => { + self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._rollbackApplicationUpgrade(applicationId, options, optionalCallback); + return self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, optionalCallback); } } /** - * @summary Gets the list of applications deployed on a Service Fabric node. + * @summary Get the status of Chaos. * - * Gets the list of applications deployed on a Service Fabric node. - * - * @param {string} nodeName The name of the node. + * Get the status of Chaos indicating whether or not Chaos is running, the + * Chaos parameters used for running Chaos and the status of the Chaos + * Schedule. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedApplicationInfoListWithHttpOperationResponse(nodeName, options) { + getChaosWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedApplicationInfoList(nodeName, options, (err, result, request, response) => { + self._getChaos(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -33894,18 +58842,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of applications deployed on a Service Fabric node. + * @summary Get the status of Chaos. * - * Gets the list of applications deployed on a Service Fabric node. - * - * @param {string} nodeName The name of the node. + * Get the status of Chaos indicating whether or not Chaos is running, the + * Chaos parameters used for running Chaos and the status of the Chaos + * Schedule. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -33917,7 +58865,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {Chaos} - The deserialized result object. * * @reject {Error} - The error object. * @@ -33925,13 +58873,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Chaos} 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. */ - getDeployedApplicationInfoList(nodeName, options, optionalCallback) { + getChaos(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -33940,53 +58889,207 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedApplicationInfoList(nodeName, options, (err, result, request, response) => { + self._getChaos(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedApplicationInfoList(nodeName, options, optionalCallback); + return self._getChaos(options, optionalCallback); } } /** - * @summary Gets the information about an application deployed on a Service - * Fabric node. + * @summary Starts Chaos in the cluster. * - * Gets the information about an application deployed on a Service Fabric node. + * If Chaos is not already running in the cluster, it starts Chaos with the + * passed in Chaos parameters. + * If Chaos is already running when this call is made, the call fails with the + * error code FABRIC_E_CHAOS_ALREADY_RUNNING. + * Refer to the article [Induce controlled Chaos in Service Fabric + * clusters](https://docs.microsoft.com/azure/service-fabric/service-fabric-controlled-chaos) + * for more details. * - * @param {string} nodeName The name of the node. + * @param {object} chaosParameters Describes all the parameters to configure a + * Chaos run. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} [chaosParameters.timeToRunInSeconds] Total time (in seconds) + * for which Chaos will run before automatically stopping. The maximum allowed + * value is 4,294,967,295 (System.UInt32.MaxValue). + * + * @param {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] + * The maximum amount of time to wait for all cluster entities to become stable + * and healthy. Chaos executes in iterations and at the start of each iteration + * it validates the health of cluster entities. + * During validation if a cluster entity is not stable and healthy within + * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed + * event. + * + * @param {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults is + * the maximum number of concurrent faults induced per iteration. + * Chaos executes in iterations and two consecutive iterations are separated by + * a validation phase. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. + * The recommendation is to start with a value of 2 or 3 and to exercise + * caution while moving up. + * + * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or + * disables the move primary and move secondary faults. + * + * @param {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait time + * (in seconds) between consecutive faults within a single iteration. + * The larger the value, the lower the overlapping between faults and the + * simpler the sequence of state transitions that the cluster goes through. + * The recommendation is to start with a value between 1 and 5 and exercise + * caution while moving up. + * + * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] + * Time-separation (in seconds) between two consecutive iterations of Chaos. + * The larger the value, the lower the fault injection rate. + * + * @param {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected exception + * happens during fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. + * + * @param {boolean} + * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates + * whether warnings are treated with the same severity as errors. + * + * @param {number} + * [chaosParameters.clusterHealthPolicy.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} + * [chaosParameters.clusterHealthPolicy.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 {array} + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used to + * record information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * + * @param {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. + * + * @param {object} [chaosParameters.chaosTargetFilter] List of cluster entities + * to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * + * @param {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] A + * list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * + * @param {array} [chaosParameters.chaosTargetFilter.applicationInclusionList] + * A list of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedApplicationInfoWithHttpOperationResponse(nodeName, applicationId, options) { + startChaosWithHttpOperationResponse(chaosParameters, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedApplicationInfo(nodeName, applicationId, options, (err, result, request, response) => { + self._startChaos(chaosParameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -33997,26 +59100,180 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about an application deployed on a Service - * Fabric node. + * @summary Starts Chaos in the cluster. * - * Gets the information about an application deployed on a Service Fabric node. + * If Chaos is not already running in the cluster, it starts Chaos with the + * passed in Chaos parameters. + * If Chaos is already running when this call is made, the call fails with the + * error code FABRIC_E_CHAOS_ALREADY_RUNNING. + * Refer to the article [Induce controlled Chaos in Service Fabric + * clusters](https://docs.microsoft.com/azure/service-fabric/service-fabric-controlled-chaos) + * for more details. * - * @param {string} nodeName The name of the node. + * @param {object} chaosParameters Describes all the parameters to configure a + * Chaos run. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} [chaosParameters.timeToRunInSeconds] Total time (in seconds) + * for which Chaos will run before automatically stopping. The maximum allowed + * value is 4,294,967,295 (System.UInt32.MaxValue). + * + * @param {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] + * The maximum amount of time to wait for all cluster entities to become stable + * and healthy. Chaos executes in iterations and at the start of each iteration + * it validates the health of cluster entities. + * During validation if a cluster entity is not stable and healthy within + * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed + * event. + * + * @param {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults is + * the maximum number of concurrent faults induced per iteration. + * Chaos executes in iterations and two consecutive iterations are separated by + * a validation phase. + * The higher the concurrency, the more aggressive the injection of faults, + * leading to inducing more complex series of states to uncover bugs. + * The recommendation is to start with a value of 2 or 3 and to exercise + * caution while moving up. + * + * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or + * disables the move primary and move secondary faults. + * + * @param {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait time + * (in seconds) between consecutive faults within a single iteration. + * The larger the value, the lower the overlapping between faults and the + * simpler the sequence of state transitions that the cluster goes through. + * The recommendation is to start with a value between 1 and 5 and exercise + * caution while moving up. + * + * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] + * Time-separation (in seconds) between two consecutive iterations of Chaos. + * The larger the value, the lower the fault injection rate. + * + * @param {object} [chaosParameters.clusterHealthPolicy] Passed-in cluster + * health policy is used to validate health of the cluster in between Chaos + * iterations. If the cluster health is in error or if an unexpected exception + * happens during fault execution--to provide the cluster with some time to + * recuperate--Chaos will wait for 30 minutes before the next health-check. + * + * @param {boolean} + * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates + * whether warnings are treated with the same severity as errors. + * + * @param {number} + * [chaosParameters.clusterHealthPolicy.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} + * [chaosParameters.clusterHealthPolicy.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 {array} + * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] Defines + * a map with max percentage unhealthy applications for specific application + * types. + * Each entry specifies as key the application type name and as value an + * integer that represents the MaxPercentUnhealthyApplications percentage used + * to evaluate the applications of the specified application type. + * + * The application type health policy map can be used during cluster health + * evaluation to describe special application types. + * The application types included in the map are evaluated against the + * percentage specified in the map, and not with the global + * MaxPercentUnhealthyApplications defined in the cluster health policy. + * The applications of application types specified in the map are not counted + * against the global pool of applications. + * For example, if some applications of a type are critical, the cluster + * administrator can add an entry to the map for that application type + * and assign it a value of 0% (that is, do not tolerate any failures). + * All other applications can be evaluated with MaxPercentUnhealthyApplications + * set to 20% to tolerate some failures out of the thousands of application + * instances. + * The application type health policy map is used only if the cluster manifest + * enables application type health evaluation using the configuration entry for + * HealthManager/EnableApplicationTypeHealthEvaluation. + * + * @param {object} [chaosParameters.context] Describes a map, which is a + * collection of (string, string) type key-value pairs. The map can be used to + * record information about + * the Chaos run. There cannot be more than 100 such pairs and each string (key + * or value) can be at most 4095 characters long. + * This map is set by the starter of the Chaos run to optionally store the + * context about the specific run. + * + * @param {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. + * + * @param {object} [chaosParameters.chaosTargetFilter] List of cluster entities + * to target for Chaos faults. + * This filter can be used to target Chaos faults only to certain node types or + * only to certain application instances. If ChaosTargetFilter is not used, + * Chaos faults all cluster entities. + * If ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter specification. + * + * @param {array} [chaosParameters.chaosTargetFilter.nodeTypeInclusionList] A + * list of node types to include in Chaos faults. + * All types of faults (restart node, restart code package, remove replica, + * restart replica, move primary, and move secondary) are enabled for the nodes + * of these node types. + * If a nodetype (say NodeTypeX) does not appear in the NodeTypeInclusionList, + * then node level faults (like NodeRestart) will never be enabled for the + * nodes of + * NodeTypeX, but code package and replica faults can still be enabled for + * NodeTypeX if an application in the ApplicationInclusionList. + * happens to reside on a node of NodeTypeX. + * At most 100 node type names can be included in this list, to increase this + * number, a config upgrade is required for + * MaxNumberOfNodeTypesInChaosEntityFilter configuration. + * + * @param {array} [chaosParameters.chaosTargetFilter.applicationInclusionList] + * A list of application URI's to include in Chaos faults. + * All replicas belonging to services of these applications are amenable to + * replica faults (restart replica, remove replica, move primary, and move + * secondary) by Chaos. + * Chaos may restart a code package only if the code package hosts replicas of + * these applications only. + * If an application does not appear in this list, it can still be faulted in + * some Chaos iteration if the application ends up on a node of a node type + * that is included in NodeTypeInclusionList. + * However, if applicationX is tied to nodeTypeY through placement constraints + * and applicationX is absent from ApplicationInclusionList and nodeTypeY is + * absent from NodeTypeInclusionList, then applicationX will never be faulted. + * At most 1000 application names can be included in this list, to increase + * this number, a config upgrade is required for + * MaxNumberOfApplicationsInChaosEntityFilter configuration. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -34028,7 +59285,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedApplicationInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -34036,15 +59293,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 DeployedApplicationInfo} 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. */ - getDeployedApplicationInfo(nodeName, applicationId, options, optionalCallback) { + startChaos(chaosParameters, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -34053,205 +59308,75 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedApplicationInfo(nodeName, applicationId, options, (err, result, request, response) => { + self._startChaos(chaosParameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedApplicationInfo(nodeName, applicationId, options, optionalCallback); + return self._startChaos(chaosParameters, options, optionalCallback); } } /** - * @summary Gets the information about health of an application deployed on a - * Service Fabric node. - * - * Gets the information about health of an application deployed on a Service - * Fabric node. Use EventsHealthStateFilter to optionally filter for the - * collection of HealthEvent objects reported on the deployed application based - * on health state. Use DeployedServicePackagesHealthStateFilter to optionally - * filter for DeployedServicePackageHealth children based on health state. - * - * @param {string} nodeName The name of the node. + * @summary Stops Chaos if it is running in the cluster and put the Chaos + * Schedule in a stopped state. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * Stops Chaos from executing new faults. In-flight faults will continue to + * execute until they are complete. The current Chaos Schedule is put into a + * stopped state. + * Once a schedule is stopped, it will stay in the stopped state and not be + * used to Chaos Schedule new runs of Chaos. A new Chaos Schedule must be set + * in order to resume scheduling. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows - * filtering of the deployed service package health state objects returned in - * the result of deployed application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only deployed service packages that match the filter are returned. All - * deployed service packages are used to evaluate the aggregated health state - * of the deployed application. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of service - * packages with HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedApplicationHealthWithHttpOperationResponse(nodeName, applicationId, options) { + stopChaosWithHttpOperationResponse(options) { let client = this; let self = this; - return new Promise((resolve, reject) => { - self._getDeployedApplicationHealth(nodeName, applicationId, 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 information about health of an application deployed on a - * Service Fabric node. - * - * Gets the information about health of an application deployed on a Service - * Fabric node. Use EventsHealthStateFilter to optionally filter for the - * collection of HealthEvent objects reported on the deployed application based - * on health state. Use DeployedServicePackagesHealthStateFilter to optionally - * filter for DeployedServicePackageHealth children based on health state. - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows - * filtering of the deployed service package health state objects returned in - * the result of deployed application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only deployed service packages that match the filter are returned. All - * deployed service packages are used to evaluate the aggregated health state - * of the deployed application. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of service - * packages with HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * + return new Promise((resolve, reject) => { + self._stopChaos(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stops Chaos if it is running in the cluster and put the Chaos + * Schedule in a stopped state. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * Stops Chaos from executing new faults. In-flight faults will continue to + * execute until they are complete. The current Chaos Schedule is put into a + * stopped state. + * Once a schedule is stopped, it will stay in the stopped state and not be + * used to Chaos Schedule new runs of Chaos. A new Chaos Schedule must be set + * in order to resume scheduling. * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -34263,7 +59388,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedApplicationHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -34271,15 +59396,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 DeployedApplicationHealth} 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. */ - getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback) { + stopChaos(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -34288,195 +59411,80 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedApplicationHealth(nodeName, applicationId, options, (err, result, request, response) => { + self._stopChaos(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback); + return self._stopChaos(options, optionalCallback); } } /** - * @summary Gets the information about health of an application deployed on a - * Service Fabric node. using the specified policy. - * - * Gets the information about health of an application deployed on a Service - * Fabric node using the specified policy. Use EventsHealthStateFilter to - * optionally filter for the collection of HealthEvent objects reported on the - * deployed application based on health state. Use - * DeployedServicePackagesHealthStateFilter to optionally filter for - * DeployedServicePackageHealth children based on health state. Use - * ApplicationHealthPolicy to optionally override the health policies used to - * evaluate the health. This API only uses 'ConsiderWarningAsError' field of - * the ApplicationHealthPolicy. The rest of the fields are ignored while - * evaluating the health of the deployed application. - * - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @summary Gets the next segment of the Chaos events based on the continuation + * token or the time range. + * + * To get the next segment of the Chaos events, you can specify the + * ContinuationToken. To get the start of a new segment of Chaos events, you + * can specify the time range + * through StartTimeUtc and EndTimeUtc. You cannot specify both the + * ContinuationToken and the time range in the same call. + * When there are more than 100 Chaos events, the Chaos events are returned in + * multiple segments where a segment contains no more than 100 Chaos events and + * to get the next segment you make a call to this API with the continuation + * token. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows - * filtering of the deployed service package health state objects returned in - * the result of deployed application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only deployed service packages that match the filter are returned. All - * deployed service packages are used to evaluate the aggregated health state - * of the deployed application. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of service - * packages with HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. - * - * - * @param {number} - * [options.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} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} [options.startTimeUtc] The Windows file time representing + * the start time of the time range for which a Chaos report is to be + * generated. Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {string} [options.endTimeUtc] The Windows file time representing the + * end time of the time range for which a Chaos report is to be generated. + * Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedApplicationHealthUsingPolicyWithHttpOperationResponse(nodeName, applicationId, options) { + getChaosEventsWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, (err, result, request, response) => { + self._getChaosEvents(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -34487,168 +59495,53 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about health of an application deployed on a - * Service Fabric node. using the specified policy. - * - * Gets the information about health of an application deployed on a Service - * Fabric node using the specified policy. Use EventsHealthStateFilter to - * optionally filter for the collection of HealthEvent objects reported on the - * deployed application based on health state. Use - * DeployedServicePackagesHealthStateFilter to optionally filter for - * DeployedServicePackageHealth children based on health state. Use - * ApplicationHealthPolicy to optionally override the health policies used to - * evaluate the health. This API only uses 'ConsiderWarningAsError' field of - * the ApplicationHealthPolicy. The rest of the fields are ignored while - * evaluating the health of the deployed application. - * - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @summary Gets the next segment of the Chaos events based on the continuation + * token or the time range. + * + * To get the next segment of the Chaos events, you can specify the + * ContinuationToken. To get the start of a new segment of Chaos events, you + * can specify the time range + * through StartTimeUtc and EndTimeUtc. You cannot specify both the + * ContinuationToken and the time range in the same call. + * When there are more than 100 Chaos events, the Chaos events are returned in + * multiple segments where a segment contains no more than 100 Chaos events and + * to get the next segment you make a call to this API with the continuation + * token. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.deployedServicePackagesHealthStateFilter] Allows - * filtering of the deployed service package health state objects returned in - * the result of deployed application health query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only deployed service packages that match the filter are returned. All - * deployed service packages are used to evaluate the aggregated health state - * of the deployed application. - * If not specified, all entries are returned. - * The state values are flag based enumeration, so the value can be a - * combination of these value obtained using bitwise 'OR' operator. - * For example, if the provided value is 6 then health state of service - * packages with HealthState value of OK (2) and Warning (4) are returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. - * - * - * @param {number} - * [options.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} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} [options.startTimeUtc] The Windows file time representing + * the start time of the time range for which a Chaos report is to be + * generated. Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {string} [options.endTimeUtc] The Windows file time representing the + * end time of the time range for which a Chaos report is to be generated. + * Consult [DateTime.ToFileTimeUtc + * Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) + * for details. * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -34660,7 +59553,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedApplicationHealth} - The deserialized result object. + * @resolve {ChaosEventsSegment} - The deserialized result object. * * @reject {Error} - The error object. * @@ -34669,14 +59562,13 @@ class ServiceFabricClient extends ServiceClient { * {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 DeployedApplicationHealth} for more - * information. + * See {@link ChaosEventsSegment} 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. */ - getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback) { + getChaosEvents(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -34685,159 +59577,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, (err, result, request, response) => { + self._getChaosEvents(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback); + return self._getChaosEvents(options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric application deployed on - * a Service Fabric node. - * - * Reports health state of the application deployed on a Service Fabric node. - * The report must contain the information about the source of the health - * report and property on which it is reported. - * The report is sent to a Service Fabric gateway Service, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, get deployed - * application health and check that the report appears in the HealthEvents - * section. - * - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. - * - * If not specified, time to live defaults to infinite value. - * - * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. - * - * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. - * - * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @summary Get the Chaos Schedule defining when and how to run Chaos. * + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that + * defines when and how to run Chaos. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - reportDeployedApplicationHealthWithHttpOperationResponse(nodeName, applicationId, healthInformation, options) { + getChaosScheduleWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, (err, result, request, response) => { + self._getChaosSchedule(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -34848,132 +59625,158 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric application deployed on - * a Service Fabric node. + * @summary Get the Chaos Schedule defining when and how to run Chaos. * - * Reports health state of the application deployed on a Service Fabric node. - * The report must contain the information about the source of the health - * report and property on which it is reported. - * The report is sent to a Service Fabric gateway Service, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, get deployed - * application health and check that the report appears in the HealthEvents - * section. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that + * defines when and how to run Chaos. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @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 {ChaosScheduleDescription} - 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 ChaosScheduleDescription} 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. + */ + getChaosSchedule(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getChaosSchedule(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getChaosSchedule(options, optionalCallback); + } + } + + /** + * @summary Set the schedule used by Chaos. * + * Chaos will automatically schedule runs based on the Chaos Schedule. + * The Chaos Schedule will be updated if the provided version matches the + * version on the server. + * When updating the Chaos Schedule, the version on the server is incremented + * by 1. + * The version on the server will wrap back to 0 after reaching a large number. + * If Chaos is running when this call is made, the call will fail. * - * @param {string} nodeName The name of the node. + * @param {object} chaosSchedule Describes the schedule used by Chaos. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {number} [chaosSchedule.version] The version number of the Schedule. * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. + * @param {object} [chaosSchedule.schedule] Defines the schedule used by Chaos. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. + * @param {date} [chaosSchedule.schedule.startDate] The date and time Chaos + * will start using this schedule. * + * @param {date} [chaosSchedule.schedule.expiryDate] The date and time Chaos + * will continue to use this schedule until. * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. + * @param {array} [chaosSchedule.schedule.chaosParametersDictionary] A mapping + * of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. * - * Together with the SourceId, the property uniquely identifies the health - * information. + * @param {array} [chaosSchedule.schedule.jobs] A list of all Chaos Schedule + * Jobs that will be automated by the schedule. * + * @param {object} [options] Optional Parameters. * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * If not specified, time to live defaults to infinite value. + * @returns {Promise} A promise is returned * + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * @reject {Error} - The error object. + */ + postChaosScheduleWithHttpOperationResponse(chaosSchedule, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._postChaosSchedule(chaosSchedule, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Set the schedule used by Chaos. * + * Chaos will automatically schedule runs based on the Chaos Schedule. + * The Chaos Schedule will be updated if the provided version matches the + * version on the server. + * When updating the Chaos Schedule, the version on the server is incremented + * by 1. + * The version on the server will wrap back to 0 after reaching a large number. + * If Chaos is running when this call is made, the call will fail. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @param {object} chaosSchedule Describes the schedule used by Chaos. * + * @param {number} [chaosSchedule.version] The version number of the Schedule. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {object} [chaosSchedule.schedule] Defines the schedule used by Chaos. * + * @param {date} [chaosSchedule.schedule.startDate] The date and time Chaos + * will start using this schedule. * - * @param {object} [options] Optional Parameters. + * @param {date} [chaosSchedule.schedule.expiryDate] The date and time Chaos + * will continue to use this schedule until. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. + * @param {array} [chaosSchedule.schedule.chaosParametersDictionary] A mapping + * of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. * + * @param {array} [chaosSchedule.schedule.jobs] A list of all Chaos Schedule + * Jobs that will be automated by the schedule. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -34999,7 +59802,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, optionalCallback) { + postChaosSchedule(chaosSchedule, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35008,48 +59811,56 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, (err, result, request, response) => { + self._postChaosSchedule(chaosSchedule, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, optionalCallback); + return self._postChaosSchedule(chaosSchedule, options, optionalCallback); } } /** - * @summary Gets the manifest describing an application type. - * - * Gets the manifest describing an application type. The response contains the - * application manifest XML as a string. + * @summary Uploads contents of the file to the image store. * - * @param {string} applicationTypeName The name of the application type. + * Uploads contents of the file to the image store. Use this API if the file is + * small enough to upload again if the connection fails. The file's data needs + * to be added to the request body. The contents will be uploaded to the + * specified path. Image store service uses a mark file to indicate the + * availability of the folder. The mark file is an empty file named "_.dir". + * The mark file is generated by the image store service when all files in a + * folder are uploaded. When using File-by-File approach to upload application + * package in REST, the image store service isn't aware of the file hierarchy + * of the application package; you need to create a mark file per folder and + * upload it last, to let the image store service know that the folder is + * complete. * - * @param {string} applicationTypeVersion The version of the application type. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationManifestWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, options) { + uploadFileWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._uploadFile(contentPath, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -35060,21 +59871,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the manifest describing an application type. - * - * Gets the manifest describing an application type. The response contains the - * application manifest XML as a string. + * @summary Uploads contents of the file to the image store. * - * @param {string} applicationTypeName The name of the application type. + * Uploads contents of the file to the image store. Use this API if the file is + * small enough to upload again if the connection fails. The file's data needs + * to be added to the request body. The contents will be uploaded to the + * specified path. Image store service uses a mark file to indicate the + * availability of the folder. The mark file is an empty file named "_.dir". + * The mark file is generated by the image store service when all files in a + * folder are uploaded. When using File-by-File approach to upload application + * package in REST, the image store service isn't aware of the file hierarchy + * of the application package; you need to create a mark file per folder and + * upload it last, to let the image store service know that the folder is + * complete. * - * @param {string} applicationTypeVersion The version of the application type. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35086,7 +59905,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationTypeManifest} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -35094,15 +59913,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ApplicationTypeManifest} 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. */ - getApplicationManifest(applicationTypeName, applicationTypeVersion, options, optionalCallback) { + uploadFile(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35111,63 +59928,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._uploadFile(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, optionalCallback); + return self._uploadFile(contentPath, options, optionalCallback); } } /** - * @summary Gets the information about all services belonging to the - * application specified by the application id. + * @summary Gets the image store content information. * - * Returns the information about all services belonging to the application - * specified by the application id. + * Returns the information about the image store content at the specified + * contentPath. The contentPath is relative to the root of the image store. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceTypeName] The service type name used to - * filter the services to query for. - * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceInfoListWithHttpOperationResponse(applicationId, options) { + getImageStoreContentWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceInfoList(applicationId, options, (err, result, request, response) => { + self._getImageStoreContent(contentPath, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -35178,36 +59979,20 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about all services belonging to the - * application specified by the application id. + * @summary Gets the image store content information. * - * Returns the information about all services belonging to the application - * specified by the application id. + * Returns the information about the image store content at the specified + * contentPath. The contentPath is relative to the root of the image store. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceTypeName] The service type name used to - * filter the services to query for. - * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35219,7 +60004,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedServiceInfoList} - The deserialized result object. + * @resolve {ImageStoreContent} - The deserialized result object. * * @reject {Error} - The error object. * @@ -35228,13 +60013,13 @@ class ServiceFabricClient extends ServiceClient { * {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 PagedServiceInfoList} for more information. + * See {@link ImageStoreContent} 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. */ - getServiceInfoList(applicationId, options, optionalCallback) { + getImageStoreContent(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35243,59 +60028,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceInfoList(applicationId, options, (err, result, request, response) => { + self._getImageStoreContent(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceInfoList(applicationId, options, optionalCallback); + return self._getImageStoreContent(contentPath, options, optionalCallback); } } /** - * @summary Gets the information about the specific service belonging to a - * Service Fabric application. - * - * Returns the information about specified service belonging to the specified - * Service Fabric application. + * @summary Deletes existing image store content. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * Deletes existing image store content being found within the given image + * store relative path. This can be used to delete uploaded application + * packages once they are provisioned. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceInfoWithHttpOperationResponse(applicationId, serviceId, options) { + deleteImageStoreContentWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceInfo(applicationId, serviceId, options, (err, result, request, response) => { + self._deleteImageStoreContent(contentPath, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -35306,32 +60080,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about the specific service belonging to a - * Service Fabric application. - * - * Returns the information about specified service belonging to the specified - * Service Fabric application. + * @summary Deletes existing image store content. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * Deletes existing image store content being found within the given image + * store relative path. This can be used to delete uploaded application + * packages once they are provisioned. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35343,7 +60106,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -35351,14 +60114,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ServiceInfo} 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. */ - getServiceInfo(applicationId, serviceId, options, optionalCallback) { + deleteImageStoreContent(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35367,51 +60129,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceInfo(applicationId, serviceId, options, (err, result, request, response) => { + self._deleteImageStoreContent(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceInfo(applicationId, serviceId, options, optionalCallback); + return self._deleteImageStoreContent(contentPath, options, optionalCallback); } } /** - * @summary Gets the name of the Service Fabric application for a service. - * - * The GetApplicationName endpoint returns the name of the application for the - * specified service. + * @summary Gets the content information at the root of the image store. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * Returns the information about the image store content at the root of the + * image store. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationNameInfoWithHttpOperationResponse(serviceId, options) { + getImageStoreRootContentWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationNameInfo(serviceId, options, (err, result, request, response) => { + self._getImageStoreRootContent(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -35422,24 +60177,17 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the name of the Service Fabric application for a service. - * - * The GetApplicationName endpoint returns the name of the application for the - * specified service. + * @summary Gets the content information at the root of the image store. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * Returns the information about the image store content at the root of the + * image store. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35451,7 +60199,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationNameInfo} - The deserialized result object. + * @resolve {ImageStoreContent} - The deserialized result object. * * @reject {Error} - The error object. * @@ -35460,13 +60208,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ApplicationNameInfo} for more information. + * See {@link ImageStoreContent} 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. */ - getApplicationNameInfo(serviceId, options, optionalCallback) { + getImageStoreRootContent(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35475,78 +60223,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationNameInfo(serviceId, options, (err, result, request, response) => { + self._getImageStoreRootContent(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationNameInfo(serviceId, options, optionalCallback); + return self._getImageStoreRootContent(options, optionalCallback); } } /** - * @summary Creates the specified service. - * - * Creates the specified service. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} serviceDescription The information necessary to create a - * service. - * - * @param {string} [serviceDescription.applicationName] - * - * @param {string} serviceDescription.serviceName - * - * @param {string} serviceDescription.serviceTypeName - * - * @param {array} [serviceDescription.initializationData] - * - * @param {object} serviceDescription.partitionDescription - * - * @param {string} serviceDescription.partitionDescription.partitionScheme - * Polymorphic Discriminator - * - * @param {string} [serviceDescription.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} [serviceDescription.correlationScheme] - * - * @param {array} [serviceDescription.serviceLoadMetrics] + * @summary Copies image store content internally * - * @param {array} [serviceDescription.servicePlacementPolicies] + * Copies the image store content from the source image store relative path to + * the destination image store relative path. * - * @param {string} [serviceDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {object} imageStoreCopyDescription Describes the copy description for + * the image store. * - * @param {boolean} [serviceDescription.isDefaultMoveCostSpecified] Indicates - * if the DefaultMoveCost property is specified. + * @param {string} imageStoreCopyDescription.remoteSource The relative path of + * source image store content to be copied from. * - * @param {string} [serviceDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * @param {string} imageStoreCopyDescription.remoteDestination The relative + * path of destination image store content to be copied to. * - * @param {string} [serviceDescription.serviceDnsName] The DNS name of the - * service. It requires the DNS system service to be enabled in Service Fabric - * cluster. + * @param {array} [imageStoreCopyDescription.skipFiles] The list of the file + * names to be skipped for copying. * - * @param {string} serviceDescription.serviceKind Polymorphic Discriminator + * @param {boolean} [imageStoreCopyDescription.checkMarkFile] Indicates whether + * to check mark file during copying. The property is true if checking mark + * file is required, false otherwise. The mark file is used to check whether + * the folder is well constructed. If the property is true and mark file does + * not exist, the copy is skipped. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35557,11 +60274,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - createServiceWithHttpOperationResponse(applicationId, serviceDescription, options) { + copyImageStoreContentWithHttpOperationResponse(imageStoreCopyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createService(applicationId, serviceDescription, options, (err, result, request, response) => { + self._copyImageStoreContent(imageStoreCopyDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -35572,66 +60289,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates the specified service. - * - * Creates the specified service. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} serviceDescription The information necessary to create a - * service. - * - * @param {string} [serviceDescription.applicationName] - * - * @param {string} serviceDescription.serviceName - * - * @param {string} serviceDescription.serviceTypeName - * - * @param {array} [serviceDescription.initializationData] - * - * @param {object} serviceDescription.partitionDescription - * - * @param {string} serviceDescription.partitionDescription.partitionScheme - * Polymorphic Discriminator - * - * @param {string} [serviceDescription.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} [serviceDescription.correlationScheme] - * - * @param {array} [serviceDescription.serviceLoadMetrics] + * @summary Copies image store content internally * - * @param {array} [serviceDescription.servicePlacementPolicies] + * Copies the image store content from the source image store relative path to + * the destination image store relative path. * - * @param {string} [serviceDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * @param {object} imageStoreCopyDescription Describes the copy description for + * the image store. * - * @param {boolean} [serviceDescription.isDefaultMoveCostSpecified] Indicates - * if the DefaultMoveCost property is specified. + * @param {string} imageStoreCopyDescription.remoteSource The relative path of + * source image store content to be copied from. * - * @param {string} [serviceDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' + * @param {string} imageStoreCopyDescription.remoteDestination The relative + * path of destination image store content to be copied to. * - * @param {string} [serviceDescription.serviceDnsName] The DNS name of the - * service. It requires the DNS system service to be enabled in Service Fabric - * cluster. + * @param {array} [imageStoreCopyDescription.skipFiles] The list of the file + * names to be skipped for copying. * - * @param {string} serviceDescription.serviceKind Polymorphic Discriminator + * @param {boolean} [imageStoreCopyDescription.checkMarkFile] Indicates whether + * to check mark file during copying. The property is true if checking mark + * file is required, false otherwise. The mark file is used to check whether + * the folder is well constructed. If the property is true and mark file does + * not exist, the copy is skipped. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35657,7 +60343,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createService(applicationId, serviceDescription, options, optionalCallback) { + copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35666,56 +60352,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createService(applicationId, serviceDescription, options, (err, result, request, response) => { + self._copyImageStoreContent(imageStoreCopyDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createService(applicationId, serviceDescription, options, optionalCallback); + return self._copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback); } } /** - * @summary Creates a Service Fabric service from the service template defined - * in the application manifest. - * - * Creates a Service Fabric service from the service template defined in the - * application manifest. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} serviceFromTemplateDescription Describes the service that - * needs to be created from the template defined in the application manifest. - * - * @param {string} serviceFromTemplateDescription.applicationName - * - * @param {string} serviceFromTemplateDescription.serviceName - * - * @param {string} serviceFromTemplateDescription.serviceTypeName + * @summary Cancels an image store upload session. * - * @param {array} [serviceFromTemplateDescription.initializationData] + * The DELETE request will cause the existing upload session to expire and + * remove any previously uploaded file chunks. * - * @param {string} - * [serviceFromTemplateDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' - * - * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name - * of the service. It requires the DNS system service to be enabled in Service - * Fabric cluster. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35726,11 +60389,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - createServiceFromTemplateWithHttpOperationResponse(applicationId, serviceFromTemplateDescription, options) { + deleteImageStoreUploadSessionWithHttpOperationResponse(sessionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, (err, result, request, response) => { + self._deleteImageStoreUploadSession(sessionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -35741,44 +60404,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates a Service Fabric service from the service template defined - * in the application manifest. - * - * Creates a Service Fabric service from the service template defined in the - * application manifest. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} serviceFromTemplateDescription Describes the service that - * needs to be created from the template defined in the application manifest. - * - * @param {string} serviceFromTemplateDescription.applicationName - * - * @param {string} serviceFromTemplateDescription.serviceName + * @summary Cancels an image store upload session. * - * @param {string} serviceFromTemplateDescription.serviceTypeName + * The DELETE request will cause the existing upload session to expire and + * remove any previously uploaded file chunks. * - * @param {array} [serviceFromTemplateDescription.initializationData] - * - * @param {string} - * [serviceFromTemplateDescription.servicePackageActivationMode] Possible - * values include: 'SharedProcess', 'ExclusiveProcess' - * - * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name - * of the service. It requires the DNS system service to be enabled in Service - * Fabric cluster. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35804,7 +60444,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, optionalCallback) { + deleteImageStoreUploadSession(sessionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35813,46 +60453,35 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, (err, result, request, response) => { + self._deleteImageStoreUploadSession(sessionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, optionalCallback); + return self._deleteImageStoreUploadSession(sessionId, options, optionalCallback); } } /** - * @summary Deletes an existing Service Fabric service. + * @summary Commit an image store upload session. * - * Deletes an existing Service Fabric service. A service must be created before - * it can be deleted. By default Service Fabric will try to close service - * replicas in a graceful manner and then delete the service. However if - * service is having issues closing the replica gracefully, the delete - * operation may take a long time or get stuck. Use the optional ForceRemove - * flag to skip the graceful close sequence and forcefully delete the service. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * When all file chunks have been uploaded, the upload session needs to be + * committed explicitly to complete the upload. Image store preserves the + * upload session until the expiration time, which is 30 minutes after the last + * chunk received. * - * @param {object} [options] Optional Parameters. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * - * @param {boolean} [options.forceRemove] Remove a Service Fabric application - * or service forcefully without going through the graceful shutdown sequence. - * This parameter can be used to forcefully delete an application or service - * for which delete is timing out due to issues in the service code that - * prevents graceful close of replicas. + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35863,11 +60492,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - deleteServiceWithHttpOperationResponse(serviceId, options) { + commitImageStoreUploadSessionWithHttpOperationResponse(sessionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteService(serviceId, options, (err, result, request, response) => { + self._commitImageStoreUploadSession(sessionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -35878,34 +60507,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes an existing Service Fabric service. + * @summary Commit an image store upload session. * - * Deletes an existing Service Fabric service. A service must be created before - * it can be deleted. By default Service Fabric will try to close service - * replicas in a graceful manner and then delete the service. However if - * service is having issues closing the replica gracefully, the delete - * operation may take a long time or get stuck. Use the optional ForceRemove - * flag to skip the graceful close sequence and forcefully delete the service. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * When all file chunks have been uploaded, the upload session needs to be + * committed explicitly to complete the upload. Image store preserves the + * upload session until the expiration time, which is 30 minutes after the last + * chunk received. * - * @param {object} [options] Optional Parameters. + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * - * @param {boolean} [options.forceRemove] Remove a Service Fabric application - * or service forcefully without going through the graceful shutdown sequence. - * This parameter can be used to forcefully delete an application or service - * for which delete is timing out due to issues in the service code that - * prevents graceful close of replicas. + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35931,7 +60549,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteService(serviceId, options, optionalCallback) { + commitImageStoreUploadSession(sessionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -35940,105 +60558,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteService(serviceId, options, (err, result, request, response) => { + self._commitImageStoreUploadSession(sessionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } - return; - }); - }); - } else { - return self._deleteService(serviceId, options, optionalCallback); - } - } - - /** - * @summary Updates the specified service using the given update description. - * - * Updates the specified service using the given update description. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {object} serviceUpdateDescription The information necessary to update - * a service. - * - * @param {string} [serviceUpdateDescription.flags] Flags indicating whether - * other properties are set. Each of the associated properties corresponds to a - * flag, specified below, which, if set, indicate that the property is - * specified. - * This property can be a combination of those flags obtained using bitwise - * 'OR' operator. - * For example, if the provided value is 6 then the flags for - * ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. - * - * - None - Does not indicate any other properties are set. The value is zero. - * - TargetReplicaSetSize/InstanceCount - Indicates whether the - * TargetReplicaSetSize property (for Stateful services) or the InstanceCount - * property (for Stateless services) is set. The value is 1. - * - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration - * property is set. The value is 2. - * - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is - * set. The value is 4. - * - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration - * property is set. The value is 8. - * - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The - * value is 16. - * - PlacementConstraints - Indicates the PlacementConstraints property is set. - * The value is 32. - * - PlacementPolicyList - Indicates the ServicePlacementPolicies property is - * set. The value is 64. - * - Correlation - Indicates the CorrelationScheme property is set. The value - * is 128. - * - Metrics - Indicates the ServiceLoadMetrics property is set. The value is - * 256. - * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value - * is 512. - * - * - * @param {string} [serviceUpdateDescription.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} [serviceUpdateDescription.correlationScheme] - * - * @param {array} [serviceUpdateDescription.loadMetrics] - * - * @param {array} [serviceUpdateDescription.servicePlacementPolicies] + return; + }); + }); + } else { + return self._commitImageStoreUploadSession(sessionId, options, optionalCallback); + } + } + + /** + * @summary Get the image store upload session by ID. * - * @param {string} [serviceUpdateDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' + * Gets the image store upload session identified by the given ID. User can + * query the upload session at any time during uploading. * - * @param {string} serviceUpdateDescription.serviceKind Polymorphic - * Discriminator + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateServiceWithHttpOperationResponse(serviceId, serviceUpdateDescription, options) { + getImageStoreUploadSessionByIdWithHttpOperationResponse(sessionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateService(serviceId, serviceUpdateDescription, options, (err, result, request, response) => { + self._getImageStoreUploadSessionById(sessionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -36049,78 +60610,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Updates the specified service using the given update description. - * - * Updates the specified service using the given update description. - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {object} serviceUpdateDescription The information necessary to update - * a service. - * - * @param {string} [serviceUpdateDescription.flags] Flags indicating whether - * other properties are set. Each of the associated properties corresponds to a - * flag, specified below, which, if set, indicate that the property is - * specified. - * This property can be a combination of those flags obtained using bitwise - * 'OR' operator. - * For example, if the provided value is 6 then the flags for - * ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. - * - * - None - Does not indicate any other properties are set. The value is zero. - * - TargetReplicaSetSize/InstanceCount - Indicates whether the - * TargetReplicaSetSize property (for Stateful services) or the InstanceCount - * property (for Stateless services) is set. The value is 1. - * - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration - * property is set. The value is 2. - * - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is - * set. The value is 4. - * - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration - * property is set. The value is 8. - * - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The - * value is 16. - * - PlacementConstraints - Indicates the PlacementConstraints property is set. - * The value is 32. - * - PlacementPolicyList - Indicates the ServicePlacementPolicies property is - * set. The value is 64. - * - Correlation - Indicates the CorrelationScheme property is set. The value - * is 128. - * - Metrics - Indicates the ServiceLoadMetrics property is set. The value is - * 256. - * - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value - * is 512. - * - * - * @param {string} [serviceUpdateDescription.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)". + * @summary Get the image store upload session by ID. * - * @param {array} [serviceUpdateDescription.correlationScheme] + * Gets the image store upload session identified by the given ID. User can + * query the upload session at any time during uploading. * - * @param {array} [serviceUpdateDescription.loadMetrics] - * - * @param {array} [serviceUpdateDescription.servicePlacementPolicies] - * - * @param {string} [serviceUpdateDescription.defaultMoveCost] Possible values - * include: 'Zero', 'Low', 'Medium', 'High' - * - * @param {string} serviceUpdateDescription.serviceKind Polymorphic - * Discriminator + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -36132,7 +60636,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {UploadSession} - The deserialized result object. * * @reject {Error} - The error object. * @@ -36140,13 +60644,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link UploadSession} 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. */ - updateService(serviceId, serviceUpdateDescription, options, optionalCallback) { + getImageStoreUploadSessionById(sessionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -36155,51 +60660,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateService(serviceId, serviceUpdateDescription, options, (err, result, request, response) => { + self._getImageStoreUploadSessionById(sessionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateService(serviceId, serviceUpdateDescription, options, optionalCallback); + return self._getImageStoreUploadSessionById(sessionId, options, optionalCallback); } } /** - * @summary Gets the description of an existing Service Fabric service. + * @summary Get the image store upload session by relative path. * - * Gets the description of an existing Service Fabric service. A service must - * be created before its description can be obtained. + * Gets the image store upload session associated with the given image store + * relative path. User can query the upload session at any time during + * uploading. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceDescriptionWithHttpOperationResponse(serviceId, options) { + getImageStoreUploadSessionByPathWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceDescription(serviceId, options, (err, result, request, response) => { + self._getImageStoreUploadSessionByPath(contentPath, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -36210,24 +60712,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the description of an existing Service Fabric service. + * @summary Get the image store upload session by relative path. * - * Gets the description of an existing Service Fabric service. A service must - * be created before its description can be obtained. + * Gets the image store upload session associated with the given image store + * relative path. User can query the upload session at any time during + * uploading. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -36239,7 +60738,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceDescription} - The deserialized result object. + * @resolve {UploadSession} - The deserialized result object. * * @reject {Error} - The error object. * @@ -36248,13 +60747,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ServiceDescription} for more information. + * See {@link UploadSession} 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. */ - getServiceDescription(serviceId, options, optionalCallback) { + getImageStoreUploadSessionByPath(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -36263,113 +60762,67 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceDescription(serviceId, options, (err, result, request, response) => { + self._getImageStoreUploadSessionByPath(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceDescription(serviceId, options, optionalCallback); + return self._getImageStoreUploadSessionByPath(contentPath, options, optionalCallback); } } /** - * @summary Gets the health of the specified Service Fabric service. - * - * Gets the health information of the specified service. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the service based on the health state. - * Use PartitionsHealthStateFilter to filter the collection of partitions - * returned. - * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @summary Uploads a file chunk to the image store relative path. * + * Uploads a file chunk to the image store with the specified upload session ID + * and image store relative path. This API allows user to resume the file + * upload operation. user doesn't have to restart the file upload from scratch + * whenever there is a network interruption. Use this option if the file size + * is large. * - * @param {number} [options.partitionsHealthStateFilter] Allows filtering of - * the partitions health state objects returned in the result of service health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only partitions that match the filter are returned. All partitions are used - * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of partitions with HealthState value of OK (2) and - * Warning (4) will be returned. + * To perform a resumable file upload, user need to break the file into + * multiple chunks and upload these chunks to the image store one-by-one. + * Chunks don't have to be uploaded in order. If the file represented by the + * image store relative path already exists, it will be overwritten when the + * upload session commits. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {string} contentRange When uploading file chunks to the image store, + * the Content-Range header field need to be configured and sent with a + * request. The format should looks like "bytes + * {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, + * Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300 + * through 5,000 and the total file length is 20,000 bytes. * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceHealthWithHttpOperationResponse(serviceId, options) { + uploadFileChunkWithHttpOperationResponse(contentPath, sessionId, contentRange, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceHealth(serviceId, options, (err, result, request, response) => { + self._uploadFileChunk(contentPath, sessionId, contentRange, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -36380,86 +60833,40 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric service. - * - * Gets the health information of the specified service. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the service based on the health state. - * Use PartitionsHealthStateFilter to filter the collection of partitions - * returned. - * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @summary Uploads a file chunk to the image store relative path. * + * Uploads a file chunk to the image store with the specified upload session ID + * and image store relative path. This API allows user to resume the file + * upload operation. user doesn't have to restart the file upload from scratch + * whenever there is a network interruption. Use this option if the file size + * is large. * - * @param {number} [options.partitionsHealthStateFilter] Allows filtering of - * the partitions health state objects returned in the result of service health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only partitions that match the filter are returned. All partitions are used - * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of partitions with HealthState value of OK (2) and - * Warning (4) will be returned. + * To perform a resumable file upload, user need to break the file into + * multiple chunks and upload these chunks to the image store one-by-one. + * Chunks don't have to be uploaded in order. If the file represented by the + * image store relative path already exists, it will be overwritten when the + * upload session commits. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * + * @param {uuid} sessionId A GUID generated by the user for a file uploading. + * It identifies an image store upload session which keeps track of all file + * chunks until it is committed. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {string} contentRange When uploading file chunks to the image store, + * the Content-Range header field need to be configured and sent with a + * request. The format should looks like "bytes + * {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, + * Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300 + * through 5,000 and the total file length is 20,000 bytes. * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -36471,7 +60878,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -36479,14 +60886,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ServiceHealth} 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. */ - getServiceHealth(serviceId, options, optionalCallback) { + uploadFileChunk(contentPath, sessionId, contentRange, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -36495,194 +60901,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceHealth(serviceId, options, (err, result, request, response) => { + self._uploadFileChunk(contentPath, sessionId, contentRange, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceHealth(serviceId, options, optionalCallback); + return self._uploadFileChunk(contentPath, sessionId, contentRange, options, optionalCallback); } } /** - * @summary Gets the health of the specified Service Fabric service, by using - * the specified health policy. - * - * Gets the health information of the specified service. - * If the application health policy is specified, the health evaluation uses it - * to get the aggregated health state. - * If the policy is not specified, the health evaluation uses the application - * health policy defined in the application manifest, or the default health - * policy, if no policy is defined in the manifest. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the service based on the health state. - * Use PartitionsHealthStateFilter to filter the collection of partitions - * returned. - * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.partitionsHealthStateFilter] Allows filtering of - * the partitions health state objects returned in the result of service health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only partitions that match the filter are returned. All partitions are used - * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of partitions with HealthState value of OK (2) and - * Warning (4) will be returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. - * + * @summary Invokes an administrative command on the given Infrastructure + * Service instance. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific commands to a + * particular + * instance of the Infrastructure Service. * - * 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. + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {object} [options] Optional Parameters. * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceHealthUsingPolicyWithHttpOperationResponse(serviceId, options) { + invokeInfrastructureCommandWithHttpOperationResponse(command, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceHealthUsingPolicy(serviceId, options, (err, result, request, response) => { + self._invokeInfrastructureCommand(command, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -36693,167 +60968,167 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric service, by using - * the specified health policy. + * @summary Invokes an administrative command on the given Infrastructure + * Service instance. * - * Gets the health information of the specified service. - * If the application health policy is specified, the health evaluation uses it - * to get the aggregated health state. - * If the policy is not specified, the health evaluation uses the application - * health policy defined in the application manifest, or the default health - * policy, if no policy is defined in the manifest. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the service based on the health state. - * Use PartitionsHealthStateFilter to filter the collection of partitions - * returned. - * If you specify a service that does not exist in the health store, this - * cmdlet returns an error. + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific commands to a + * particular + * instance of the Infrastructure Service. * + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. + * + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [options.partitionsHealthStateFilter] Allows filtering of - * the partitions health state objects returned in the result of service health - * query based on their health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only partitions that match the filter are returned. All partitions are used - * to evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value - * obtained using bitwise 'OR' operator. For example, if the provided value is - * 6 then health state of partitions with HealthState value of OK (2) and - * Warning (4) will be returned. + * @param {function} [optionalCallback] - The optional callback. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @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 * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. + * @resolve {String} - 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. * + * {string} [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. + */ + invokeInfrastructureCommand(command, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._invokeInfrastructureCommand(command, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._invokeInfrastructureCommand(command, options, optionalCallback); + } + } + + /** + * @summary Invokes a read-only query on the given infrastructure service + * instance. + * + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific queries to a + * particular + * instance of the Infrastructure Service. * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * - * @param {number} - * [options.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. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. * - * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * @param {object} [options] Optional Parameters. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. * - * 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} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * @returns {Promise} A promise is returned * - * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * + * @reject {Error} - The error object. + */ + invokeInfrastructureQueryWithHttpOperationResponse(command, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._invokeInfrastructureQuery(command, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invokes a read-only query on the given infrastructure service + * instance. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * For clusters that have one or more instances of the Infrastructure Service + * configured, + * this API provides a way to send infrastructure-specific queries to a + * particular + * instance of the Infrastructure Service. * - * 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. + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} command The text of the command to be invoked. The content + * of the command is infrastructure-specific. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {object} [options] Optional Parameters. * + * @param {string} [options.serviceId] The identity of the infrastructure + * service. This is the full name of the infrastructure service without the + * 'fabric:' URI scheme. This parameter required only for the cluster that has + * more than one instance of infrastructure service running. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -36865,7 +61140,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceHealth} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -36873,14 +61148,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ServiceHealth} for more information. + * {string} [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. */ - getServiceHealthUsingPolicy(serviceId, options, optionalCallback) { + invokeInfrastructureQuery(command, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -36889,141 +61163,66 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceHealthUsingPolicy(serviceId, options, (err, result, request, response) => { + self._invokeInfrastructureQuery(command, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceHealthUsingPolicy(serviceId, options, optionalCallback); + return self._invokeInfrastructureQuery(command, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric service. - * - * Reports health state of the specified Service Fabric service. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Service, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run - * GetServiceHealth and check that the report appears in the HealthEvents - * section. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * + * @summary This API will induce data loss for the specified partition. It will + * trigger a call to the OnDataLossAsync API of the partition. * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * This API will induce data loss for the specified partition. It will trigger + * a call to the OnDataLoss API of the partition. + * Actual data loss will depend on the specified DataLossMode. * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. + * - PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is + * triggered for the partition but actual data loss depends on the presence of + * in-flight replication. + * - FullDataLoss - All replicas are removed hence all data is lost and + * OnDataLoss is triggered. * - * If not specified, time to live defaults to infinite value. + * This API should only be called with a stateful service as the target. * + * Calling this API with a system service as the target is not advised. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * Note: Once this API has been called, it cannot be reversed. Calling + * CancelOperation will only stop execution and clean up internal system state. + * It will not restore data if the command has progressed far enough to cause + * data loss. * + * Call the GetDataLossProgress API with the same OperationId to return + * information on the operation started with this API. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * + * @param {uuid} partitionId The identity of the partition. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {string} dataLossMode This enum is passed to the StartDataLoss API to + * indicate what type of data loss to induce. Possible values include: + * 'Invalid', 'PartialDataLoss', 'FullDataLoss' * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -37034,11 +61233,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - reportServiceHealthWithHttpOperationResponse(serviceId, healthInformation, options) { + startDataLossWithHttpOperationResponse(serviceId, partitionId, operationId, dataLossMode, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportServiceHealth(serviceId, healthInformation, options, (err, result, request, response) => { + self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -37049,129 +61248,54 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric service. - * - * Reports health state of the specified Service Fabric service. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Service, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run - * GetServiceHealth and check that the report appears in the HealthEvents - * section. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * + * @summary This API will induce data loss for the specified partition. It will + * trigger a call to the OnDataLossAsync API of the partition. * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * This API will induce data loss for the specified partition. It will trigger + * a call to the OnDataLoss API of the partition. + * Actual data loss will depend on the specified DataLossMode. * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. + * - PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is + * triggered for the partition but actual data loss depends on the presence of + * in-flight replication. + * - FullDataLoss - All replicas are removed hence all data is lost and + * OnDataLoss is triggered. * - * If not specified, time to live defaults to infinite value. + * This API should only be called with a stateful service as the target. * + * Calling this API with a system service as the target is not advised. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * Note: Once this API has been called, it cannot be reversed. Calling + * CancelOperation will only stop execution and clean up internal system state. + * It will not restore data if the command has progressed far enough to cause + * data loss. * + * Call the GetDataLossProgress API with the same OperationId to return + * information on the operation started with this API. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * + * @param {uuid} partitionId The identity of the partition. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {string} dataLossMode This enum is passed to the StartDataLoss API to + * indicate what type of data loss to induce. Possible values include: + * 'Invalid', 'PartialDataLoss', 'FullDataLoss' * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -37197,7 +61321,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - reportServiceHealth(serviceId, healthInformation, options, optionalCallback) { + startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -37206,72 +61330,58 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportServiceHealth(serviceId, healthInformation, options, (err, result, request, response) => { + self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportServiceHealth(serviceId, healthInformation, options, optionalCallback); + return self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, optionalCallback); } } /** - * @summary Resolve a Service Fabric partition. + * @summary Gets the progress of a partition data loss operation started using + * the StartDataLoss API. * - * Resolve a Service Fabric service partition, to get the endpoints of the - * service replicas. + * Gets the progress of a data loss operation started with StartDataLoss, using + * the OperationId. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.partitionKeyType] Key type for the partition. This - * parameter is required if the partition scheme for the service is Int64Range - * or Named. The possible values are following. - * - None (1) - Indicates that the the PartitionKeyValue parameter is not - * specified. This is valid for the partitions with partitioning scheme as - * Singleton. This is the default value. The value is 1. - * - Int64Range (2) - Indicates that the the PartitionKeyValue parameter is an - * int64 partition key. This is valid for the partitions with partitioning - * scheme as Int64Range. The value is 2. - * - Named (3) - Indicates that the the PartitionKeyValue parameter is a name - * of the partition. This is valid for the partitions with partitioning scheme - * as Named. The value is 3. - * + * @param {uuid} partitionId The identity of the partition. * - * @param {string} [options.partitionKeyValue] Partition key. This is required - * if the partition scheme for the service is Int64Range or Named. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * - * @param {string} [options.previousRspVersion] The value in the Version field - * of the response that was received previously. This is required if the user - * knows that the result that was got previously is stale. + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resolveServiceWithHttpOperationResponse(serviceId, options) { + getDataLossProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resolveService(serviceId, options, (err, result, request, response) => { + self._getDataLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -37282,45 +61392,31 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resolve a Service Fabric partition. + * @summary Gets the progress of a partition data loss operation started using + * the StartDataLoss API. * - * Resolve a Service Fabric service partition, to get the endpoints of the - * service replicas. + * Gets the progress of a data loss operation started with StartDataLoss, using + * the OperationId. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.partitionKeyType] Key type for the partition. This - * parameter is required if the partition scheme for the service is Int64Range - * or Named. The possible values are following. - * - None (1) - Indicates that the the PartitionKeyValue parameter is not - * specified. This is valid for the partitions with partitioning scheme as - * Singleton. This is the default value. The value is 1. - * - Int64Range (2) - Indicates that the the PartitionKeyValue parameter is an - * int64 partition key. This is valid for the partitions with partitioning - * scheme as Int64Range. The value is 2. - * - Named (3) - Indicates that the the PartitionKeyValue parameter is a name - * of the partition. This is valid for the partitions with partitioning scheme - * as Named. The value is 3. - * + * @param {uuid} partitionId The identity of the partition. * - * @param {string} [options.partitionKeyValue] Partition key. This is required - * if the partition scheme for the service is Int64Range or Named. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * - * @param {string} [options.previousRspVersion] The value in the Version field - * of the response that was received previously. This is required if the user - * knows that the result that was got previously is stale. + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -37332,7 +61428,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ResolvedServicePartition} - The deserialized result object. + * @resolve {PartitionDataLossProgress} - The deserialized result object. * * @reject {Error} - The error object. * @@ -37341,14 +61437,14 @@ class ServiceFabricClient extends ServiceClient { * {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 ResolvedServicePartition} for more + * See {@link PartitionDataLossProgress} 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. */ - resolveService(serviceId, options, optionalCallback) { + getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -37357,60 +61453,70 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resolveService(serviceId, options, (err, result, request, response) => { + self._getDataLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resolveService(serviceId, options, optionalCallback); + return self._getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback); } } /** - * @summary Gets the list of partitions of a Service Fabric service. + * @summary Induces quorum loss for a given stateful service partition. + * + * This API is useful for a temporary quorum loss situation on your service. + * + * Call the GetQuorumLossProgress API with the same OperationId to return + * information on the operation started with this API. * - * Gets the list of partitions of a Service Fabric service. The response - * include the partition id, partitioning scheme information, keys supported by - * the partition, status, health and other details about the partition. + * This can only be called on stateful persisted (HasPersistedState==true) + * services. Do not use this API on stateless services or stateful in-memory + * only services. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * - * @param {object} [options] Optional Parameters. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss + * API to indicate what type of quorum loss to induce. Possible values include: + * 'Invalid', 'QuorumReplicas', 'AllReplicas' + * + * @param {number} quorumLossDuration The amount of time for which the + * partition will be kept in quorum loss. This must be specified in seconds. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionInfoListWithHttpOperationResponse(serviceId, options) { + startQuorumLossWithHttpOperationResponse(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionInfoList(serviceId, options, (err, result, request, response) => { + self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -37421,33 +61527,43 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of partitions of a Service Fabric service. + * @summary Induces quorum loss for a given stateful service partition. + * + * This API is useful for a temporary quorum loss situation on your service. + * + * Call the GetQuorumLossProgress API with the same OperationId to return + * information on the operation started with this API. * - * Gets the list of partitions of a Service Fabric service. The response - * include the partition id, partitioning scheme information, keys supported by - * the partition, status, health and other details about the partition. + * This can only be called on stateful persisted (HasPersistedState==true) + * services. Do not use this API on stateless services or stateful in-memory + * only services. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in * previous versions. * - * @param {object} [options] Optional Parameters. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss + * API to indicate what type of quorum loss to induce. Possible values include: + * 'Invalid', 'QuorumReplicas', 'AllReplicas' + * + * @param {number} quorumLossDuration The amount of time for which the + * partition will be kept in quorum loss. This must be specified in seconds. + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -37459,7 +61575,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedServicePartitionInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -37467,15 +61583,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 PagedServicePartitionInfoList} 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. */ - getPartitionInfoList(serviceId, options, optionalCallback) { + startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -37484,48 +61598,58 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionInfoList(serviceId, options, (err, result, request, response) => { + self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionInfoList(serviceId, options, optionalCallback); + return self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, optionalCallback); } } /** - * @summary Gets the information about a Service Fabric partition. + * @summary Gets the progress of a quorum loss operation on a partition started + * using the StartQuorumLoss API. * - * The Partitions endpoint returns information about the specified partition. - * The response include the partition id, partitioning scheme information, keys - * supported by the partition, status, health and other details about the - * partition. + * Gets the progress of a quorum loss operation started with StartQuorumLoss, + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {uuid} partitionId The identity of the partition. * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionInfoWithHttpOperationResponse(partitionId, options) { + getQuorumLossProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionInfo(partitionId, options, (err, result, request, response) => { + self._getQuorumLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -37536,21 +61660,31 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about a Service Fabric partition. + * @summary Gets the progress of a quorum loss operation on a partition started + * using the StartQuorumLoss API. * - * The Partitions endpoint returns information about the specified partition. - * The response include the partition id, partitioning scheme information, keys - * supported by the partition, status, health and other details about the - * partition. + * Gets the progress of a quorum loss operation started with StartQuorumLoss, + * using the provided OperationId. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {uuid} partitionId The identity of the partition. * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -37562,7 +61696,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServicePartitionInfo} - The deserialized result object. + * @resolve {PartitionQuorumLossProgress} - The deserialized result object. * * @reject {Error} - The error object. * @@ -37571,13 +61705,14 @@ class ServiceFabricClient extends ServiceClient { * {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 ServicePartitionInfo} for more information. + * See {@link PartitionQuorumLossProgress} 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. */ - getPartitionInfo(partitionId, options, optionalCallback) { + getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -37586,46 +61721,67 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionInfo(partitionId, options, (err, result, request, response) => { + self._getQuorumLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionInfo(partitionId, options, optionalCallback); + return self._getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback); } } /** - * @summary Gets the name of the Service Fabric service for a partition. - * - * The GetServiceName endpoint returns the name of the service for the + * @summary This API will restart some or all replicas or instances of the * specified partition. * + * This API is useful for testing failover. + * + * If used to target a stateless service partition, RestartPartitionMode must + * be AllReplicasOrInstances. + * + * Call the GetPartitionRestartProgress API using the same OperationId to get + * the progress. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * * @param {uuid} partitionId The identity of the partition. * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} restartPartitionMode Describe which partitions to restart. + * Possible values include: 'Invalid', 'AllReplicasOrInstances', + * 'OnlyActiveSecondaries' + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceNameInfoWithHttpOperationResponse(partitionId, options) { + startPartitionRestartWithHttpOperationResponse(serviceId, partitionId, operationId, restartPartitionMode, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceNameInfo(partitionId, options, (err, result, request, response) => { + self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -37636,19 +61792,40 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the name of the Service Fabric service for a partition. - * - * The GetServiceName endpoint returns the name of the service for the + * @summary This API will restart some or all replicas or instances of the * specified partition. * + * This API is useful for testing failover. + * + * If used to target a stateless service partition, RestartPartitionMode must + * be AllReplicasOrInstances. + * + * Call the GetPartitionRestartProgress API using the same OperationId to get + * the progress. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. + * * @param {uuid} partitionId The identity of the partition. * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {string} restartPartitionMode Describe which partitions to restart. + * Possible values include: 'Invalid', 'AllReplicasOrInstances', + * 'OnlyActiveSecondaries' + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -37660,7 +61837,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceNameInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -37668,14 +61845,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ServiceNameInfo} 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. */ - getServiceNameInfo(partitionId, options, optionalCallback) { + startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -37684,107 +61860,58 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceNameInfo(partitionId, options, (err, result, request, response) => { + self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceNameInfo(partitionId, options, optionalCallback); + return self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, optionalCallback); } } /** - * @summary Gets the health of the specified Service Fabric partition. + * @summary Gets the progress of a PartitionRestart operation started using + * StartPartitionRestart. * - * Gets the health information of the specified partition. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the service based on the health state. - * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState - * objects on the partition. - * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. + * Gets the progress of a PartitionRestart started with StartPartitionRestart + * using the provided OperationId. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {uuid} partitionId The identity of the partition. * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.replicasHealthStateFilter] Allows filtering the - * collection of ReplicaHealthState objects on the partition. The value can be - * obtained from members or bitwise operations on members of HealthStateFilter. - * Only replicas that match the filter will be returned. All replicas will be - * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. - * For example, If the provided value is 6 then all of the events with - * HealthState value of OK (2) and Warning (4) will be returned. The possible - * values for this parameter include integer value of one of the following - * health states. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionHealthWithHttpOperationResponse(partitionId, options) { + getPartitionRestartProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionHealth(partitionId, options, (err, result, request, response) => { + self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -37795,80 +61922,31 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric partition. + * @summary Gets the progress of a PartitionRestart operation started using + * StartPartitionRestart. * - * Gets the health information of the specified partition. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the service based on the health state. - * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState - * objects on the partition. - * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. + * Gets the progress of a PartitionRestart started with StartPartitionRestart + * using the provided OperationId. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {uuid} partitionId The identity of the partition. * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.replicasHealthStateFilter] Allows filtering the - * collection of ReplicaHealthState objects on the partition. The value can be - * obtained from members or bitwise operations on members of HealthStateFilter. - * Only replicas that match the filter will be returned. All replicas will be - * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. - * For example, If the provided value is 6 then all of the events with - * HealthState value of OK (2) and Warning (4) will be returned. The possible - * values for this parameter include integer value of one of the following - * health states. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -37880,7 +61958,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionHealth} - The deserialized result object. + * @resolve {PartitionRestartProgress} - The deserialized result object. * * @reject {Error} - The error object. * @@ -37889,13 +61967,14 @@ class ServiceFabricClient extends ServiceClient { * {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 PartitionHealth} for more information. + * See {@link PartitionRestartProgress} 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. */ - getPartitionHealth(partitionId, options, optionalCallback) { + getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -37904,189 +61983,67 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionHealth(partitionId, options, (err, result, request, response) => { + self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionHealth(partitionId, options, optionalCallback); + return self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback); } } /** - * @summary Gets the health of the specified Service Fabric partition, by using - * the specified health policy. - * - * Gets the health information of the specified partition. - * If the application health policy is specified, the health evaluation uses it - * to get the aggregated health state. - * If the policy is not specified, the health evaluation uses the application - * health policy defined in the application manifest, or the default health - * policy, if no policy is defined in the manifest. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the partition based on the health state. - * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState - * objects on the partition. Use ApplicationHealthPolicy in the POST body to - * override the health policies used to evaluate the health. - * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. - * - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.replicasHealthStateFilter] Allows filtering the - * collection of ReplicaHealthState objects on the partition. The value can be - * obtained from members or bitwise operations on members of HealthStateFilter. - * Only replicas that match the filter will be returned. All replicas will be - * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. - * For example, If the provided value is 6 then all of the events with - * HealthState value of OK (2) and Warning (4) will be returned. The possible - * values for this parameter include integer value of one of the following - * health states. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. + * @summary Starts or stops a cluster node. * + * Starts or stops a cluster node. A cluster node is a process, not the OS + * instance itself. To start a node, pass in "Start" for the + * NodeTransitionType parameter. + * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This + * API starts the operation - when the API returns the node may not have + * finished transitioning yet. + * Call GetNodeTransitionProgress with the same OperationId to get the progress + * of the operation. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * @param {string} nodeName The name of the node. * - * 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 {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {string} nodeTransitionType Indicates the type of transition to + * perform. NodeTransitionType.Start will start a stopped node. + * NodeTransitionType.Stop will stop a node that is up. Possible values + * include: 'Invalid', 'Start', 'Stop' * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} nodeInstanceId The node instance ID of the target node. + * This can be determined through GetNodeInfo API. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {number} stopDurationInSeconds The duration, in seconds, to keep the + * node stopped. The minimum value is 600, the maximum is 14400. After this + * time expires, the node will automatically come back up. * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionHealthUsingPolicyWithHttpOperationResponse(partitionId, options) { + startNodeTransitionWithHttpOperationResponse(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionHealthUsingPolicy(partitionId, options, (err, result, request, response) => { + self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -38097,162 +62054,40 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric partition, by using - * the specified health policy. - * - * Gets the health information of the specified partition. - * If the application health policy is specified, the health evaluation uses it - * to get the aggregated health state. - * If the policy is not specified, the health evaluation uses the application - * health policy defined in the application manifest, or the default health - * policy, if no policy is defined in the manifest. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the partition based on the health state. - * Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState - * objects on the partition. Use ApplicationHealthPolicy in the POST body to - * override the health policies used to evaluate the health. - * If you specify a partition that does not exist in the health store, this - * cmdlet returns an error. - * - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {number} [options.replicasHealthStateFilter] Allows filtering the - * collection of ReplicaHealthState objects on the partition. The value can be - * obtained from members or bitwise operations on members of HealthStateFilter. - * Only replicas that match the filter will be returned. All replicas will be - * used to evaluate the aggregated health state. If not specified, all entries - * will be returned.The state values are flag based enumeration, so the value - * could be a combination of these value obtained using bitwise 'OR' operator. - * For example, If the provided value is 6 then all of the events with - * HealthState value of OK (2) and Warning (4) will be returned. The possible - * values for this parameter include integer value of one of the following - * health states. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. + * @summary Starts or stops a cluster node. * + * Starts or stops a cluster node. A cluster node is a process, not the OS + * instance itself. To start a node, pass in "Start" for the + * NodeTransitionType parameter. + * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This + * API starts the operation - when the API returns the node may not have + * finished transitioning yet. + * Call GetNodeTransitionProgress with the same OperationId to get the progress + * of the operation. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * @param {string} nodeName The name of the node. * - * 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 {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {string} nodeTransitionType Indicates the type of transition to + * perform. NodeTransitionType.Start will start a stopped node. + * NodeTransitionType.Stop will stop a node that is up. Possible values + * include: 'Invalid', 'Start', 'Stop' * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} nodeInstanceId The node instance ID of the target node. + * This can be determined through GetNodeInfo API. * - * @param {boolean} [options.excludeHealthStatistics] Indicates whether the - * health statistics should be returned as part of the query result. False by - * default. - * The statistics show the number of children entities in health state Ok, - * Warning, and Error. + * @param {number} stopDurationInSeconds The duration, in seconds, to keep the + * node stopped. The minimum value is 600, the maximum is 14400. After this + * time expires, the node will automatically come back up. * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38264,7 +62099,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -38272,14 +62107,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 PartitionHealth} 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. */ - getPartitionHealthUsingPolicy(partitionId, options, optionalCallback) { + startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -38288,151 +62122,171 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionHealthUsingPolicy(partitionId, options, (err, result, request, response) => { + self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionHealthUsingPolicy(partitionId, options, optionalCallback); + return self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric partition. + * @summary Gets the progress of an operation started using + * StartNodeTransition. * - * Reports health state of the specified Service Fabric partition. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Partition, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run - * GetPartitionHealth and check that the report appears in the HealthEvents - * section. + * Gets the progress of an operation started with StartNodeTransition using the + * provided OperationId. * + * @param {string} nodeName The name of the node. * - * @param {uuid} partitionId The identity of the partition. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. + * @param {object} [options] Optional Parameters. * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. + * @returns {Promise} A promise is returned * - * Together with the SourceId, the property uniquely identifies the health - * information. + * @resolve {HttpOperationResponse} - The deserialized result object. * + * @reject {Error} - The error object. + */ + getNodeTransitionProgressWithHttpOperationResponse(nodeName, operationId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getNodeTransitionProgress(nodeName, operationId, 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 progress of an operation started using + * StartNodeTransition. * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * Gets the progress of an operation started with StartNodeTransition using the + * provided OperationId. * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. + * @param {string} nodeName The name of the node. * - * If not specified, time to live defaults to infinite value. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * + * @param {object} [options] Optional Parameters. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @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. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * {Promise} A promise is returned * + * @resolve {NodeTransitionProgress} - The deserialized result object. * - * @param {object} [options] Optional Parameters. + * @reject {Error} - The error object. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. + * {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 NodeTransitionProgress} 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. + */ + getNodeTransitionProgress(nodeName, operationId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNodeTransitionProgress(nodeName, operationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNodeTransitionProgress(nodeName, operationId, options, optionalCallback); + } + } + + /** + * @summary Gets a list of user-induced fault operations filtered by provided + * input. + * + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param {number} typeFilter Used to filter on OperationType for user-induced + * operations. + * + * - 65535 - select all + * - 1 - select PartitionDataLoss. + * - 2 - select PartitionQuorumLoss. + * - 4 - select PartitionRestart. + * - 8 - select NodeTransition. + * + * @param {number} stateFilter Used to filter on OperationState's for + * user-induced operations. * + * - 65535 - select All + * - 1 - select Running + * - 2 - select RollingBack + * - 8 - select Completed + * - 16 - select Faulted + * - 32 - select Cancelled + * - 64 - select ForceCancelled + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - reportPartitionHealthWithHttpOperationResponse(partitionId, healthInformation, options) { + getFaultOperationListWithHttpOperationResponse(typeFilter, stateFilter, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportPartitionHealth(partitionId, healthInformation, options, (err, result, request, response) => { + self._getFaultOperationList(typeFilter, stateFilter, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -38443,124 +62297,37 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric partition. - * - * Reports health state of the specified Service Fabric partition. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Partition, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run - * GetPartitionHealth and check that the report appears in the HealthEvents - * section. - * - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. - * - * If not specified, time to live defaults to infinite value. - * - * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * @summary Gets a list of user-induced fault operations filtered by provided + * input. * + * Gets the a list of user-induced fault operations filtered by provided input. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @param {number} typeFilter Used to filter on OperationType for user-induced + * operations. * + * - 65535 - select all + * - 1 - select PartitionDataLoss. + * - 2 - select PartitionQuorumLoss. + * - 4 - select PartitionRestart. + * - 8 - select NodeTransition. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {number} stateFilter Used to filter on OperationState's for + * user-induced operations. * + * - 65535 - select All + * - 1 - select Running + * - 2 - select RollingBack + * - 8 - select Completed + * - 16 - select Faulted + * - 32 - select Cancelled + * - 64 - select ForceCancelled * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38572,7 +62339,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -38580,13 +62347,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - reportPartitionHealth(partitionId, healthInformation, options, optionalCallback) { + getFaultOperationList(typeFilter, stateFilter, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -38595,49 +62362,72 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportPartitionHealth(partitionId, healthInformation, options, (err, result, request, response) => { + self._getFaultOperationList(typeFilter, stateFilter, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportPartitionHealth(partitionId, healthInformation, options, optionalCallback); + return self._getFaultOperationList(typeFilter, stateFilter, options, optionalCallback); } } /** - * @summary Gets the load of the specified Service Fabric partition. + * @summary Cancels a user-induced fault operation. * - * Returns information about the specified partition. - * The response includes a list of load information. - * Each information includes load metric name, value and last reported time in - * UTC. + * The following APIs start fault operations that may be cancelled by using + * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, + * StartNodeTransition. + * + * If force is false, then the specified user-induced operation will be + * gracefully stopped and cleaned up. If force is true, the command will be + * aborted, and some internal state + * may be left behind. Specifying force as true should be used with care. + * Calling this API with force set to true is not allowed until this API has + * already + * been called on the same test command with force set to false first, or + * unless the test command already has an OperationState of + * OperationState.RollingBack. + * Clarification: OperationState.RollingBack means that the system will be/is + * cleaning up internal system state caused by executing the command. It will + * not restore data if the + * test command was to cause data loss. For example, if you call StartDataLoss + * then call this API, the system will only clean up internal state from + * running the command. + * It will not restore the target partition's data, if the command progressed + * far enough to cause data loss. + * + * Important note: if this API is invoked with force==true, internal state may + * be left behind. * + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * - * @param {uuid} partitionId The identity of the partition. + * @param {boolean} force Indicates whether to gracefully rollback and clean up + * internal system state modified by executing the user-induced operation. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionLoadInformationWithHttpOperationResponse(partitionId, options) { + cancelOperationWithHttpOperationResponse(operationId, force, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionLoadInformation(partitionId, options, (err, result, request, response) => { + self._cancelOperation(operationId, force, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -38648,22 +62438,45 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the load of the specified Service Fabric partition. + * @summary Cancels a user-induced fault operation. * - * Returns information about the specified partition. - * The response includes a list of load information. - * Each information includes load metric name, value and last reported time in - * UTC. + * The following APIs start fault operations that may be cancelled by using + * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, + * StartNodeTransition. + * + * If force is false, then the specified user-induced operation will be + * gracefully stopped and cleaned up. If force is true, the command will be + * aborted, and some internal state + * may be left behind. Specifying force as true should be used with care. + * Calling this API with force set to true is not allowed until this API has + * already + * been called on the same test command with force set to false first, or + * unless the test command already has an OperationState of + * OperationState.RollingBack. + * Clarification: OperationState.RollingBack means that the system will be/is + * cleaning up internal system state caused by executing the command. It will + * not restore data if the + * test command was to cause data loss. For example, if you call StartDataLoss + * then call this API, the system will only clean up internal state from + * running the command. + * It will not restore the target partition's data, if the command progressed + * far enough to cause data loss. * + * Important note: if this API is invoked with force==true, internal state may + * be left behind. * - * @param {uuid} partitionId The identity of the partition. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API + * + * @param {boolean} force Indicates whether to gracefully rollback and clean up + * internal system state modified by executing the user-induced operation. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38675,7 +62488,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionLoadInformation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -38683,15 +62496,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 PartitionLoadInformation} 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. */ - getPartitionLoadInformation(partitionId, options, optionalCallback) { + cancelOperation(operationId, force, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -38700,31 +62511,62 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionLoadInformation(partitionId, options, (err, result, request, response) => { + self._cancelOperation(operationId, force, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionLoadInformation(partitionId, options, optionalCallback); + return self._cancelOperation(operationId, force, options, optionalCallback); } } /** - * @summary Resets the current load of a Service Fabric partition. + * @summary Creates a backup policy. * - * Resets the current load of a Service Fabric partition to the default load - * for the service. + * Creates a backup policy which can be associated later with a Service Fabric + * application, service or a partition for periodic backup. * - * @param {uuid} partitionId The identity of the partition. + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38735,11 +62577,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - resetPartitionLoadWithHttpOperationResponse(partitionId, options) { + createBackupPolicyWithHttpOperationResponse(backupPolicyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resetPartitionLoad(partitionId, options, (err, result, request, response) => { + self._createBackupPolicy(backupPolicyDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -38750,19 +62592,50 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resets the current load of a Service Fabric partition. + * @summary Creates a backup policy. * - * Resets the current load of a Service Fabric partition to the default load - * for the service. + * Creates a backup policy which can be associated later with a Service Fabric + * application, service or a partition for periodic backup. * - * @param {uuid} partitionId The identity of the partition. + * @param {object} backupPolicyDescription Describes the backup policy. + * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. + * + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. + * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. + * + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. + * + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator + * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. + * + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38788,7 +62661,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resetPartitionLoad(partitionId, options, optionalCallback) { + createBackupPolicy(backupPolicyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -38797,35 +62670,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resetPartitionLoad(partitionId, options, (err, result, request, response) => { + self._createBackupPolicy(backupPolicyDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resetPartitionLoad(partitionId, options, optionalCallback); + return self._createBackupPolicy(backupPolicyDescription, options, optionalCallback); } } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover a specific partition which is currently stuck in quorum loss. + * @summary Deletes the backup policy. * - * Indicates to the Service Fabric cluster that it should attempt to recover a - * specific partition which is currently stuck in quorum loss. This operation - * should only be performed if it is known that the replicas that are down - * cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * Deletes an existing backup policy. A backup policy must be created before it + * can be deleted. A currently active backup policy, associated with any + * Service Fabric application, service or partition, cannot be deleted without + * first deleting the mapping. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38836,11 +62707,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - recoverPartitionWithHttpOperationResponse(partitionId, options) { + deleteBackupPolicyWithHttpOperationResponse(backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverPartition(partitionId, options, (err, result, request, response) => { + self._deleteBackupPolicy(backupPolicyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -38851,23 +62722,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover a specific partition which is currently stuck in quorum loss. + * @summary Deletes the backup policy. * - * Indicates to the Service Fabric cluster that it should attempt to recover a - * specific partition which is currently stuck in quorum loss. This operation - * should only be performed if it is known that the replicas that are down - * cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * Deletes an existing backup policy. A backup policy must be created before it + * can be deleted. A currently active backup policy, associated with any + * Service Fabric application, service or partition, cannot be deleted without + * first deleting the mapping. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38893,7 +62762,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverPartition(partitionId, options, optionalCallback) { + deleteBackupPolicy(backupPolicyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -38902,55 +62771,59 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverPartition(partitionId, options, (err, result, request, response) => { + self._deleteBackupPolicy(backupPolicyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverPartition(partitionId, options, optionalCallback); + return self._deleteBackupPolicy(backupPolicyName, options, optionalCallback); } } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the specified service which is currently stuck in quorum loss. - * - * Indicates to the Service Fabric cluster that it should attempt to recover - * the specified service which is currently stuck in quorum loss. This - * operation should only be performed if it is known that the replicas that are - * down cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * @summary Gets all the backup policies configured. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * Get a list of all the backup policies configured. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - recoverServicePartitionsWithHttpOperationResponse(serviceId, options) { + getBackupPolicyListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverServicePartitions(serviceId, options, (err, result, request, response) => { + self._getBackupPolicyList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -38961,28 +62834,32 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the specified service which is currently stuck in quorum loss. - * - * Indicates to the Service Fabric cluster that it should attempt to recover - * the specified service which is currently stuck in quorum loss. This - * operation should only be performed if it is known that the replicas that are - * down cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * @summary Gets all the backup policies configured. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * Get a list of all the backup policies configured. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -38994,7 +62871,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedBackupPolicyDescriptionList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -39002,13 +62879,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupPolicyDescriptionList} 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. */ - recoverServicePartitions(serviceId, options, optionalCallback) { + getBackupPolicyList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -39017,48 +62896,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverServicePartitions(serviceId, options, (err, result, request, response) => { + self._getBackupPolicyList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverServicePartitions(serviceId, options, optionalCallback); + return self._getBackupPolicyList(options, optionalCallback); } } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the system services which are currently stuck in quorum loss. - * - * Indicates to the Service Fabric cluster that it should attempt to recover - * the system services which are currently stuck in quorum loss. This operation - * should only be performed if it is known that the replicas that are down - * cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * @summary Gets a particular backup policy by name. + * + * Gets a particular backup policy identified by {backupPolicyName} + * + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - recoverSystemPartitionsWithHttpOperationResponse(options) { + getBackupPolicyByNameWithHttpOperationResponse(backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverSystemPartitions(options, (err, result, request, response) => { + self._getBackupPolicyByName(backupPolicyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -39069,21 +62945,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the system services which are currently stuck in quorum loss. + * @summary Gets a particular backup policy by name. * - * Indicates to the Service Fabric cluster that it should attempt to recover - * the system services which are currently stuck in quorum loss. This operation - * should only be performed if it is known that the replicas that are down - * cannot be recovered. Incorrect use of this API can cause potential data - * loss. + * Gets a particular backup policy identified by {backupPolicyName} + * + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -39095,7 +62968,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {BackupPolicyDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -39103,13 +62976,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupPolicyDescription} 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. */ - recoverSystemPartitions(options, optionalCallback) { + getBackupPolicyByName(backupPolicyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -39118,49 +62993,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverSystemPartitions(options, (err, result, request, response) => { + self._getBackupPolicyByName(backupPolicyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverSystemPartitions(options, optionalCallback); + return self._getBackupPolicyByName(backupPolicyName, options, optionalCallback); } } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover any services (including system services) which are currently stuck - * in quorum loss. + * @summary Gets the list of backup entities that are associated with this + * policy. * - * Indicates to the Service Fabric cluster that it should attempt to recover - * any services (including system services) which are currently stuck in quorum - * loss. This operation should only be performed if it is known that the - * replicas that are down cannot be recovered. Incorrect use of this API can - * cause potential data loss. + * Returns a list of Service Fabric application, service or partition which are + * associated with this backup policy. + * + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - recoverAllPartitionsWithHttpOperationResponse(options) { + getAllEntitiesBackedUpByPolicyWithHttpOperationResponse(backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverAllPartitions(options, (err, result, request, response) => { + self._getAllEntitiesBackedUpByPolicy(backupPolicyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -39171,22 +63060,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover any services (including system services) which are currently stuck - * in quorum loss. + * @summary Gets the list of backup entities that are associated with this + * policy. * - * Indicates to the Service Fabric cluster that it should attempt to recover - * any services (including system services) which are currently stuck in quorum - * loss. This operation should only be performed if it is known that the - * replicas that are down cannot be recovered. Incorrect use of this API can - * cause potential data loss. + * Returns a list of Service Fabric application, service or partition which are + * associated with this backup policy. + * + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -39198,7 +63101,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedBackupEntityList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -39206,13 +63109,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupEntityList} 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. */ - recoverAllPartitions(options, optionalCallback) { + getAllEntitiesBackedUpByPolicy(backupPolicyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -39221,201 +63125,78 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverAllPartitions(options, (err, result, request, response) => { + self._getAllEntitiesBackedUpByPolicy(backupPolicyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverAllPartitions(options, optionalCallback); + return self._getAllEntitiesBackedUpByPolicy(backupPolicyName, options, optionalCallback); } } /** - * @summary Creates a new repair task. - * - * For clusters that have the Repair Manager Service configured, - * this API provides a way to create repair tasks that run automatically or - * manually. - * For repair tasks that run automatically, an appropriate repair executor - * must be running for each repair action to run automatically. - * These are currently only available in specially-configured Azure Cloud - * Services. - * - * To create a manual repair task, provide the set of impacted node names and - * the - * expected impact. When the state of the created repair task changes to - * approved, - * you can safely perform repair actions on those nodes. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTask Describes the repair task to be created or - * updated. - * - * @param {string} repairTask.taskId The ID of the repair task. - * - * @param {string} [repairTask.version] The version of the repair task. - * When creating a new repair task, the version must be set to zero. When - * updating a repair task, - * the version is used for optimistic concurrency checks. If the version is - * set to zero, the update will not check for write conflicts. If the version - * is set to a non-zero value, then the - * update will only succeed if the actual current version of the repair task - * matches this value. - * - * - * @param {string} [repairTask.description] A description of the purpose of the - * repair task, or other informational details. - * May be set when the repair task is created, and is immutable once set. - * - * - * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' - * - * @param {number} [repairTask.flags] A bitwise-OR of the following values, - * which gives additional details about the status of the repair task. - * - 1 - Cancellation of the repair has been requested - * - 2 - Abort of the repair has been requested - * - 4 - Approval of the repair was forced via client request - * - * - * @param {string} repairTask.action The requested repair action. Must be - * specified when the repair task is created, and is immutable once set. - * - * - * @param {object} [repairTask.target] - * - * @param {string} repairTask.target.kind Polymorphic Discriminator - * - * @param {string} [repairTask.executor] The name of the repair executor. Must - * be specified in Claimed and later states, and is immutable once set. - * - * @param {string} [repairTask.executorData] A data string that the repair - * executor can use to store its internal state. - * - * @param {object} [repairTask.impact] - * - * @param {string} repairTask.impact.kind Polymorphic Discriminator - * - * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' - * - * @param {number} [repairTask.resultCode] A numeric value providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * - * - * @param {string} [repairTask.resultDetails] A string providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * - * - * @param {object} [repairTask.history] + * @summary Updates the backup policy. * - * @param {date} [repairTask.history.createdUtcTimestamp] The time when the - * repair task entered the Created state. - * - * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the - * repair task entered the Claimed state. - * - * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the - * repair task entered the Preparing state. + * Updates the backup policy identified by {backupPolicyName} * - * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the - * repair task entered the Approved state - * - * @param {date} [repairTask.history.executingUtcTimestamp] The time when the - * repair task entered the Executing state - * - * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the - * repair task entered the Restoring state + * @param {object} backupPolicyDescription Describes the backup policy. * - * @param {date} [repairTask.history.completedUtcTimestamp] The time when the - * repair task entered the Completed state + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. * - * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Preparing state. + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. * - * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Preparing state. + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. * - * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Restoring state. + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. * - * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Restoring state. + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. * - * @param {boolean} [repairTask.performPreparingHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Preparing state. + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator * - * @param {boolean} [repairTask.performRestoringHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Restoring state. + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createRepairTaskWithHttpOperationResponse(repairTask, options) { + updateBackupPolicyWithHttpOperationResponse(backupPolicyDescription, backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createRepairTask(repairTask, options, (err, result, request, response) => { + self._updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -39426,175 +63207,181 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates a new repair task. - * - * For clusters that have the Repair Manager Service configured, - * this API provides a way to create repair tasks that run automatically or - * manually. - * For repair tasks that run automatically, an appropriate repair executor - * must be running for each repair action to run automatically. - * These are currently only available in specially-configured Azure Cloud - * Services. - * - * To create a manual repair task, provide the set of impacted node names and - * the - * expected impact. When the state of the created repair task changes to - * approved, - * you can safely perform repair actions on those nodes. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTask Describes the repair task to be created or - * updated. + * @summary Updates the backup policy. * - * @param {string} repairTask.taskId The ID of the repair task. + * Updates the backup policy identified by {backupPolicyName} * - * @param {string} [repairTask.version] The version of the repair task. - * When creating a new repair task, the version must be set to zero. When - * updating a repair task, - * the version is used for optimistic concurrency checks. If the version is - * set to zero, the update will not check for write conflicts. If the version - * is set to a non-zero value, then the - * update will only succeed if the actual current version of the repair task - * matches this value. + * @param {object} backupPolicyDescription Describes the backup policy. * + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. * - * @param {string} [repairTask.description] A description of the purpose of the - * repair task, or other informational details. - * May be set when the repair task is created, and is immutable once set. + * @param {boolean} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. * + * @param {number} backupPolicyDescription.maxIncrementalBackups Defines the + * maximum number of incremental backups to be taken between two full backups. + * This is just the upper limit. A full backup may be taken before specified + * number of incremental backups are completed in one of the following + * conditions + * - The replica has never taken a full backup since it has become primary, + * - Some of the log records since the last backup has been truncated, or + * - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. * - * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' + * @param {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. * - * @param {number} [repairTask.flags] A bitwise-OR of the following values, - * which gives additional details about the status of the repair task. - * - 1 - Cancellation of the repair has been requested - * - 2 - Abort of the repair has been requested - * - 4 - Approval of the repair was forced via client request + * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator * + * @param {object} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. * - * @param {string} repairTask.action The requested repair action. Must be - * specified when the repair task is created, and is immutable once set. + * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator * - * @param {object} [repairTask.target] + * @param {string} backupPolicyName The name of the backup policy. * - * @param {string} repairTask.target.kind Polymorphic Discriminator + * @param {object} [options] Optional Parameters. * - * @param {string} [repairTask.executor] The name of the repair executor. Must - * be specified in Claimed and later states, and is immutable once set. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {string} [repairTask.executorData] A data string that the repair - * executor can use to store its internal state. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [repairTask.impact] + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} repairTask.impact.kind Polymorphic Discriminator + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. + * {Promise} A promise is returned * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' + * @resolve {null} - The deserialized result object. * - * @param {number} [repairTask.resultCode] A numeric value providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. + * @reject {Error} - The error object. * + * {function} optionalCallback(err, result, request, response) * - * @param {string} [repairTask.resultDetails] A string providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. + * {Error} err - The Error object if an error occurred, null otherwise. * + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {object} [repairTask.history] + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {date} [repairTask.history.createdUtcTimestamp] The time when the - * repair task entered the Created state. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, optionalCallback); + } + } + + /** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric application. * - * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the - * repair task entered the Claimed state. + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric application. Each partition is backed up individually as per + * the specified backup policy description. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. * - * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the - * repair task entered the Preparing state. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the - * repair task entered the Approved state + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. * - * @param {date} [repairTask.history.executingUtcTimestamp] The time when the - * repair task entered the Executing state + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. * - * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the - * repair task entered the Restoring state + * @param {object} [options] Optional Parameters. * - * @param {date} [repairTask.history.completedUtcTimestamp] The time when the - * repair task entered the Completed state + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Preparing state. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Preparing state. + * @returns {Promise} A promise is returned * - * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Restoring state. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Restoring state. + * @reject {Error} - The error object. + */ + enableApplicationBackupWithHttpOperationResponse(applicationId, enableBackupDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._enableApplicationBackup(applicationId, enableBackupDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric application. * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric application. Each partition is backed up individually as per + * the specified backup policy description. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {boolean} [repairTask.performPreparingHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Preparing state. + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. * - * @param {boolean} [repairTask.performRestoringHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Restoring state. + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -39605,7 +63392,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {RepairTaskUpdateInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -39613,14 +63400,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 RepairTaskUpdateInfo} 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. */ - createRepairTask(repairTask, options, optionalCallback) { + enableApplicationBackup(applicationId, enableBackupDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -39629,56 +63415,52 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createRepairTask(repairTask, options, (err, result, request, response) => { + self._enableApplicationBackup(applicationId, enableBackupDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createRepairTask(repairTask, options, optionalCallback); + return self._enableApplicationBackup(applicationId, enableBackupDescription, options, optionalCallback); } } /** - * @summary Requests the cancellation of the given repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTaskCancelDescription Describes the repair task to be - * cancelled. - * - * @param {string} repairTaskCancelDescription.taskId The ID of the repair - * task. + * @summary Disables periodic backup of Service Fabric application. * - * @param {string} [repairTaskCancelDescription.version] The current version - * number of the repair task. If non-zero, then the request will only succeed - * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * Disables periodic backup of Service Fabric application which was previously + * enabled. * - * @param {boolean} [repairTaskCancelDescription.requestAbort] _True_ if the - * repair should be stopped as soon as possible even if it has already started - * executing. _False_ if the repair should be cancelled only if execution has - * not yet started. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - cancelRepairTaskWithHttpOperationResponse(repairTaskCancelDescription, options) { + disableApplicationBackupWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._cancelRepairTask(repairTaskCancelDescription, options, (err, result, request, response) => { + self._disableApplicationBackup(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -39689,30 +63471,26 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Requests the cancellation of the given repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @summary Disables periodic backup of Service Fabric application. * + * Disables periodic backup of Service Fabric application which was previously + * enabled. * - * @param {object} repairTaskCancelDescription Describes the repair task to be - * cancelled. - * - * @param {string} repairTaskCancelDescription.taskId The ID of the repair - * task. - * - * @param {string} [repairTaskCancelDescription.version] The current version - * number of the repair task. If non-zero, then the request will only succeed - * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. - * - * @param {boolean} [repairTaskCancelDescription.requestAbort] _True_ if the - * repair should be stopped as soon as possible even if it has already started - * executing. _False_ if the repair should be cancelled only if execution has - * not yet started. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -39723,7 +63501,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {RepairTaskUpdateInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -39731,14 +63509,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 RepairTaskUpdateInfo} 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. */ - cancelRepairTask(repairTaskCancelDescription, options, optionalCallback) { + disableApplicationBackup(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -39747,51 +63524,69 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._cancelRepairTask(repairTaskCancelDescription, options, (err, result, request, response) => { + self._disableApplicationBackup(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._cancelRepairTask(repairTaskCancelDescription, options, optionalCallback); + return self._disableApplicationBackup(applicationId, options, optionalCallback); } } /** - * @summary Deletes a completed repair task. + * @summary Gets the Service Fabric application backup configuration + * information. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * Gets the Service Fabric backup configuration information for the application + * and the services and partitions under this application. * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {object} repairTaskDeleteDescription Describes the repair task to be - * deleted. + * @param {object} [options] Optional Parameters. * - * @param {string} repairTaskDeleteDescription.taskId The ID of the completed - * repair task to be deleted. + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * - * @param {string} [repairTaskDeleteDescription.version] The current version - * number of the repair task. If non-zero, then the request will only succeed - * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * - * @param {object} [options] Optional Parameters. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteRepairTaskWithHttpOperationResponse(repairTaskDeleteDescription, options) { + getApplicationBackupConfigurationInfoWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteRepairTask(repairTaskDeleteDescription, options, (err, result, request, response) => { + self._getApplicationBackupConfigurationInfo(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -39802,24 +63597,42 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes a completed repair task. + * @summary Gets the Service Fabric application backup configuration + * information. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * Gets the Service Fabric backup configuration information for the application + * and the services and partitions under this application. * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * - * @param {object} repairTaskDeleteDescription Describes the repair task to be - * deleted. + * @param {object} [options] Optional Parameters. * - * @param {string} repairTaskDeleteDescription.taskId The ID of the completed - * repair task to be deleted. + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * - * @param {string} [repairTaskDeleteDescription.version] The current version - * number of the repair task. If non-zero, then the request will only succeed - * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * - * @param {object} [options] Optional Parameters. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -39831,7 +63644,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedBackupConfigurationInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -39839,13 +63652,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupConfigurationInfoList} 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. */ - deleteRepairTask(repairTaskDeleteDescription, options, optionalCallback) { + getApplicationBackupConfigurationInfo(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -39854,57 +63669,85 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteRepairTask(repairTaskDeleteDescription, options, (err, result, request, response) => { + self._getApplicationBackupConfigurationInfo(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteRepairTask(repairTaskDeleteDescription, options, optionalCallback); + return self._getApplicationBackupConfigurationInfo(applicationId, options, optionalCallback); } } /** - * @summary Gets a list of repair tasks matching the given filters. + * @summary Gets the list of backups available for every partition in this + * application. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * Returns a list of backups available for every partition in this Service + * Fabric application. The server enumerates all the backups available at the + * backup location configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.taskIdFilter] The repair task ID prefix to be - * matched. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {number} [options.stateFilter] A bitwise-OR of the following values, - * specifying which task states should be included in the result list. - * - 1 - Created - * - 2 - Claimed - * - 4 - Preparing - * - 8 - Approved - * - 16 - Executing - * - 32 - Restoring - * - 64 - Completed + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. * - * @param {string} [options.executorFilter] The name of the repair executor - * whose claimed tasks should be included in the list. + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getRepairTaskListWithHttpOperationResponse(options) { + getApplicationBackupListWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getRepairTaskList(options, (err, result, request, response) => { + self._getApplicationBackupList(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -39915,30 +63758,58 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a list of repair tasks matching the given filters. + * @summary Gets the list of backups available for every partition in this + * application. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * Returns a list of backups available for every partition in this Service + * Fabric application. The server enumerates all the backups available at the + * backup location configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.taskIdFilter] The repair task ID prefix to be - * matched. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {number} [options.stateFilter] A bitwise-OR of the following values, - * specifying which task states should be included in the result list. - * - 1 - Created - * - 2 - Claimed - * - 4 - Preparing - * - 8 - Approved - * - 16 - Executing - * - 32 - Restoring - * - 64 - Completed + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. * - * @param {string} [options.executorFilter] The name of the repair executor - * whose claimed tasks should be included in the list. + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -39950,7 +63821,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {PagedBackupInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -39958,13 +63829,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupInfoList} 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. */ - getRepairTaskList(options, optionalCallback) { + getApplicationBackupList(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -39973,51 +63845,55 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getRepairTaskList(options, (err, result, request, response) => { + self._getApplicationBackupList(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getRepairTaskList(options, optionalCallback); + return self._getApplicationBackupList(applicationId, options, optionalCallback); } } /** - * @summary Forces the approval of the given repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTaskApproveDescription Describes the repair task to be - * approved. + * @summary Suspends periodic backup for the specified Service Fabric + * application. * - * @param {string} repairTaskApproveDescription.taskId The ID of the repair - * task. + * The application which is configured to take periodic backups, is suspended + * for taking further backups till it is resumed again. This operation applies + * to the entire application's hierarchy. It means all the services and + * partitions under this application are now suspended for backup. * - * @param {string} [repairTaskApproveDescription.version] The current version - * number of the repair task. If non-zero, then the request will only succeed - * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - forceApproveRepairTaskWithHttpOperationResponse(repairTaskApproveDescription, options) { + suspendApplicationBackupWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._forceApproveRepairTask(repairTaskApproveDescription, options, (err, result, request, response) => { + self._suspendApplicationBackup(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40028,25 +63904,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Forces the approval of the given repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTaskApproveDescription Describes the repair task to be - * approved. + * @summary Suspends periodic backup for the specified Service Fabric + * application. * - * @param {string} repairTaskApproveDescription.taskId The ID of the repair - * task. + * The application which is configured to take periodic backups, is suspended + * for taking further backups till it is resumed again. This operation applies + * to the entire application's hierarchy. It means all the services and + * partitions under this application are now suspended for backup. * - * @param {string} [repairTaskApproveDescription.version] The current version - * number of the repair task. If non-zero, then the request will only succeed - * if this value matches the actual current version of the repair task. If - * zero, then no version check is performed. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40057,7 +63937,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {RepairTaskUpdateInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40065,14 +63945,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 RepairTaskUpdateInfo} 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. */ - forceApproveRepairTask(repairTaskApproveDescription, options, optionalCallback) { + suspendApplicationBackup(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40081,63 +63960,53 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._forceApproveRepairTask(repairTaskApproveDescription, options, (err, result, request, response) => { + self._suspendApplicationBackup(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._forceApproveRepairTask(repairTaskApproveDescription, options, optionalCallback); + return self._suspendApplicationBackup(applicationId, options, optionalCallback); } } /** - * @summary Updates the health policy of the given repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTaskUpdateHealthPolicyDescription Describes the repair - * task healthy policy to be updated. + * @summary Resumes periodic backup of a Service Fabric application which was + * previously suspended. * - * @param {string} repairTaskUpdateHealthPolicyDescription.taskId The ID of the - * repair task to be updated. - * - * @param {string} [repairTaskUpdateHealthPolicyDescription.version] The - * current version number of the repair task. If non-zero, then the request - * will only succeed if this value matches the actual current value of the - * repair task. If zero, then no version check is performed. - * - * @param {boolean} - * [repairTaskUpdateHealthPolicyDescription.performPreparingHealthCheck] A - * boolean indicating if health check is to be performed in the Preparing stage - * of the repair task. If not specified the existing value should not be - * altered. Otherwise, specify the desired new value. + * The previously suspended Service Fabric application resumes taking periodic + * backup as per the backup policy currently configured for the same. * - * @param {boolean} - * [repairTaskUpdateHealthPolicyDescription.performRestoringHealthCheck] A - * boolean indicating if health check is to be performed in the Restoring stage - * of the repair task. If not specified the existing value should not be - * altered. Otherwise, specify the desired new value. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateRepairTaskHealthPolicyWithHttpOperationResponse(repairTaskUpdateHealthPolicyDescription, options) { + resumeApplicationBackupWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, (err, result, request, response) => { + self._resumeApplicationBackup(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40148,37 +64017,27 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Updates the health policy of the given repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @summary Resumes periodic backup of a Service Fabric application which was + * previously suspended. * + * The previously suspended Service Fabric application resumes taking periodic + * backup as per the backup policy currently configured for the same. * - * @param {object} repairTaskUpdateHealthPolicyDescription Describes the repair - * task healthy policy to be updated. - * - * @param {string} repairTaskUpdateHealthPolicyDescription.taskId The ID of the - * repair task to be updated. - * - * @param {string} [repairTaskUpdateHealthPolicyDescription.version] The - * current version number of the repair task. If non-zero, then the request - * will only succeed if this value matches the actual current value of the - * repair task. If zero, then no version check is performed. - * - * @param {boolean} - * [repairTaskUpdateHealthPolicyDescription.performPreparingHealthCheck] A - * boolean indicating if health check is to be performed in the Preparing stage - * of the repair task. If not specified the existing value should not be - * altered. Otherwise, specify the desired new value. - * - * @param {boolean} - * [repairTaskUpdateHealthPolicyDescription.performRestoringHealthCheck] A - * boolean indicating if health check is to be performed in the Restoring stage - * of the repair task. If not specified the existing value should not be - * altered. Otherwise, specify the desired new value. + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40189,7 +64048,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {RepairTaskUpdateInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40197,14 +64056,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 RepairTaskUpdateInfo} 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. */ - updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, optionalCallback) { + resumeApplicationBackup(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40213,187 +64071,65 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, (err, result, request, response) => { + self._resumeApplicationBackup(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, optionalCallback); + return self._resumeApplicationBackup(applicationId, options, optionalCallback); } } /** - * @summary Updates the execution state of a repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTask Describes the repair task to be created or - * updated. - * - * @param {string} repairTask.taskId The ID of the repair task. - * - * @param {string} [repairTask.version] The version of the repair task. - * When creating a new repair task, the version must be set to zero. When - * updating a repair task, - * the version is used for optimistic concurrency checks. If the version is - * set to zero, the update will not check for write conflicts. If the version - * is set to a non-zero value, then the - * update will only succeed if the actual current version of the repair task - * matches this value. - * - * - * @param {string} [repairTask.description] A description of the purpose of the - * repair task, or other informational details. - * May be set when the repair task is created, and is immutable once set. - * - * - * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' - * - * @param {number} [repairTask.flags] A bitwise-OR of the following values, - * which gives additional details about the status of the repair task. - * - 1 - Cancellation of the repair has been requested - * - 2 - Abort of the repair has been requested - * - 4 - Approval of the repair was forced via client request - * - * - * @param {string} repairTask.action The requested repair action. Must be - * specified when the repair task is created, and is immutable once set. - * - * - * @param {object} [repairTask.target] - * - * @param {string} repairTask.target.kind Polymorphic Discriminator - * - * @param {string} [repairTask.executor] The name of the repair executor. Must - * be specified in Claimed and later states, and is immutable once set. - * - * @param {string} [repairTask.executorData] A data string that the repair - * executor can use to store its internal state. - * - * @param {object} [repairTask.impact] - * - * @param {string} repairTask.impact.kind Polymorphic Discriminator - * - * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' - * - * @param {number} [repairTask.resultCode] A numeric value providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * - * - * @param {string} [repairTask.resultDetails] A string providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * - * - * @param {object} [repairTask.history] - * - * @param {date} [repairTask.history.createdUtcTimestamp] The time when the - * repair task entered the Created state. - * - * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the - * repair task entered the Claimed state. - * - * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the - * repair task entered the Preparing state. - * - * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the - * repair task entered the Approved state - * - * @param {date} [repairTask.history.executingUtcTimestamp] The time when the - * repair task entered the Executing state - * - * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the - * repair task entered the Restoring state - * - * @param {date} [repairTask.history.completedUtcTimestamp] The time when the - * repair task entered the Completed state - * - * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Preparing state. - * - * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Preparing state. - * - * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Restoring state. - * - * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Restoring state. - * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' - * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric service. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric service. Each partition is backed up individually as per the + * specified backup policy description. In case the application, which the + * service is part of, is already enabled for backup then this operation would + * override the policy being used to take the periodic backup for this service + * and its partitions (unless explicitly overridden at the partition level). + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * - * @param {boolean} [repairTask.performPreparingHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Preparing state. + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. * - * @param {boolean} [repairTask.performRestoringHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Restoring state. + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateRepairExecutionStateWithHttpOperationResponse(repairTask, options) { + enableServiceBackupWithHttpOperationResponse(serviceId, enableBackupDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateRepairExecutionState(repairTask, options, (err, result, request, response) => { + self._enableServiceBackup(serviceId, enableBackupDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40404,161 +64140,39 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Updates the execution state of a repair task. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * - * @param {object} repairTask Describes the repair task to be created or - * updated. - * - * @param {string} repairTask.taskId The ID of the repair task. - * - * @param {string} [repairTask.version] The version of the repair task. - * When creating a new repair task, the version must be set to zero. When - * updating a repair task, - * the version is used for optimistic concurrency checks. If the version is - * set to zero, the update will not check for write conflicts. If the version - * is set to a non-zero value, then the - * update will only succeed if the actual current version of the repair task - * matches this value. - * - * - * @param {string} [repairTask.description] A description of the purpose of the - * repair task, or other informational details. - * May be set when the repair task is created, and is immutable once set. - * - * - * @param {string} repairTask.state The workflow state of the repair task. - * Valid initial states are Created, Claimed, and Preparing. - * - * - Invalid - Indicates that the repair task state is invalid. All Service - * Fabric enumerations have the invalid value. - * - Created - Indicates that the repair task has been created. - * - Claimed - Indicates that the repair task has been claimed by a repair - * executor. - * - Preparing - Indicates that the Repair Manager is preparing the system to - * handle the impact of the repair task, usually by taking resources offline - * gracefully. - * - Approved - Indicates that the repair task has been approved by the Repair - * Manager and is safe to execute. - * - Executing - Indicates that execution of the repair task is in progress. - * - Restoring - Indicates that the Repair Manager is restoring the system to - * its pre-repair state, usually by bringing resources back online. - * - Completed - Indicates that the repair task has completed, and no further - * state changes will occur. - * . Possible values include: 'Invalid', 'Created', 'Claimed', 'Preparing', - * 'Approved', 'Executing', 'Restoring', 'Completed' - * - * @param {number} [repairTask.flags] A bitwise-OR of the following values, - * which gives additional details about the status of the repair task. - * - 1 - Cancellation of the repair has been requested - * - 2 - Abort of the repair has been requested - * - 4 - Approval of the repair was forced via client request - * - * - * @param {string} repairTask.action The requested repair action. Must be - * specified when the repair task is created, and is immutable once set. - * - * - * @param {object} [repairTask.target] - * - * @param {string} repairTask.target.kind Polymorphic Discriminator - * - * @param {string} [repairTask.executor] The name of the repair executor. Must - * be specified in Claimed and later states, and is immutable once set. - * - * @param {string} [repairTask.executorData] A data string that the repair - * executor can use to store its internal state. - * - * @param {object} [repairTask.impact] - * - * @param {string} repairTask.impact.kind Polymorphic Discriminator - * - * @param {string} [repairTask.resultStatus] A value describing the overall - * result of the repair task execution. - * Must be specified in the Restoring and later states, and is immutable once - * set. - * - * - Invalid - Indicates that the repair task result is invalid. All Service - * Fabric enumerations have the invalid value. - * - Succeeded - Indicates that the repair task completed execution - * successfully. - * - Cancelled - Indicates that the repair task was cancelled prior to - * execution. - * - Interrupted - Indicates that execution of the repair task was interrupted - * by a cancellation request after some work had already been performed. - * - Failed - Indicates that there was a failure during execution of the repair - * task. Some work may have been performed. - * - Pending - Indicates that the repair task result is not yet available, - * because the repair task has not finished executing. - * . Possible values include: 'Invalid', 'Succeeded', 'Cancelled', - * 'Interrupted', 'Failed', 'Pending' - * - * @param {number} [repairTask.resultCode] A numeric value providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * - * - * @param {string} [repairTask.resultDetails] A string providing additional - * details about the result of the repair task execution. - * May be specified in the Restoring and later states, and is immutable once - * set. - * - * - * @param {object} [repairTask.history] - * - * @param {date} [repairTask.history.createdUtcTimestamp] The time when the - * repair task entered the Created state. - * - * @param {date} [repairTask.history.claimedUtcTimestamp] The time when the - * repair task entered the Claimed state. - * - * @param {date} [repairTask.history.preparingUtcTimestamp] The time when the - * repair task entered the Preparing state. - * - * @param {date} [repairTask.history.approvedUtcTimestamp] The time when the - * repair task entered the Approved state - * - * @param {date} [repairTask.history.executingUtcTimestamp] The time when the - * repair task entered the Executing state - * - * @param {date} [repairTask.history.restoringUtcTimestamp] The time when the - * repair task entered the Restoring state - * - * @param {date} [repairTask.history.completedUtcTimestamp] The time when the - * repair task entered the Completed state - * - * @param {date} [repairTask.history.preparingHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Preparing state. - * - * @param {date} [repairTask.history.preparingHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Preparing state. - * - * @param {date} [repairTask.history.restoringHealthCheckStartUtcTimestamp] The - * time when the repair task started the health check in the Restoring state. - * - * @param {date} [repairTask.history.restoringHealthCheckEndUtcTimestamp] The - * time when the repair task completed the health check in the Restoring state. - * - * @param {string} [repairTask.preparingHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' - * - * @param {string} [repairTask.restoringHealthCheckState] Possible values - * include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut' + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric service. + * + * Enables periodic backup of stateful partitions which are part of this + * Service Fabric service. Each partition is backed up individually as per the + * specified backup policy description. In case the application, which the + * service is part of, is already enabled for backup then this operation would + * override the policy being used to take the periodic backup for this service + * and its partitions (unless explicitly overridden at the partition level). + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * - * @param {boolean} [repairTask.performPreparingHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Preparing state. + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. * - * @param {boolean} [repairTask.performRestoringHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Restoring state. + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40569,7 +64183,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {RepairTaskUpdateInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40577,14 +64191,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 RepairTaskUpdateInfo} 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. */ - updateRepairExecutionState(repairTask, options, optionalCallback) { + enableServiceBackup(serviceId, enableBackupDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40593,56 +64206,56 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateRepairExecutionState(repairTask, options, (err, result, request, response) => { + self._enableServiceBackup(serviceId, enableBackupDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateRepairExecutionState(repairTask, options, optionalCallback); + return self._enableServiceBackup(serviceId, enableBackupDescription, options, optionalCallback); } } /** - * @summary Gets the information about replicas of a Service Fabric service - * partition. + * @summary Disables periodic backup of Service Fabric service which was + * previously enabled. * - * The GetReplicas endpoint returns information about the replicas of the - * specified partition. The respons include the id, role, status, health, node - * name, uptime, and other details about the replica. + * Disables periodic backup of Service Fabric service which was previously + * enabled. Backup must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application, which this + * service is part of, this service would continue to be periodically backed up + * as per the policy mapped at the application level. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getReplicaInfoListWithHttpOperationResponse(partitionId, options) { + disableServiceBackupWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicaInfoList(partitionId, options, (err, result, request, response) => { + self._disableServiceBackup(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40653,29 +64266,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about replicas of a Service Fabric service - * partition. + * @summary Disables periodic backup of Service Fabric service which was + * previously enabled. * - * The GetReplicas endpoint returns information about the replicas of the - * specified partition. The respons include the id, role, status, health, node - * name, uptime, and other details about the replica. + * Disables periodic backup of Service Fabric service which was previously + * enabled. Backup must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application, which this + * service is part of, this service would continue to be periodically backed up + * as per the policy mapped at the application level. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -40687,7 +64300,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedReplicaInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40695,14 +64308,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 PagedReplicaInfoList} 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. */ - getReplicaInfoList(partitionId, options, optionalCallback) { + disableServiceBackup(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40711,56 +64323,68 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicaInfoList(partitionId, options, (err, result, request, response) => { + self._disableServiceBackup(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getReplicaInfoList(partitionId, options, optionalCallback); + return self._disableServiceBackup(serviceId, options, optionalCallback); } } /** - * @summary Gets the information about a replica of a Service Fabric partition. - * - * The respons include the id, role, status, health, node name, uptime, and - * other details about the replica. + * @summary Gets the Service Fabric service backup configuration information. * - * @param {uuid} partitionId The identity of the partition. + * Gets the Service Fabric backup configuration information for the service and + * the partitions under this service. * - * @param {string} replicaId The identifier of the replica. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getReplicaInfoWithHttpOperationResponse(partitionId, replicaId, options) { + getServiceBackupConfigurationInfoWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicaInfo(partitionId, replicaId, options, (err, result, request, response) => { + self._getServiceBackupConfigurationInfo(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40771,29 +64395,41 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about a replica of a Service Fabric partition. - * - * The respons include the id, role, status, health, node name, uptime, and - * other details about the replica. + * @summary Gets the Service Fabric service backup configuration information. * - * @param {uuid} partitionId The identity of the partition. + * Gets the Service Fabric backup configuration information for the service and + * the partitions under this service. * - * @param {string} replicaId The identifier of the replica. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty + * is used to obtain next set of results. A continuation token with a non-empty * value is included in the response of the API when the results from the * system do not fit in a single response. When this value is passed to the * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of + * results, then the continuation token does not contain a value. The value of * this parameter should not be URL encoded. * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -40805,7 +64441,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ReplicaInfo} - The deserialized result object. + * @resolve {PagedBackupConfigurationInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40814,13 +64450,14 @@ class ServiceFabricClient extends ServiceClient { * {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 ReplicaInfo} for more information. + * See {@link PagedBackupConfigurationInfoList} 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. */ - getReplicaInfo(partitionId, replicaId, options, optionalCallback) { + getServiceBackupConfigurationInfo(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40829,75 +64466,85 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicaInfo(partitionId, replicaId, options, (err, result, request, response) => { + self._getServiceBackupConfigurationInfo(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getReplicaInfo(partitionId, replicaId, options, optionalCallback); + return self._getServiceBackupConfigurationInfo(serviceId, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric stateful service replica or - * stateless service instance. + * @summary Gets the list of backups available for every partition in this + * service. * - * Gets the health of a Service Fabric replica. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the replica based on the health state. + * Returns a list of backups available for every partition in this Service + * Fabric service. The server enumerates all the backups available in the + * backup store configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * - * @param {uuid} partitionId The identity of the partition. + * @param {object} [options] Optional Parameters. * - * @param {string} replicaId The identifier of the replica. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getReplicaHealthWithHttpOperationResponse(partitionId, replicaId, options) { + getServiceBackupListWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicaHealth(partitionId, replicaId, options, (err, result, request, response) => { + self._getServiceBackupList(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40908,48 +64555,58 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric stateful service replica or - * stateless service instance. + * @summary Gets the list of backups available for every partition in this + * service. * - * Gets the health of a Service Fabric replica. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the replica based on the health state. + * Returns a list of backups available for every partition in this Service + * Fabric service. The server enumerates all the backups available in the + * backup store configured in the backup policy. It also allows filtering of + * the result based on start and end datetime or just fetching the latest + * available backup for every partition. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * - * @param {uuid} partitionId The identity of the partition. + * @param {object} [options] Optional Parameters. * - * @param {string} replicaId The identifier of the replica. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -40961,7 +64618,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ReplicaHealth} - The deserialized result object. + * @resolve {PagedBackupInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40970,13 +64627,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ReplicaHealth} for more information. + * See {@link PagedBackupInfoList} 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. */ - getReplicaHealth(partitionId, replicaId, options, optionalCallback) { + getServiceBackupList(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40985,155 +64642,54 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicaHealth(partitionId, replicaId, options, (err, result, request, response) => { + self._getServiceBackupList(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getReplicaHealth(partitionId, replicaId, options, optionalCallback); + return self._getServiceBackupList(serviceId, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric stateful service replica or - * stateless service instance using the specified policy. - * - * Gets the health of a Service Fabric stateful service replica or stateless - * service instance. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the cluster based on the health state. - * Use ApplicationHealthPolicy to optionally override the health policies used - * to evaluate the health. This API only uses 'ConsiderWarningAsError' field of - * the ApplicationHealthPolicy. The rest of the fields are ignored while - * evaluating the health of the replica. + * @summary Suspends periodic backup for the specified Service Fabric service. * + * The service which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. This operation applies to + * the entire service's hierarchy. It means all the partitions under this + * service are now suspended for backup. * - * @param {uuid} partitionId The identity of the partition. - * - * @param {string} replicaId The identifier of the replica. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. - * - * - * @param {number} - * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getReplicaHealthUsingPolicyWithHttpOperationResponse(partitionId, replicaId, options) { + suspendServiceBackupWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, (err, result, request, response) => { + self._suspendServiceBackup(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41144,128 +64700,27 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric stateful service replica or - * stateless service instance using the specified policy. - * - * Gets the health of a Service Fabric stateful service replica or stateless - * service instance. - * Use EventsHealthStateFilter to filter the collection of health events - * reported on the cluster based on the health state. - * Use ApplicationHealthPolicy to optionally override the health policies used - * to evaluate the health. This API only uses 'ConsiderWarningAsError' field of - * the ApplicationHealthPolicy. The rest of the fields are ignored while - * evaluating the health of the replica. - * + * @summary Suspends periodic backup for the specified Service Fabric service. * - * @param {uuid} partitionId The identity of the partition. + * The service which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. This operation applies to + * the entire service's hierarchy. It means all the partitions under this + * service are now suspended for backup. * - * @param {string} replicaId The identifier of the replica. + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.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} - * [options.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. - * - * - * @param {number} - * [options.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} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -41277,7 +64732,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ReplicaHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -41285,14 +64740,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ReplicaHealth} 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. */ - getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback) { + suspendServiceBackup(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -41301,147 +64755,38 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, (err, result, request, response) => { + self._suspendServiceBackup(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback); + return self._suspendServiceBackup(serviceId, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric replica. - * - * Reports health state of the specified Service Fabric replica. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Replica, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run - * GetReplicaHealth and check that the report appears in the HealthEvents - * section. - * - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {string} replicaId The identifier of the replica. - * - * @param {string} serviceKind The kind of service replica (Stateless or - * Stateful) for which the health is being reported. Following are the possible - * values. - * - Stateless - Does not use Service Fabric to make its state highly available - * or reliable. The value is 1 - * - Stateful - Uses Service Fabric to make its state or part of its state - * highly available and reliable. The value is 2. - * . Possible values include: 'Stateless', 'Stateful' - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. - * - * If not specified, time to live defaults to infinite value. - * - * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. - * - * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @summary Resumes periodic backup of a Service Fabric service which was + * previously suspended. * + * The previously suspended Service Fabric service resumes taking periodic + * backup as per the backup policy currently configured for the same. * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. - * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -41452,11 +64797,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - reportReplicaHealthWithHttpOperationResponse(partitionId, replicaId, serviceKind, healthInformation, options) { + resumeServiceBackupWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportReplicaHealth(partitionId, replicaId, serviceKind, healthInformation, options, (err, result, request, response) => { + self._resumeServiceBackup(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41467,135 +64812,26 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric replica. - * - * Reports health state of the specified Service Fabric replica. The report - * must contain the information about the source of the health report and - * property on which it is reported. - * The report is sent to a Service Fabric gateway Replica, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, run - * GetReplicaHealth and check that the report appears in the HealthEvents - * section. - * - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {string} replicaId The identifier of the replica. - * - * @param {string} serviceKind The kind of service replica (Stateless or - * Stateful) for which the health is being reported. Following are the possible - * values. - * - Stateless - Does not use Service Fabric to make its state highly available - * or reliable. The value is 1 - * - Stateful - Uses Service Fabric to make its state or part of its state - * highly available and reliable. The value is 2. - * . Possible values include: 'Stateless', 'Stateful' - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. - * - * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. + * @summary Resumes periodic backup of a Service Fabric service which was + * previously suspended. * - * If not specified, time to live defaults to infinite value. - * - * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. - * - * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. - * - * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * The previously suspended Service Fabric service resumes taking periodic + * backup as per the backup policy currently configured for the same. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -41621,7 +64857,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - reportReplicaHealth(partitionId, replicaId, serviceKind, healthInformation, options, optionalCallback) { + resumeServiceBackup(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -41630,62 +64866,57 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportReplicaHealth(partitionId, replicaId, serviceKind, healthInformation, options, (err, result, request, response) => { + self._resumeServiceBackup(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportReplicaHealth(partitionId, replicaId, serviceKind, healthInformation, options, optionalCallback); + return self._resumeServiceBackup(serviceId, options, optionalCallback); } } /** - * @summary Gets the list of replicas deployed on a Service Fabric node. - * - * Gets the list containing the information about replicas deployed on a - * Service Fabric node. The information include partition id, replica id, - * status of the replica, name of the service, name of the service type and - * other information. Use PartitionId or ServiceManifestName query parameters - * to return information about the deployed replicas matching the specified - * values for those parameters. + * @summary Enables periodic backup of the stateful persisted partition. * - * @param {string} nodeName The name of the node. + * Enables periodic backup of stateful persisted partition. Each partition is + * backed up as per the specified backup policy description. In case the + * application or service, which is partition is part of, is already enabled + * for backup then this operation would override the policy being used to take + * the periodic backup of this partition. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} [options] Optional Parameters. + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. * - * @param {uuid} [options.partitionId] The identity of the partition. + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. * - * @param {string} [options.serviceManifestName] The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServiceReplicaInfoListWithHttpOperationResponse(nodeName, applicationId, options) { + enablePartitionBackupWithHttpOperationResponse(partitionId, enableBackupDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._enablePartitionBackup(partitionId, enableBackupDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41696,35 +64927,30 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of replicas deployed on a Service Fabric node. - * - * Gets the list containing the information about replicas deployed on a - * Service Fabric node. The information include partition id, replica id, - * status of the replica, name of the service, name of the service type and - * other information. Use PartitionId or ServiceManifestName query parameters - * to return information about the deployed replicas matching the specified - * values for those parameters. + * @summary Enables periodic backup of the stateful persisted partition. * - * @param {string} nodeName The name of the node. + * Enables periodic backup of stateful persisted partition. Each partition is + * backed up as per the specified backup policy description. In case the + * application or service, which is partition is part of, is already enabled + * for backup then this operation would override the policy being used to take + * the periodic backup of this partition. + * Note only C# based Reliable Actor and Reliable Stateful services are + * currently supported for periodic backup. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} [options] Optional Parameters. + * @param {object} enableBackupDescription Specifies the parameters for + * enabling backup. * - * @param {uuid} [options.partitionId] The identity of the partition. + * @param {string} enableBackupDescription.backupPolicyName Name of the backup + * policy to be used for enabling periodic backups. * - * @param {string} [options.serviceManifestName] The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -41736,7 +64962,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -41744,13 +64970,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {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. */ - getDeployedServiceReplicaInfoList(nodeName, applicationId, options, optionalCallback) { + enablePartitionBackup(partitionId, enableBackupDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -41759,52 +64985,50 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._enablePartitionBackup(partitionId, enableBackupDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, optionalCallback); + return self._enablePartitionBackup(partitionId, enableBackupDescription, options, optionalCallback); } } /** - * @summary Gets the details of replica deployed on a Service Fabric node. - * - * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * @summary Disables periodic backup of Service Fabric partition which was + * previously enabled. * - * @param {string} nodeName The name of the node. + * Disables periodic backup of partition which was previously enabled. Backup + * must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application or service, + * which this partition is part of, this partition would continue to be + * periodically backed up as per the policy mapped at the higher level entity. * * @param {uuid} partitionId The identity of the partition. * - * @param {string} replicaId The identifier of the replica. - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServiceReplicaDetailInfoWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { + disablePartitionBackupWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, (err, result, request, response) => { + self._disablePartitionBackup(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41815,25 +65039,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the details of replica deployed on a Service Fabric node. - * - * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * @summary Disables periodic backup of Service Fabric partition which was + * previously enabled. * - * @param {string} nodeName The name of the node. + * Disables periodic backup of partition which was previously enabled. Backup + * must be explicitly enabled before it can be disabled. + * In case the backup is enabled for the Service Fabric application or service, + * which this partition is part of, this partition would continue to be + * periodically backed up as per the policy mapped at the higher level entity. * * @param {uuid} partitionId The identity of the partition. * - * @param {string} replicaId The identifier of the replica. - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -41845,7 +65067,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServiceReplicaDetailInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -41853,15 +65075,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 DeployedServiceReplicaDetailInfo} 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. */ - getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback) { + disablePartitionBackup(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -41870,50 +65090,46 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, (err, result, request, response) => { + self._disablePartitionBackup(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback); + return self._disablePartitionBackup(partitionId, options, optionalCallback); } } /** - * @summary Gets the details of replica deployed on a Service Fabric node. - * - * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * @summary Gets the partition backup configuration information * - * @param {string} nodeName The name of the node. + * Gets the Service Fabric Backup configuration information for the specified + * partition. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServiceReplicaDetailInfoByPartitionIdWithHttpOperationResponse(nodeName, partitionId, options) { + getPartitionBackupConfigurationInfoWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, (err, result, request, response) => { + self._getPartitionBackupConfigurationInfo(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41924,23 +65140,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the details of replica deployed on a Service Fabric node. - * - * Gets the details of the replica deployed on a Service Fabric node. The - * information include service kind, service name, current service operation, - * current service operation start date time, partition id, replica/instance - * id, reported load and other information. + * @summary Gets the partition backup configuration information * - * @param {string} nodeName The name of the node. + * Gets the Service Fabric Backup configuration information for the specified + * partition. * * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -41952,7 +65164,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServiceReplicaDetailInfo} - The deserialized result object. + * @resolve {PartitionBackupConfigurationInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -41961,14 +65173,14 @@ class ServiceFabricClient extends ServiceClient { * {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 DeployedServiceReplicaDetailInfo} for more + * See {@link PartitionBackupConfigurationInfo} 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. */ - getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback) { + getPartitionBackupConfigurationInfo(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -41977,52 +65189,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, (err, result, request, response) => { + self._getPartitionBackupConfigurationInfo(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback); + return self._getPartitionBackupConfigurationInfo(partitionId, options, optionalCallback); } } /** - * @summary Restarts a service replica of a persisted service running on a - * node. - * - * Restarts a service replica of a persisted service running on a node. Warning - * - There are no safety checks performed when this API is used. Incorrect use - * of this API can lead to availability loss for stateful services. + * @summary Gets the list of backups available for the specified partition. * - * @param {string} nodeName The name of the node. + * Returns a list of backups available for the specified partition. The server + * enumerates all the backups available in the backup store configured in the + * backup policy. It also allows filtering of the result based on start and end + * datetime or just fetching the latest available backup for the partition. * * @param {uuid} partitionId The identity of the partition. * - * @param {string} replicaId The identifier of the replica. - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - restartReplicaWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { + getPartitionBackupListWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restartReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { + self._getPartitionBackupList(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42033,25 +65254,34 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Restarts a service replica of a persisted service running on a - * node. - * - * Restarts a service replica of a persisted service running on a node. Warning - * - There are no safety checks performed when this API is used. Incorrect use - * of this API can lead to availability loss for stateful services. + * @summary Gets the list of backups available for the specified partition. * - * @param {string} nodeName The name of the node. + * Returns a list of backups available for the specified partition. The server + * enumerates all the backups available in the backup store configured in the + * backup policy. It also allows filtering of the result based on start and end + * datetime or just fetching the latest available backup for the partition. * * @param {uuid} partitionId The identity of the partition. * - * @param {string} replicaId The identifier of the replica. - * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. + * + * @param {date} [options.startDateTimeFilter] Specify the start date time from + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, all backups from the beginning are enumerated. + * + * @param {date} [options.endDateTimeFilter] Specify the end date time till + * which to enumerate backups, in datetime format. The date time must be + * specified in ISO8601 format. This is an optional parameter. If not + * specified, enumeration is done till the most recent backup. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -42063,7 +65293,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedBackupInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -42071,13 +65301,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupInfoList} 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. */ - restartReplica(nodeName, partitionId, replicaId, options, optionalCallback) { + getPartitionBackupList(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42086,48 +65317,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { + self._getPartitionBackupList(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restartReplica(nodeName, partitionId, replicaId, options, optionalCallback); + return self._getPartitionBackupList(partitionId, options, optionalCallback); } } /** - * @summary Removes a service replica running on a node. - * - * This API simulates a Service Fabric replica failure by removing a replica - * from a Service Fabric cluster. The removal closes the replica, transitions - * the replica to the role None, and then removes all of the state information - * of the replica from the cluster. This API tests the replica state removal - * path, and simulates the report fault permanent path through client APIs. - * Warning - There are no safety checks performed when this API is used. - * Incorrect use of this API can lead to data loss for stateful services.In - * addition, the forceRemove flag impacts all other replicas hosted in the same - * process. + * @summary Suspends periodic backup for the specified partition. * - * @param {string} nodeName The name of the node. + * The partition which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. * * @param {uuid} partitionId The identity of the partition. * - * @param {string} replicaId The identifier of the replica. - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.forceRemove] Remove a Service Fabric application - * or service forcefully without going through the graceful shutdown sequence. - * This parameter can be used to forcefully delete an application or service - * for which delete is timing out due to issues in the service code that - * prevents graceful close of replicas. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -42138,11 +65352,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - removeReplicaWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { + suspendPartitionBackupWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._removeReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { + self._suspendPartitionBackup(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42153,36 +65367,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Removes a service replica running on a node. - * - * This API simulates a Service Fabric replica failure by removing a replica - * from a Service Fabric cluster. The removal closes the replica, transitions - * the replica to the role None, and then removes all of the state information - * of the replica from the cluster. This API tests the replica state removal - * path, and simulates the report fault permanent path through client APIs. - * Warning - There are no safety checks performed when this API is used. - * Incorrect use of this API can lead to data loss for stateful services.In - * addition, the forceRemove flag impacts all other replicas hosted in the same - * process. + * @summary Suspends periodic backup for the specified partition. * - * @param {string} nodeName The name of the node. + * The partition which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. * * @param {uuid} partitionId The identity of the partition. * - * @param {string} replicaId The identifier of the replica. - * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.forceRemove] Remove a Service Fabric application - * or service forcefully without going through the graceful shutdown sequence. - * This parameter can be used to forcefully delete an application or service - * for which delete is timing out due to issues in the service code that - * prevents graceful close of replicas. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -42208,7 +65405,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - removeReplica(nodeName, partitionId, replicaId, options, optionalCallback) { + suspendPartitionBackup(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42217,54 +65414,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._removeReplica(nodeName, partitionId, replicaId, options, (err, result, request, response) => { + self._suspendPartitionBackup(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._removeReplica(nodeName, partitionId, replicaId, options, optionalCallback); + return self._suspendPartitionBackup(partitionId, options, optionalCallback); } } /** - * @summary Gets the list of service packages deployed on a Service Fabric - * node. - * - * Returns the information about the service packages deployed on a Service - * Fabric node for the given application. + * @summary Resumes periodic backup of partition which was previously + * suspended. * - * @param {string} nodeName The name of the node. + * The previously suspended partition resumes taking periodic backup as per the + * backup policy currently configured for the same. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServicePackageInfoListWithHttpOperationResponse(nodeName, applicationId, options) { + resumePartitionBackupWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._resumePartitionBackup(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42275,27 +65465,20 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of service packages deployed on a Service Fabric - * node. + * @summary Resumes periodic backup of partition which was previously + * suspended. * - * Returns the information about the service packages deployed on a Service - * Fabric node for the given application. - * - * @param {string} nodeName The name of the node. + * The previously suspended partition resumes taking periodic backup as per the + * backup policy currently configured for the same. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -42307,7 +65490,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -42315,13 +65498,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {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. */ - getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback) { + resumePartitionBackup(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42330,58 +65513,75 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._resumePartitionBackup(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback); + return self._resumePartitionBackup(partitionId, options, optionalCallback); } } /** - * @summary Gets the list of service packages deployed on a Service Fabric node - * matching exactly the specified name. + * @summary Triggers backup of the partition's state. * - * Returns the information about the service packages deployed on a Service - * Fabric node for the given application. These results are of service packages - * whose name match exactly the service package name specified as the - * parameter. + * Creates a backup of the stateful persisted partition's state. In case the + * partition is already being periodically backed up, then by default the new + * backup is created at the same backup storage. One can also override the same + * by specifying the backup storage details as part of the request body. Once + * the backup is initiated, its progress can be tracked using the + * GetBackupProgress operation. + * In case, the operation times out, specify a greater backup timeout value in + * the query parameter. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {object} [options] Optional Parameters. * - * @param {string} servicePackageName The name of the service package. + * @param {object} [options.backupPartitionDescription] Describes the + * parameters to backup the partition now. If not present, backup operation + * uses default parameters from the backup policy current associated with this + * partition. * - * @param {object} [options] Optional Parameters. + * @param {object} [options.backupPartitionDescription.backupStorage] Specifies + * the details of the backup storage where to save the backup. + * + * @param {string} + * [options.backupPartitionDescription.backupStorage.friendlyName] Friendly + * name for this backup storage. + * + * @param {string} options.backupPartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {number} [options.backupTimeout] Specifies the maximum amount of + * time, in minutes, to wait for the backup operation to complete. Post that, + * the operation completes with timeout error. However, in certain corner cases + * it could be that though the operation returns back timeout, the backup + * actually goes through. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. The default value for the + * same is 10 minutes. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServicePackageInfoListByNameWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { + backupPartitionWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { + self._backupPartition(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42392,31 +65592,48 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of service packages deployed on a Service Fabric node - * matching exactly the specified name. + * @summary Triggers backup of the partition's state. * - * Returns the information about the service packages deployed on a Service - * Fabric node for the given application. These results are of service packages - * whose name match exactly the service package name specified as the - * parameter. + * Creates a backup of the stateful persisted partition's state. In case the + * partition is already being periodically backed up, then by default the new + * backup is created at the same backup storage. One can also override the same + * by specifying the backup storage details as part of the request body. Once + * the backup is initiated, its progress can be tracked using the + * GetBackupProgress operation. + * In case, the operation times out, specify a greater backup timeout value in + * the query parameter. * - * @param {string} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {object} [options] Optional Parameters. * - * @param {string} servicePackageName The name of the service package. + * @param {object} [options.backupPartitionDescription] Describes the + * parameters to backup the partition now. If not present, backup operation + * uses default parameters from the backup policy current associated with this + * partition. * - * @param {object} [options] Optional Parameters. + * @param {object} [options.backupPartitionDescription.backupStorage] Specifies + * the details of the backup storage where to save the backup. + * + * @param {string} + * [options.backupPartitionDescription.backupStorage.friendlyName] Friendly + * name for this backup storage. + * + * @param {string} options.backupPartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator + * + * @param {number} [options.backupTimeout] Specifies the maximum amount of + * time, in minutes, to wait for the backup operation to complete. Post that, + * the operation completes with timeout error. However, in certain corner cases + * it could be that though the operation returns back timeout, the backup + * actually goes through. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. The default value for the + * same is 10 minutes. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -42428,7 +65645,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -42436,13 +65653,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {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. */ - getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, optionalCallback) { + backupPartition(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42451,82 +65668,46 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { + self._backupPartition(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, optionalCallback); + return self._backupPartition(partitionId, options, optionalCallback); } } /** - * @summary Gets the information about health of an service package for a - * specific application deployed for a Service Fabric node and application. - * - * Gets the information about health of service package for a specific - * application deployed on a Service Fabric node. Use EventsHealthStateFilter - * to optionally filter for the collection of HealthEvent objects reported on - * the deployed service package based on health state. - * - * @param {string} nodeName The name of the node. + * @summary Gets details for the latest backup triggered for this partition. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * Returns information about the state of the latest backup along with details + * or failure reason in case of completion. * - * @param {string} servicePackageName The name of the service package. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServicePackageHealthWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { + getPartitionBackupProgressWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { + self._getPartitionBackupProgress(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42537,55 +65718,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about health of an service package for a - * specific application deployed for a Service Fabric node and application. - * - * Gets the information about health of service package for a specific - * application deployed on a Service Fabric node. Use EventsHealthStateFilter - * to optionally filter for the collection of HealthEvent objects reported on - * the deployed service package based on health state. - * - * @param {string} nodeName The name of the node. + * @summary Gets details for the latest backup triggered for this partition. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * Returns information about the state of the latest backup along with details + * or failure reason in case of completion. * - * @param {string} servicePackageName The name of the service package. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -42597,7 +65742,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServicePackageHealth} - The deserialized result object. + * @resolve {BackupProgressInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -42606,14 +65751,13 @@ class ServiceFabricClient extends ServiceClient { * {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 DeployedServicePackageHealth} for more - * information. + * See {@link BackupProgressInfo} 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. */ - getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback) { + getPartitionBackupProgress(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42622,303 +65766,135 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { + self._getPartitionBackupProgress(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback); + return self._getPartitionBackupProgress(partitionId, options, optionalCallback); } } /** - * @summary Gets the information about health of service package for a specific - * application deployed on a Service Fabric node using the specified policy. - * - * Gets the information about health of an service package for a specific - * application deployed on a Service Fabric node. using the specified policy. - * Use EventsHealthStateFilter to optionally filter for the collection of - * HealthEvent objects reported on the deployed service package based on health - * state. Use ApplicationHealthPolicy to optionally override the health - * policies used to evaluate the health. This API only uses - * 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of - * the fields are ignored while evaluating the health of the deployed service - * package. - * - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {string} servicePackageName The name of the service package. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * @summary Triggers restore of the state of the partition using the specified + * restore partition description. + * + * Restores the state of a of the stateful persisted partition using the + * specified backup point. In case the partition is already being periodically + * backed up, then by default the backup point is looked for in the storage + * specified in backup policy. One can also override the same by specifying the + * backup storage details as part of the restore partition description in body. + * Once the restore is initiated, its progress can be tracked using the + * GetRestoreProgress operation. + * In case, the operation times out, specify a greater restore timeout value in + * the query parameter. * - * 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 {uuid} partitionId The identity of the partition. * + * @param {object} restorePartitionDescription Describes the parameters to + * restore the partition. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * @param {uuid} restorePartitionDescription.backupId Unique backup ID. * - * 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} restorePartitionDescription.backupLocation Location of the + * backup relative to the backup storage specified/ configured. * + * @param {object} [restorePartitionDescription.backupStorage] Location of the + * backup from where the partition will be restored. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * @param {string} [restorePartitionDescription.backupStorage.friendlyName] + * Friendly name for this backup storage. * - * 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} restorePartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator * + * @param {object} [options] Optional Parameters. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {number} [options.restoreTimeout] Specifies the maximum amount of + * time to wait, in minutes, for the restore operation to complete. Post that, + * the operation returns back with timeout error. However, in certain corner + * cases it could be that the restore operation goes through even though it + * completes with timeout. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. the default value for the + * same is 10 minutes. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServicePackageHealthUsingPolicyWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { + restorePartitionWithHttpOperationResponse(partitionId, restorePartitionDescription, options) { let client = this; let self = this; - return new Promise((resolve, reject) => { - self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, 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 information about health of service package for a specific - * application deployed on a Service Fabric node using the specified policy. - * - * Gets the information about health of an service package for a specific - * application deployed on a Service Fabric node. using the specified policy. - * Use EventsHealthStateFilter to optionally filter for the collection of - * HealthEvent objects reported on the deployed service package based on health - * state. Use ApplicationHealthPolicy to optionally override the health - * policies used to evaluate the health. This API only uses - * 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of - * the fields are ignored while evaluating the health of the deployed service - * package. - * - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {string} servicePackageName The name of the service package. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.eventsHealthStateFilter] Allows filtering the - * collection of HealthEvent objects returned based on health state. - * The possible values for this parameter include integer value of one of the - * following health states. - * Only events that match the filter are returned. All events are used to - * evaluate the aggregated health state. - * If not specified, all entries are returned. The state values are flag based - * enumeration, so the value could be a combination of these value obtained - * using bitwise 'OR' operator. For example, If the provided value is 6 then - * all of the events with HealthState value of OK (2) and Warning (4) are - * returned. - * - * - Default - Default value. Matches any HealthState. The value is zero. - * - None - Filter that doesn't match any HealthState value. Used in order to - * return no results on a given collection of states. The value is 1. - * - Ok - Filter that matches input with HealthState value Ok. The value is 2. - * - Warning - Filter that matches input with HealthState value Warning. The - * value is 4. - * - Error - Filter that matches input with HealthState value Error. The value - * is 8. - * - All - Filter that matches input with any HealthState value. The value is - * 65535. - * - * - * @param {object} [options.applicationHealthPolicy] Describes the health - * policies used to evaluate the health of an application or one of its - * children. - * If not present, the health evaluation uses the health policy from - * application manifest or the default health policy. - * - * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. - * - * @param {number} - * [options.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} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + return new Promise((resolve, reject) => { + self._restorePartition(partitionId, restorePartitionDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Triggers restore of the state of the partition using the specified + * restore partition description. + * + * Restores the state of a of the stateful persisted partition using the + * specified backup point. In case the partition is already being periodically + * backed up, then by default the backup point is looked for in the storage + * specified in backup policy. One can also override the same by specifying the + * backup storage details as part of the restore partition description in body. + * Once the restore is initiated, its progress can be tracked using the + * GetRestoreProgress operation. + * In case, the operation times out, specify a greater restore timeout value in + * the query parameter. * - * 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 {uuid} partitionId The identity of the partition. * + * @param {object} restorePartitionDescription Describes the parameters to + * restore the partition. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * @param {uuid} restorePartitionDescription.backupId Unique backup ID. * - * 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} restorePartitionDescription.backupLocation Location of the + * backup relative to the backup storage specified/ configured. * + * @param {object} [restorePartitionDescription.backupStorage] Location of the + * backup from where the partition will be restored. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * @param {string} [restorePartitionDescription.backupStorage.friendlyName] + * Friendly name for this backup storage. * - * 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} restorePartitionDescription.backupStorage.storageKind + * Polymorphic Discriminator * + * @param {object} [options] Optional Parameters. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {number} [options.restoreTimeout] Specifies the maximum amount of + * time to wait, in minutes, for the restore operation to complete. Post that, + * the operation returns back with timeout error. However, in certain corner + * cases it could be that the restore operation goes through even though it + * completes with timeout. In case of timeout error, its recommended to invoke + * this operation again with a greater timeout value. the default value for the + * same is 10 minutes. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -42930,7 +65906,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServicePackageHealth} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -42938,15 +65914,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 DeployedServicePackageHealth} 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. */ - getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback) { + restorePartition(partitionId, restorePartitionDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42955,161 +65929,196 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, (err, result, request, response) => { + self._restorePartition(partitionId, restorePartitionDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback); + return self._restorePartition(partitionId, restorePartitionDescription, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric deployed service - * package. + * @summary Gets details for the latest restore operation triggered for this + * partition. * - * Reports health state of the service package of the application deployed on a - * Service Fabric node. The report must contain the information about the - * source of the health report and property on which it is reported. - * The report is sent to a Service Fabric gateway Service, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, get deployed - * service package health and check that the report appears in the HealthEvents - * section. + * Returns information about the state of the latest restore operation along + * with details or failure reason in case of completion. * + * @param {uuid} partitionId The identity of the partition. * - * @param {string} nodeName The name of the node. + * @param {object} [options] Optional Parameters. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {string} servicePackageName The name of the service package. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. + * @returns {Promise} A promise is returned * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. + * @resolve {HttpOperationResponse} - The deserialized result object. * + * @reject {Error} - The error object. + */ + getPartitionRestoreProgressWithHttpOperationResponse(partitionId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getPartitionRestoreProgress(partitionId, 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 details for the latest restore operation triggered for this + * partition. * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. + * Returns information about the state of the latest restore operation along + * with details or failure reason in case of completion. * - * Together with the SourceId, the property uniquely identifies the health - * information. + * @param {uuid} partitionId The identity of the partition. * + * @param {object} [options] Optional Parameters. * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * If not specified, time to live defaults to infinite value. + * @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. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * {Promise} A promise is returned * + * @resolve {RestoreProgressInfo} - The deserialized result object. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @reject {Error} - The error object. * + * {function} optionalCallback(err, result, request, response) * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * {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 RestoreProgressInfo} for more information. * - * @param {object} [options] Optional Parameters. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getPartitionRestoreProgress(partitionId, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getPartitionRestoreProgress(partitionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPartitionRestoreProgress(partitionId, options, optionalCallback); + } + } + + /** + * @summary Gets the list of backups available for the specified backed up + * entity at the specified backup location. + * + * Gets the list of backups available for the specified backed up entity + * (Application, Service or Partition) at the specified backup location + * (FileShare or Azure Blob Storage). + * + * @param {object} getBackupByStorageQueryDescription Describes the filters and + * backup storage details to be used for enumerating backups. + * + * @param {date} [getBackupByStorageQueryDescription.startDateTimeFilter] + * Specifies the start date time in ISO8601 from which to enumerate backups. If + * not specified, backups are enumerated from the beginning. + * + * @param {date} [getBackupByStorageQueryDescription.endDateTimeFilter] + * Specifies the end date time in ISO8601 till which to enumerate backups. If + * not specified, backups are enumerated till the end. + * + * @param {boolean} [getBackupByStorageQueryDescription.latest] If specified as + * true, gets the most recent backup (within the specified time range) for + * every partition under the specified backup entity. + * + * @param {object} getBackupByStorageQueryDescription.storage Describes the + * parameters for the backup storage from where to enumerate backups. This is + * optional and by default backups are enumerated from the backup storage where + * this backup entity is currently being backed up (as specified in backup + * policy). This parameter is useful to be able to enumerate backups from + * another cluster where you may intend to restore. + * + * @param {string} [getBackupByStorageQueryDescription.storage.friendlyName] + * Friendly name for this backup storage. + * + * @param {string} getBackupByStorageQueryDescription.storage.storageKind + * Polymorphic Discriminator + * + * @param {object} getBackupByStorageQueryDescription.backupEntity Indicates + * the entity for which to enumerate backups. + * + * @param {string} getBackupByStorageQueryDescription.backupEntity.entityKind + * Polymorphic Discriminator * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - reportDeployedServicePackageHealthWithHttpOperationResponse(nodeName, applicationId, servicePackageName, healthInformation, options) { + getBackupsFromBackupLocationWithHttpOperationResponse(getBackupByStorageQueryDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, (err, result, request, response) => { + self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43120,134 +66129,69 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric deployed service - * package. - * - * Reports health state of the service package of the application deployed on a - * Service Fabric node. The report must contain the information about the - * source of the health report and property on which it is reported. - * The report is sent to a Service Fabric gateway Service, which forwards to - * the health store. - * The report may be accepted by the gateway, but rejected by the health store - * after extra validation. - * For example, the health store may reject the report because of an invalid - * parameter, like a stale sequence number. - * To see whether the report was applied in the health store, get deployed - * service package health and check that the report appears in the HealthEvents - * section. - * - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {string} servicePackageName The name of the service package. - * - * @param {object} healthInformation Describes the health information for the - * health report. This information needs to be present in all of the health - * reports sent to the health manager. - * - * @param {string} healthInformation.sourceId The source name which identifies - * the client/watchdog/system component which generated the health information. - * - * - * @param {string} healthInformation.property The property of the health - * information. An entity can have health reports for different properties. - * The property is a string and not a fixed enumeration to allow the reporter - * flexibility to categorize the state condition that triggers the report. - * For example, a reporter with SourceId "LocalWatchdog" can monitor the state - * of the available disk on a node, - * so it can report "AvailableDisk" property on that node. - * The same reporter can monitor the node connectivity, so it can report a - * property "Connectivity" on the same node. - * In the health store, these reports are treated as separate health events for - * the specified node. - * - * Together with the SourceId, the property uniquely identifies the health - * information. + * @summary Gets the list of backups available for the specified backed up + * entity at the specified backup location. * + * Gets the list of backups available for the specified backed up entity + * (Application, Service or Partition) at the specified backup location + * (FileShare or Azure Blob Storage). * - * @param {string} healthInformation.healthState Possible values include: - * 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' - * - * @param {moment.duration} [healthInformation.timeToLiveInMilliSeconds] The - * duration for which this health report is valid. This field is using ISO8601 - * format for specifying the duration. - * When clients report periodically, they should send reports with higher - * frequency than time to live. - * If clients report on transition, they can set the time to live to infinite. - * When time to live expires, the health event that contains the health - * information - * is either removed from health store, if RemoveWhenExpired is true, or - * evaluated at error, if RemoveWhenExpired false. + * @param {object} getBackupByStorageQueryDescription Describes the filters and + * backup storage details to be used for enumerating backups. * - * If not specified, time to live defaults to infinite value. + * @param {date} [getBackupByStorageQueryDescription.startDateTimeFilter] + * Specifies the start date time in ISO8601 from which to enumerate backups. If + * not specified, backups are enumerated from the beginning. * + * @param {date} [getBackupByStorageQueryDescription.endDateTimeFilter] + * Specifies the end date time in ISO8601 till which to enumerate backups. If + * not specified, backups are enumerated till the end. * - * @param {string} [healthInformation.description] The description of the - * health information. It represents free text used to add human readable - * information about the report. - * The maximum string length for the description is 4096 characters. - * If the provided string is longer, it will be automatically truncated. - * When truncated, the last characters of the description contain a marker - * "[Truncated]", and total string size is 4096 characters. - * The presence of the marker indicates to users that truncation occurred. - * Note that when truncated, the description has less than 4096 characters from - * the original string. + * @param {boolean} [getBackupByStorageQueryDescription.latest] If specified as + * true, gets the most recent backup (within the specified time range) for + * every partition under the specified backup entity. * + * @param {object} getBackupByStorageQueryDescription.storage Describes the + * parameters for the backup storage from where to enumerate backups. This is + * optional and by default backups are enumerated from the backup storage where + * this backup entity is currently being backed up (as specified in backup + * policy). This parameter is useful to be able to enumerate backups from + * another cluster where you may intend to restore. * - * @param {string} [healthInformation.sequenceNumber] The sequence number for - * this health report as a numeric string. - * The report sequence number is used by the health store to detect stale - * reports. - * If not specified, a sequence number is auto-generated by the health client - * when a report is added. + * @param {string} [getBackupByStorageQueryDescription.storage.friendlyName] + * Friendly name for this backup storage. * + * @param {string} getBackupByStorageQueryDescription.storage.storageKind + * Polymorphic Discriminator * - * @param {boolean} [healthInformation.removeWhenExpired] Value that indicates - * whether the report is removed from health store when it expires. - * If set to true, the report is remopved from the health store after it - * expires. - * If set to false, the report is treated as an error when expired. The value - * of this property is false by default. - * When clients report periodically, they should set RemoveWhenExpired false - * (default). - * This way, is the reporter has issues (eg. deadlock) and can't report, the - * entity is evaluated at error when the health report expires. - * This flags the entity as being in Error health state. + * @param {object} getBackupByStorageQueryDescription.backupEntity Indicates + * the entity for which to enumerate backups. * + * @param {string} getBackupByStorageQueryDescription.backupEntity.entityKind + * Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.immediate] A flag which indicates whether the - * report should be sent immediately. - * A health report is sent to a Service Fabric gateway Application, which - * forwards to the health store. - * If Immediate is set to true, the report is sent immediately from Http - * Gateway to the health store, regardless of the fabric client settings that - * the Http Gateway Application is using. - * This is useful for critical reports that should be sent as soon as possible. - * Depending on timing and other conditions, sending the report may still fail, - * for example if the Http Gateway is closed or the message doesn't reach the - * Gateway. - * If Immediate is set to false, the report is sent based on the health client - * settings from the Http Gateway. Therefore, it will be batched according to - * the HealthReportSendInterval configuration. - * This is the recommended setting because it allows the health client to - * optimize health reporting messages to health store as well as health report - * processing. - * By default, reports are not sent immediately. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {number} [options.maxResults] The maximum number of results to be + * returned as part of the paged queries. This parameter defines the upper + * bound on the number of results returned. The results returned can be less + * than the specified maximum results if they do not fit in the message as per + * the max message size restrictions defined in the configuration. If this + * parameter is zero or not specified, the paged query includes as many results + * as possible that fit in the return message. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43259,7 +66203,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedBackupInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43267,13 +66211,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedBackupInfoList} 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. */ - reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback) { + getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43282,46 +66227,34 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, (err, result, request, response) => { + self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback); + return self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, optionalCallback); } } /** - * @summary Downloads packages associated with specified service manifest to - * image cache on specified node. - * - * Downloads packages associated with specified service manifest to image cache - * on specified node. - * - * - * @param {string} nodeName The name of the node. - * - * @param {object} deployServicePackageToNodeDescription Describes information - * for deploying a service package to a Service Fabric node. - * - * @param {string} deployServicePackageToNodeDescription.serviceManifestName - * - * @param {string} deployServicePackageToNodeDescription.applicationTypeName + * @summary Creates a Service Fabric name. * - * @param {string} deployServicePackageToNodeDescription.applicationTypeVersion + * Creates the specified Service Fabric name. * - * @param {string} deployServicePackageToNodeDescription.nodeName + * @param {object} nameDescription Describes the Service Fabric name to be + * created. * - * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] + * @param {string} nameDescription.name The Service Fabric name, including the + * 'fabric:' URI scheme. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43332,11 +66265,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - deployedServicePackageToNodeWithHttpOperationResponse(nodeName, deployServicePackageToNodeDescription, options) { + createNameWithHttpOperationResponse(nameDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deployedServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, (err, result, request, response) => { + self._createName(nameDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43347,34 +66280,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Downloads packages associated with specified service manifest to - * image cache on specified node. - * - * Downloads packages associated with specified service manifest to image cache - * on specified node. - * - * - * @param {string} nodeName The name of the node. - * - * @param {object} deployServicePackageToNodeDescription Describes information - * for deploying a service package to a Service Fabric node. - * - * @param {string} deployServicePackageToNodeDescription.serviceManifestName - * - * @param {string} deployServicePackageToNodeDescription.applicationTypeName + * @summary Creates a Service Fabric name. * - * @param {string} deployServicePackageToNodeDescription.applicationTypeVersion + * Creates the specified Service Fabric name. * - * @param {string} deployServicePackageToNodeDescription.nodeName + * @param {object} nameDescription Describes the Service Fabric name to be + * created. * - * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] + * @param {string} nameDescription.name The Service Fabric name, including the + * 'fabric:' URI scheme. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43400,7 +66321,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deployedServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback) { + createName(nameDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43409,60 +66330,46 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deployedServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, (err, result, request, response) => { + self._createName(nameDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deployedServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback); + return self._createName(nameDescription, options, optionalCallback); } } /** - * @summary Gets the list of code packages deployed on a Service Fabric node. - * - * Gets the list of code packages deployed on a Service Fabric node for the - * given application. + * @summary Returns whether the Service Fabric name exists. * - * @param {string} nodeName The name of the node. + * Returns whether the specified Service Fabric name exists. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceManifestName] The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. - * - * @param {string} [options.codePackageName] The name of code package specified - * in service manifest registered as part of an application type in a Service - * Fabric cluster. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedCodePackageInfoListWithHttpOperationResponse(nodeName, applicationId, options) { + getNameExistsInfoWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedCodePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._getNameExistsInfo(nameId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43473,33 +66380,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of code packages deployed on a Service Fabric node. - * - * Gets the list of code packages deployed on a Service Fabric node for the - * given application. + * @summary Returns whether the Service Fabric name exists. * - * @param {string} nodeName The name of the node. + * Returns whether the specified Service Fabric name exists. * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceManifestName] The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. - * - * @param {string} [options.codePackageName] The name of code package specified - * in service manifest registered as part of an application type in a Service - * Fabric cluster. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43511,7 +66404,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43519,13 +66412,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {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. */ - getDeployedCodePackageInfoList(nodeName, applicationId, options, optionalCallback) { + getNameExistsInfo(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43534,52 +66427,32 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedCodePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._getNameExistsInfo(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedCodePackageInfoList(nodeName, applicationId, options, optionalCallback); + return self._getNameExistsInfo(nameId, options, optionalCallback); } } /** - * @summary Restarts a code package deployed on a Service Fabric node in a - * cluster. - * - * Restarts a code package deployed on a Service Fabric node in a cluster. This - * aborts the code package process, which will restart all the user service - * replicas hosted in that process. - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} restartDeployedCodePackageDescription Describes the deployed - * code package on Service Fabric node to restart. - * - * @param {string} restartDeployedCodePackageDescription.serviceManifestName - * - * @param {string} - * [restartDeployedCodePackageDescription.servicePackageActivationId] + * @summary Deletes a Service Fabric name. * - * @param {string} restartDeployedCodePackageDescription.codePackageName + * Deletes the specified Service Fabric name. A name must be created before it + * can be deleted. Deleting a name with child properties will fail. * - * @param {string} restartDeployedCodePackageDescription.codePackageInstanceId + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43590,11 +66463,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - restartDeployedCodePackageWithHttpOperationResponse(nodeName, applicationId, restartDeployedCodePackageDescription, options) { + deleteNameWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, (err, result, request, response) => { + self._deleteName(nameId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43605,40 +66478,20 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Restarts a code package deployed on a Service Fabric node in a - * cluster. - * - * Restarts a code package deployed on a Service Fabric node in a cluster. This - * aborts the code package process, which will restart all the user service - * replicas hosted in that process. - * - * @param {string} nodeName The name of the node. - * - * @param {string} applicationId The identity of the application. This is - * typically the full name of the application without the 'fabric:' URI scheme. - * Starting from version 6.0, hierarchical names are delimited with the "~" - * character. For example, if the application name is "fabric://myapp/app1", - * the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in - * previous versions. - * - * @param {object} restartDeployedCodePackageDescription Describes the deployed - * code package on Service Fabric node to restart. - * - * @param {string} restartDeployedCodePackageDescription.serviceManifestName - * - * @param {string} - * [restartDeployedCodePackageDescription.servicePackageActivationId] + * @summary Deletes a Service Fabric name. * - * @param {string} restartDeployedCodePackageDescription.codePackageName + * Deletes the specified Service Fabric name. A name must be created before it + * can be deleted. Deleting a name with child properties will fail. * - * @param {string} restartDeployedCodePackageDescription.codePackageInstanceId + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43664,7 +66517,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, optionalCallback) { + deleteName(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43673,65 +66526,60 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, (err, result, request, response) => { + self._deleteName(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, optionalCallback); + return self._deleteName(nameId, options, optionalCallback); } } /** - * @summary Creates a Service Fabric compose deployment. - * - * Creates a Service Fabric compose deployment. - * - * @param {object} createComposeDeploymentDescription Describes the compose - * deployment that needs to be created. - * - * @param {string} createComposeDeploymentDescription.deploymentName - * - * @param {string} createComposeDeploymentDescription.composeFileContent The - * content of the compose file that describes the deployment to create. + * @summary Enumerates all the Service Fabric names under a given name. * - * @param {object} [createComposeDeploymentDescription.registryCredential] + * Enumerates all the Service Fabric names under a given name. If the subnames + * do not fit in a page, one page of results is returned as well as a + * continuation token, which can be used to get the next page. Querying a name + * that doesn't exist will fail. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryUserName] The - * user name to connect to container registry. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryPassword] The - * password for supplied username to connect to container registry. + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] - * Indicates that supplied container registry password is encrypted. + * @param {boolean} [options.recursive] Allows specifying that the search + * performed should be recursive. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createComposeDeploymentWithHttpOperationResponse(createComposeDeploymentDescription, options) { + getSubNameInfoListWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createComposeDeployment(createComposeDeploymentDescription, options, (err, result, request, response) => { + self._getSubNameInfoList(nameId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43742,38 +66590,33 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates a Service Fabric compose deployment. - * - * Creates a Service Fabric compose deployment. - * - * @param {object} createComposeDeploymentDescription Describes the compose - * deployment that needs to be created. - * - * @param {string} createComposeDeploymentDescription.deploymentName - * - * @param {string} createComposeDeploymentDescription.composeFileContent The - * content of the compose file that describes the deployment to create. + * @summary Enumerates all the Service Fabric names under a given name. * - * @param {object} [createComposeDeploymentDescription.registryCredential] + * Enumerates all the Service Fabric names under a given name. If the subnames + * do not fit in a page, one page of results is returned as well as a + * continuation token, which can be used to get the next page. Querying a name + * that doesn't exist will fail. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryUserName] The - * user name to connect to container registry. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryPassword] The - * password for supplied username to connect to container registry. + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] - * Indicates that supplied container registry password is encrypted. + * @param {boolean} [options.recursive] Allows specifying that the search + * performed should be recursive. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43785,7 +66628,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedSubNameInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43793,13 +66636,14 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedSubNameInfoList} 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. */ - createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback) { + getSubNameInfoList(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43808,48 +66652,62 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createComposeDeployment(createComposeDeploymentDescription, options, (err, result, request, response) => { + self._getSubNameInfoList(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback); + return self._getSubNameInfoList(nameId, options, optionalCallback); } } /** - * @summary Gets information about a Service Fabric compose deployment. + * @summary Gets information on all Service Fabric properties under a given + * name. * - * Returns the status of the compose deployment that was created or in the - * process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * status and other details about the deployment. + * A Service Fabric name can have one or more named properties that store + * custom information. This operation gets the information about these + * properties in a paged list. The information includes name, value, and + * metadata about each of the properties. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.includeValues] Allows specifying whether to + * include the values of the properties returned. True if values should be + * returned with the metadata; False to return only property metadata. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getComposeDeploymentStatusWithHttpOperationResponse(deploymentName, options) { + getPropertyInfoListWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getComposeDeploymentStatus(deploymentName, options, (err, result, request, response) => { + self._getPropertyInfoList(nameId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43860,21 +66718,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets information about a Service Fabric compose deployment. + * @summary Gets information on all Service Fabric properties under a given + * name. * - * Returns the status of the compose deployment that was created or in the - * process of being created in the Service Fabric cluster and whose name - * matches the one specified as the parameter. The response includes the name, - * status and other details about the deployment. + * A Service Fabric name can have one or more named properties that store + * custom information. This operation gets the information about these + * properties in a paged list. The information includes name, value, and + * metadata about each of the properties. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.includeValues] Allows specifying whether to + * include the values of the properties returned. True if values should be + * returned with the metadata; False to return only property metadata. + * + * @param {string} [options.continuationToken] The continuation token parameter + * is used to obtain next set of results. A continuation token with a non-empty + * value is included in the response of the API when the results from the + * system do not fit in a single response. When this value is passed to the + * next API call, the API returns next set of results. If there are no further + * results, then the continuation token does not contain a value. The value of + * this parameter should not be URL encoded. + * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -43886,7 +66758,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ComposeDeploymentStatusInfo} - The deserialized result object. + * @resolve {PagedPropertyInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43895,14 +66767,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ComposeDeploymentStatusInfo} for more - * information. + * See {@link PagedPropertyInfoList} 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. */ - getComposeDeploymentStatus(deploymentName, options, optionalCallback) { + getPropertyInfoList(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43911,65 +66782,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getComposeDeploymentStatus(deploymentName, options, (err, result, request, response) => { + self._getPropertyInfoList(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getComposeDeploymentStatus(deploymentName, options, optionalCallback); + return self._getPropertyInfoList(nameId, options, optionalCallback); } } /** - * @summary Gets the list of compose deployments created in the Service Fabric - * cluster. + * @summary Creates or updates a Service Fabric property. * - * Gets the status about the compose deployments that were created or in the - * process of being created in the Service Fabric cluster. The response - * includes the name, status and other details about the compose deployments. - * If the list of deployments do not fit in a page, one page of results is - * returned as well as a continuation token which can be used to get the next - * page. + * Creates or updates the specified Service Fabric property under a given name. * - * @param {object} [options] Optional Parameters. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {object} propertyDescription Describes the Service Fabric property to + * be created. * - * @param {number} [options.maxResults] The maximum number of results to be - * returned as part of the paged queries. This parameter defines the upper - * bound on the number of results returned. The results returned can be less - * than the specified maximum results if they do not fit in the message as per - * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * @param {string} propertyDescription.propertyName The name of the Service + * Fabric property. + * + * @param {string} [propertyDescription.customTypeId] The property's custom + * type ID. Using this property, the user is able to tag the type of the value + * of the property. + * + * @param {object} propertyDescription.value Describes a Service Fabric + * property value. + * + * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getComposeDeploymentStatusListWithHttpOperationResponse(options) { + putPropertyWithHttpOperationResponse(nameId, propertyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getComposeDeploymentStatusList(options, (err, result, request, response) => { + self._putProperty(nameId, propertyDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43980,38 +66847,34 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of compose deployments created in the Service Fabric - * cluster. + * @summary Creates or updates a Service Fabric property. * - * Gets the status about the compose deployments that were created or in the - * process of being created in the Service Fabric cluster. The response - * includes the name, status and other details about the compose deployments. - * If the list of deployments do not fit in a page, one page of results is - * returned as well as a continuation token which can be used to get the next - * page. + * Creates or updates the specified Service Fabric property under a given name. * - * @param {object} [options] Optional Parameters. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {object} propertyDescription Describes the Service Fabric property to + * be created. * - * @param {number} [options.maxResults] The maximum number of results to be - * returned as part of the paged queries. This parameter defines the upper - * bound on the number of results returned. The results returned can be less - * than the specified maximum results if they do not fit in the message as per - * the max message size restrictions defined in the configuration. If this - * parameter is zero or not specified, the paged queries includes as much - * results as possible that fit in the return message. + * @param {string} propertyDescription.propertyName The name of the Service + * Fabric property. + * + * @param {string} [propertyDescription.customTypeId] The property's custom + * type ID. Using this property, the user is able to tag the type of the value + * of the property. + * + * @param {object} propertyDescription.value Describes a Service Fabric + * property value. + * + * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -44023,7 +66886,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedComposeDeploymentStatusInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -44031,15 +66894,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 PagedComposeDeploymentStatusInfoList} 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. */ - getComposeDeploymentStatusList(options, optionalCallback) { + putProperty(nameId, propertyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44048,47 +66909,49 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getComposeDeploymentStatusList(options, (err, result, request, response) => { + self._putProperty(nameId, propertyDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getComposeDeploymentStatusList(options, optionalCallback); + return self._putProperty(nameId, propertyDescription, options, optionalCallback); } } /** - * @summary Gets details for the latest upgrade performed on this Service - * Fabric compose deployment. + * @summary Gets the specified Service Fabric property. * - * Returns the information about the state of the compose deployment upgrade - * along with details to aid debugging application health issues. + * Gets the specified Service Fabric property under a given name. This will + * always return both value and metadata. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getComposeDeploymentUpgradeProgressWithHttpOperationResponse(deploymentName, options) { + getPropertyInfoWithHttpOperationResponse(nameId, propertyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getComposeDeploymentUpgradeProgress(deploymentName, options, (err, result, request, response) => { + self._getPropertyInfo(nameId, propertyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44099,20 +66962,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets details for the latest upgrade performed on this Service - * Fabric compose deployment. + * @summary Gets the specified Service Fabric property. * - * Returns the information about the state of the compose deployment upgrade - * along with details to aid debugging application health issues. + * Gets the specified Service Fabric property under a given name. This will + * always return both value and metadata. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -44124,7 +66989,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ComposeDeploymentUpgradeProgressInfo} - The deserialized result object. + * @resolve {PropertyInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -44133,14 +66998,13 @@ class ServiceFabricClient extends ServiceClient { * {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 ComposeDeploymentUpgradeProgressInfo} for - * more information. + * See {@link PropertyInfo} 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. */ - getComposeDeploymentUpgradeProgress(deploymentName, options, optionalCallback) { + getPropertyInfo(nameId, propertyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44149,30 +67013,34 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getComposeDeploymentUpgradeProgress(deploymentName, options, (err, result, request, response) => { + self._getPropertyInfo(nameId, propertyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getComposeDeploymentUpgradeProgress(deploymentName, options, optionalCallback); + return self._getPropertyInfo(nameId, propertyName, options, optionalCallback); } } /** - * @summary Deletes an existing Service Fabric compose deployment from cluster. + * @summary Deletes the specified Service Fabric property. * - * Deletes an existing Service Fabric compose deployment. + * Deletes the specified Service Fabric property under a given name. A property + * must be created before it can be deleted. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -44183,11 +67051,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - removeComposeDeploymentWithHttpOperationResponse(deploymentName, options) { + deletePropertyWithHttpOperationResponse(nameId, propertyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._removeComposeDeployment(deploymentName, options, (err, result, request, response) => { + self._deleteProperty(nameId, propertyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44198,18 +67066,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes an existing Service Fabric compose deployment from cluster. + * @summary Deletes the specified Service Fabric property. * - * Deletes an existing Service Fabric compose deployment. + * Deletes the specified Service Fabric property under a given name. A property + * must be created before it can be deleted. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. + * + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -44235,7 +67107,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - removeComposeDeployment(deploymentName, options, optionalCallback) { + deleteProperty(nameId, propertyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44244,175 +67116,53 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._removeComposeDeployment(deploymentName, options, (err, result, request, response) => { + self._deleteProperty(nameId, propertyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._removeComposeDeployment(deploymentName, options, optionalCallback); + return self._deleteProperty(nameId, propertyName, options, optionalCallback); } } /** - * @summary Starts upgrading a compose deployment in the Service Fabric - * cluster. - * - * Validates the supplied upgrade parameters and starts upgrading the - * deployment if the parameters are valid. - * - * @param {string} deploymentName The identity of the deployment. - * - * @param {object} composeDeploymentUpgradeDescription Parameters for upgrading - * compose deployment. - * - * @param {string} composeDeploymentUpgradeDescription.deploymentName - * - * @param {string} composeDeploymentUpgradeDescription.composeFileContent The - * content of the compose file that describes the deployment to create. - * - * @param {object} [composeDeploymentUpgradeDescription.registryCredential] - * - * @param {string} - * [composeDeploymentUpgradeDescription.registryCredential.registryUserName] - * The user name to connect to container registry. - * - * @param {string} - * [composeDeploymentUpgradeDescription.registryCredential.registryPassword] - * The password for supplied username to connect to container registry. - * - * @param {boolean} - * [composeDeploymentUpgradeDescription.registryCredential.passwordEncrypted] - * Indicates that supplied container registry password is encrypted. - * - * @param {string} composeDeploymentUpgradeDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' - * - * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' - * - * @param {number} - * [composeDeploymentUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] - * - * @param {boolean} [composeDeploymentUpgradeDescription.forceRestart] - * - * @param {object} [composeDeploymentUpgradeDescription.monitoringPolicy] - * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' - * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] - * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] - * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] - * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] - * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] - * - * @param {object} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy] - * - * @param {boolean} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * @summary Submits a property batch. * - * @param {number} - * [composeDeploymentUpgradeDescription.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} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [composeDeploymentUpgradeDescription.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} - * [composeDeploymentUpgradeDescription.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. - * - * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * Submits a batch of property operations. Either all or none of the operations + * will be committed. * - * 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} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * + * @param {object} propertyBatchDescriptionList Describes the property batch + * operations to be submitted. * - * @param {array} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {array} [propertyBatchDescriptionList.operations] A list of the + * property batch operations to be executed. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - startComposeDeploymentUpgradeWithHttpOperationResponse(deploymentName, composeDeploymentUpgradeDescription, options) { + submitPropertyBatchWithHttpOperationResponse(nameId, propertyBatchDescriptionList, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, (err, result, request, response) => { + self._submitPropertyBatch(nameId, propertyBatchDescriptionList, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44423,148 +67173,154 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Starts upgrading a compose deployment in the Service Fabric - * cluster. + * @summary Submits a property batch. * - * Validates the supplied upgrade parameters and starts upgrading the - * deployment if the parameters are valid. + * Submits a batch of property operations. Either all or none of the operations + * will be committed. * - * @param {string} deploymentName The identity of the deployment. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {object} composeDeploymentUpgradeDescription Parameters for upgrading - * compose deployment. + * @param {object} propertyBatchDescriptionList Describes the property batch + * operations to be submitted. * - * @param {string} composeDeploymentUpgradeDescription.deploymentName + * @param {array} [propertyBatchDescriptionList.operations] A list of the + * property batch operations to be executed. * - * @param {string} composeDeploymentUpgradeDescription.composeFileContent The - * content of the compose file that describes the deployment to create. + * @param {object} [options] Optional Parameters. * - * @param {object} [composeDeploymentUpgradeDescription.registryCredential] + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {string} - * [composeDeploymentUpgradeDescription.registryCredential.registryUserName] - * The user name to connect to container registry. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [composeDeploymentUpgradeDescription.registryCredential.registryPassword] - * The password for supplied username to connect to container registry. + * @param {function} [optionalCallback] - The optional callback. * - * @param {boolean} - * [composeDeploymentUpgradeDescription.registryCredential.passwordEncrypted] - * Indicates that supplied container registry password is encrypted. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} composeDeploymentUpgradeDescription.upgradeKind Possible - * values include: 'Invalid', 'Rolling' + * {Promise} A promise is returned * - * @param {string} [composeDeploymentUpgradeDescription.rollingUpgradeMode] - * Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', - * 'Monitored' + * @resolve {PropertyBatchInfo} - The deserialized result object. * - * @param {number} - * [composeDeploymentUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds] + * @reject {Error} - The error object. * - * @param {boolean} [composeDeploymentUpgradeDescription.forceRestart] + * {function} optionalCallback(err, result, request, response) * - * @param {object} [composeDeploymentUpgradeDescription.monitoringPolicy] + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.failureAction] - * Possible values include: 'Invalid', 'Rollback', 'Manual' + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PropertyBatchInfo} for more information. * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckWaitDurationInMilliseconds] + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckStableDurationInMilliseconds] + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + submitPropertyBatch(nameId, propertyBatchDescriptionList, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._submitPropertyBatch(nameId, propertyBatchDescriptionList, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._submitPropertyBatch(nameId, propertyBatchDescriptionList, options, optionalCallback); + } + } + + /** + * @summary Gets all Cluster-related events. * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.healthCheckRetryTimeoutInMilliseconds] + * The response is list of ClusterEvent objects. * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeTimeoutInMilliseconds] + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} - * [composeDeploymentUpgradeDescription.monitoringPolicy.upgradeDomainTimeoutInMilliseconds] + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {object} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy] + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {number} - * [composeDeploymentUpgradeDescription.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} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {object} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * 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. + * @returns {Promise} A promise is returned * + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * @reject {Error} - The error object. + */ + getClusterEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterEventList(startTimeUtc, endTimeUtc, 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 all Cluster-related events. * - * 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. + * The response is list of ClusterEvent objects. * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * 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 {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {array} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -44576,7 +67332,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -44584,13 +67340,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, optionalCallback) { + getClusterEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44599,143 +67355,190 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, (err, result, request, response) => { + self._getClusterEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, optionalCallback); + return self._getClusterEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Starts Chaos in the cluster. + * @summary Gets all Containers-related events. * - * If Chaos is not already running in the cluster, it starts Chaos with the - * passed in Chaos parameters. - * If Chaos is already running when this call is made, the call fails with the - * error code FABRIC_E_CHAOS_ALREADY_RUNNING. - * Please refer to the article [Induce controlled Chaos in Service Fabric - * clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) - * for more details. + * The response is list of ContainerInstanceEvent objects. * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {object} chaosParameters Describes all the parameters to configure a - * Chaos run. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} [chaosParameters.timeToRunInSeconds] Total time (in seconds) - * for which Chaos will run before automatically stopping. The maximum allowed - * value is 4,294,967,295 (System.UInt32.MaxValue). + * @param {object} [options] Optional Parameters. * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] - * The maximum amount of time to wait for all cluster entities to become stable - * and healthy. Chaos executes in iterations and at the start of each iteration - * it validates the health of cluster entities. - * During validation if a cluster entity is not stable and healthy within - * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed - * event. + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults is - * the maximum number of concurrent faults induced per iteration. - * Chaos executes in iterations and two consecutive iterations are separated by - * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. - * The recommendation is to start with a value of 2 or 3 and to exercise - * caution while moving up. + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or - * disables the move primary and move secondary faults. + * @returns {Promise} A promise is returned * + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait time - * (in seconds) between consecutive faults within a single iteration. - * The larger the value, the lower the overlapping between faults and the - * simpler the sequence of state transitions that the cluster goes through. - * The recommendation is to start with a value between 1 and 5 and exercise - * caution while moving up. + * @reject {Error} - The error object. + */ + getContainersEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getContainersEventList(startTimeUtc, endTimeUtc, 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 all Containers-related events. * + * The response is list of ContainerInstanceEvent objects. * - * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] - * Time-separation (in seconds) between two consecutive iterations of Chaos. - * The larger the value, the lower the fault injection rate. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {object} [chaosParameters.clusterHealthPolicy] + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates - * whether warnings are treated with the same severity as errors. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {number} - * [chaosParameters.clusterHealthPolicy.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 {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. * - * 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. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * In large clusters, some nodes will always be down or out for repairs, so - * this percentage should be configured to tolerate that. + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * + * @param {function} [optionalCallback] - The optional callback. * - * @param {number} - * [chaosParameters.clusterHealthPolicy.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. + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request 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. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getContainersEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getContainersEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContainersEventList(startTimeUtc, endTimeUtc, options, optionalCallback); + } + } + + /** + * @summary Gets a Node-related events. * + * The response is list of NodeEvent objects. * - * @param {array} - * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * @param {string} nodeName The name of the node. * - * @param {object} [chaosParameters.context] + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {object} [chaosParameters.context.map] + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - startChaosWithHttpOperationResponse(chaosParameters, options) { + getNodeEventListWithHttpOperationResponse(nodeName, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startChaos(chaosParameters, options, (err, result, request, response) => { + self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44746,116 +67549,163 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Starts Chaos in the cluster. + * @summary Gets a Node-related events. * - * If Chaos is not already running in the cluster, it starts Chaos with the - * passed in Chaos parameters. - * If Chaos is already running when this call is made, the call fails with the - * error code FABRIC_E_CHAOS_ALREADY_RUNNING. - * Please refer to the article [Induce controlled Chaos in Service Fabric - * clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) - * for more details. + * The response is list of NodeEvent objects. * + * @param {string} nodeName The name of the node. * - * @param {object} chaosParameters Describes all the parameters to configure a - * Chaos run. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} [chaosParameters.timeToRunInSeconds] Total time (in seconds) - * for which Chaos will run before automatically stopping. The maximum allowed - * value is 4,294,967,295 (System.UInt32.MaxValue). + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * + * @param {object} [options] Optional Parameters. * - * @param {number} [chaosParameters.maxClusterStabilizationTimeoutInSeconds] - * The maximum amount of time to wait for all cluster entities to become stable - * and healthy. Chaos executes in iterations and at the start of each iteration - * it validates the health of cluster entities. - * During validation if a cluster entity is not stable and healthy within - * MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed - * event. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. * - * @param {number} [chaosParameters.maxConcurrentFaults] MaxConcurrentFaults is - * the maximum number of concurrent faults induced per iteration. - * Chaos executes in iterations and two consecutive iterations are separated by - * a validation phase. - * The higher the concurrency, the more aggressive the injection of faults -- - * inducing more complex series of states to uncover bugs. - * The recommendation is to start with a value of 2 or 3 and to exercise - * caution while moving up. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * - * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or - * disables the move primary and move secondary faults. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * + * @param {function} [optionalCallback] - The optional callback. * - * @param {number} [chaosParameters.waitTimeBetweenFaultsInSeconds] Wait time - * (in seconds) between consecutive faults within a single iteration. - * The larger the value, the lower the overlapping between faults and the - * simpler the sequence of state transitions that the cluster goes through. - * The recommendation is to start with a value between 1 and 5 and exercise - * caution while moving up. + * @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 * - * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] - * Time-separation (in seconds) between two consecutive iterations of Chaos. - * The larger the value, the lower the fault injection rate. + * @resolve {Array} - The deserialized result object. * + * @reject {Error} - The error object. * - * @param {object} [chaosParameters.clusterHealthPolicy] + * {function} optionalCallback(err, result, request, response) * - * @param {boolean} - * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates - * whether warnings are treated with the same severity as errors. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {number} - * [chaosParameters.clusterHealthPolicy.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. + * {array} [result] - The deserialized result object if an error did not occur. * - * 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. + * {object} [request] - The HTTP Request object if an error did not occur. * - * In large clusters, some nodes will always be down or out for repairs, so - * this percentage should be configured to tolerate that. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, optionalCallback); + } + } + + /** + * @summary Gets all Nodes-related Events. * + * The response is list of NodeEvent objects. * - * @param {number} - * [chaosParameters.clusterHealthPolicy.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 {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * 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} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * + * @param {object} [options] Optional Parameters. * - * @param {array} - * [chaosParameters.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. + * + * @param {object} [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. + */ + getNodesEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getNodesEventList(startTimeUtc, endTimeUtc, 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 all Nodes-related Events. * - * @param {object} [chaosParameters.context] + * The response is list of NodeEvent objects. * - * @param {object} [chaosParameters.context.map] + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -44867,7 +67717,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -44875,13 +67725,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - startChaos(chaosParameters, options, optionalCallback) { + getNodesEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44890,45 +67740,69 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startChaos(chaosParameters, options, (err, result, request, response) => { + self._getNodesEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startChaos(chaosParameters, options, optionalCallback); + return self._getNodesEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Stops Chaos in the cluster if it is already running, otherwise it - * does nothing. + * @summary Gets an Application-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * Stops Chaos from scheduling further faults; but, the in-flight faults are - * not affected. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - stopChaosWithHttpOperationResponse(options) { + getApplicationEventListWithHttpOperationResponse(applicationId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._stopChaos(options, (err, result, request, response) => { + self._getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44939,18 +67813,42 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Stops Chaos in the cluster if it is already running, otherwise it - * does nothing. + * @summary Gets an Application-related events. + * + * The response is list of ApplicationEvent objects. + * + * @param {string} applicationId The identity of the application. This is + * typically the full name of the application without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the application name is "fabric:/myapp/app1", the + * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in + * previous versions. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * Stops Chaos from scheduling further faults; but, the in-flight faults are - * not affected. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -44962,7 +67860,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -44970,13 +67868,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - stopChaos(options, optionalCallback) { + getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44985,70 +67883,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._stopChaos(options, (err, result, request, response) => { + self._getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._stopChaos(options, optionalCallback); + return self._getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets the next segment of the Chaos report based on the passed-in - * continuation token or the passed-in time-range. + * @summary Gets all Applications-related events. * - * You can either specify the ContinuationToken to get the next segment of the - * Chaos report or you can specify the time-range - * through StartTimeUtc and EndTimeUtc, but you cannot specify both the - * ContinuationToken and the time-range in the same call. - * When there are more than 100 Chaos events, the Chaos report is returned in - * segments where a segment contains no more than 100 Chaos events. + * The response is list of ApplicationEvent objects. * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {string} [options.startTimeUtc] The count of ticks representing the - * start time of the time range for which a Chaos report is to be generated. - * Please consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. * - * @param {string} [options.endTimeUtc] The count of ticks representing the end - * time of the time range for which a Chaos report is to be generated. Please - * consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getChaosReportWithHttpOperationResponse(options) { + getApplicationsEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getChaosReport(options, (err, result, request, response) => { + self._getApplicationsEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45059,43 +67948,34 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the next segment of the Chaos report based on the passed-in - * continuation token or the passed-in time-range. + * @summary Gets all Applications-related events. + * + * The response is list of ApplicationEvent objects. * - * You can either specify the ContinuationToken to get the next segment of the - * Chaos report or you can specify the time-range - * through StartTimeUtc and EndTimeUtc, but you cannot specify both the - * ContinuationToken and the time-range in the same call. - * When there are more than 100 Chaos events, the Chaos report is returned in - * segments where a segment contains no more than 100 Chaos events. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token parameter - * is used to obtain next set of results. A continuation token with a non empty - * value is included in the response of the API when the results from the - * system do not fit in a single response. When this value is passed to the - * next API call, the API returns next set of results. If there are no further - * results then the continuation token does not contain a value. The value of - * this parameter should not be URL encoded. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {string} [options.startTimeUtc] The count of ticks representing the - * start time of the time range for which a Chaos report is to be generated. - * Please consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. * - * @param {string} [options.endTimeUtc] The count of ticks representing the end - * time of the time range for which a Chaos report is to be generated. Please - * consult [DateTime.Ticks - * Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) - * for details about tick. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45107,7 +67987,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ChaosReport} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45115,14 +67995,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ChaosReport} for more information. + * {array} [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. */ - getChaosReport(options, optionalCallback) { + getApplicationsEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45131,57 +68010,69 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getChaosReport(options, (err, result, request, response) => { + self._getApplicationsEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getChaosReport(options, optionalCallback); + return self._getApplicationsEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Uploads contents of the file to the image store. + * @summary Gets a Service-related events. * - * Uploads contents of the file to the image store. Use this API if the file is - * small enough to upload again if the connection fails. The file's data needs - * to be added to the request body. The contents will be uploaded to the - * specified path. Image store service uses a mark file to indicate the - * availability of the folder. The mark file is an empty file named "_.dir". - * The mark file is generated by the image store service when all files in a - * folder are uploaded. When using File-by-File approach to upload application - * package in REST, the image store service isn't aware of the file hierarchy - * of the application package; you need to create a mark file per folder and - * upload it last, to let the image store service know that the folder is - * complete. + * The response is list of ServiceEvent objects. * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - uploadFileWithHttpOperationResponse(contentPath, options) { + getServiceEventListWithHttpOperationResponse(serviceId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._uploadFile(contentPath, options, (err, result, request, response) => { + self._getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45192,30 +68083,42 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Uploads contents of the file to the image store. + * @summary Gets a Service-related events. * - * Uploads contents of the file to the image store. Use this API if the file is - * small enough to upload again if the connection fails. The file's data needs - * to be added to the request body. The contents will be uploaded to the - * specified path. Image store service uses a mark file to indicate the - * availability of the folder. The mark file is an empty file named "_.dir". - * The mark file is generated by the image store service when all files in a - * folder are uploaded. When using File-by-File approach to upload application - * package in REST, the image store service isn't aware of the file hierarchy - * of the application package; you need to create a mark file per folder and - * upload it last, to let the image store service know that the folder is - * complete. + * The response is list of ServiceEvent objects. + * + * @param {string} serviceId The identity of the service. This ID is typically + * the full name of the service without the 'fabric:' URI scheme. + * Starting from version 6.0, hierarchical names are delimited with the "~" + * character. + * For example, if the service name is "fabric:/myapp/app1/svc1", the service + * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * previous versions. * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45227,7 +68130,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45235,13 +68138,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - uploadFile(contentPath, options, optionalCallback) { + getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45250,47 +68153,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._uploadFile(contentPath, options, (err, result, request, response) => { + self._getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._uploadFile(contentPath, options, optionalCallback); + return self._getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets the image store content information. + * @summary Gets all Services-related events. * - * Returns the information about the image store content at the specified - * contentPath relative to the root of the image store. + * The response is list of ServiceEvent objects. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getImageStoreContentWithHttpOperationResponse(contentPath, options) { + getServicesEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getImageStoreContent(contentPath, options, (err, result, request, response) => { + self._getServicesEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45301,20 +68218,34 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the image store content information. + * @summary Gets all Services-related events. * - * Returns the information about the image store content at the specified - * contentPath relative to the root of the image store. + * The response is list of ServiceEvent objects. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45326,7 +68257,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ImageStoreContent} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45334,14 +68265,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ImageStoreContent} for more information. + * {array} [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. */ - getImageStoreContent(contentPath, options, optionalCallback) { + getServicesEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45350,48 +68280,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getImageStoreContent(contentPath, options, (err, result, request, response) => { + self._getServicesEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getImageStoreContent(contentPath, options, optionalCallback); + return self._getServicesEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Deletes existing image store content. + * @summary Gets a Partition-related events. * - * Deletes existing image store content being found within the given image - * store relative path. This can be used to delete uploaded application - * packages once they are provisioned. + * The response is list of PartitionEvent objects. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteImageStoreContentWithHttpOperationResponse(contentPath, options) { + getPartitionEventListWithHttpOperationResponse(partitionId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteImageStoreContent(contentPath, options, (err, result, request, response) => { + self._getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45402,21 +68347,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes existing image store content. + * @summary Gets a Partition-related events. * - * Deletes existing image store content being found within the given image - * store relative path. This can be used to delete uploaded application - * packages once they are provisioned. + * The response is list of PartitionEvent objects. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45428,7 +68388,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45436,13 +68396,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - deleteImageStoreContent(contentPath, options, optionalCallback) { + getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45451,44 +68411,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteImageStoreContent(contentPath, options, (err, result, request, response) => { + self._getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteImageStoreContent(contentPath, options, optionalCallback); + return self._getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets the content information at the root of the image store. + * @summary Gets all Partitions-related events. * - * Returns the information about the image store content at the root of the - * image store. + * The response is list of PartitionEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getImageStoreRootContentWithHttpOperationResponse(options) { + getPartitionsEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getImageStoreRootContent(options, (err, result, request, response) => { + self._getPartitionsEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45499,17 +68476,34 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the content information at the root of the image store. + * @summary Gets all Partitions-related events. * - * Returns the information about the image store content at the root of the - * image store. + * The response is list of PartitionEvent objects. + * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. + * + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45521,7 +68515,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ImageStoreContent} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45529,14 +68523,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 ImageStoreContent} for more information. + * {array} [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. */ - getImageStoreRootContent(options, optionalCallback) { + getPartitionsEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45545,62 +68538,65 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getImageStoreRootContent(options, (err, result, request, response) => { + self._getPartitionsEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getImageStoreRootContent(options, optionalCallback); + return self._getPartitionsEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Copies image store content internally - * - * Copies the image store content from the source image store relative path to - * the destination image store relative path. + * @summary Gets a Partition Replica-related events. * - * @param {object} imageStoreCopyDescription Describes the copy description for - * the image store. + * The response is list of ReplicaEvent objects. * - * @param {string} imageStoreCopyDescription.remoteSource The relative path of - * source image store content to be copied from. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} imageStoreCopyDescription.remoteDestination The relative - * path of destination image store content to be copied to. + * @param {string} replicaId The identifier of the replica. * - * @param {array} [imageStoreCopyDescription.skipFiles] The list of the file - * names to be skipped for copying. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {boolean} [imageStoreCopyDescription.checkMarkFile] Indicates whether - * to check mark file during copying. The property is true if checking mark - * file is required, false otherwise. The mark file is used to check whether - * the folder is well constructed. If the property is true and mark file does - * not exist, the copy is skipped. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - copyImageStoreContentWithHttpOperationResponse(imageStoreCopyDescription, options) { + getPartitionReplicaEventListWithHttpOperationResponse(partitionId, replicaId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._copyImageStoreContent(imageStoreCopyDescription, options, (err, result, request, response) => { + self._getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45611,35 +68607,38 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Copies image store content internally - * - * Copies the image store content from the source image store relative path to - * the destination image store relative path. + * @summary Gets a Partition Replica-related events. * - * @param {object} imageStoreCopyDescription Describes the copy description for - * the image store. + * The response is list of ReplicaEvent objects. * - * @param {string} imageStoreCopyDescription.remoteSource The relative path of - * source image store content to be copied from. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} imageStoreCopyDescription.remoteDestination The relative - * path of destination image store content to be copied to. + * @param {string} replicaId The identifier of the replica. * - * @param {array} [imageStoreCopyDescription.skipFiles] The list of the file - * names to be skipped for copying. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {boolean} [imageStoreCopyDescription.checkMarkFile] Indicates whether - * to check mark file during copying. The property is true if checking mark - * file is required, false otherwise. The mark file is used to check whether - * the folder is well constructed. If the property is true and mark file does - * not exist, the copy is skipped. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45651,7 +68650,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45659,13 +68658,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback) { + getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45674,64 +68673,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._copyImageStoreContent(imageStoreCopyDescription, options, (err, result, request, response) => { + self._getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback); + return self._getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Invokes an administrative command on the given Infrastructure - * Service instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific commands to a - * particular - * instance of the Infrastructure Service. + * @summary Gets all Replicas-related events for a Partition. * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. + * The response is list of ReplicaEvent objects. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @param {uuid} partitionId The identity of the partition. * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - invokeInfrastructureCommandWithHttpOperationResponse(command, options) { + getPartitionReplicasEventListWithHttpOperationResponse(partitionId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._invokeInfrastructureCommand(command, options, (err, result, request, response) => { + self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45742,37 +68740,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Invokes an administrative command on the given Infrastructure - * Service instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific commands to a - * particular - * instance of the Infrastructure Service. + * @summary Gets all Replicas-related events for a Partition. * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. + * The response is list of ReplicaEvent objects. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * @param {uuid} partitionId The identity of the partition. * + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * + * @param {string} [options.eventsTypesFilter] This is a comma separated string + * specifying the types of FabricEvents that should only be included in the + * response. + * + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. + * + * @param {boolean} [options.skipCorrelationLookup] This param disables the + * search of CorrelatedEvents information if true is passed. otherwise the + * CorrelationEvents get processed and HasCorrelatedEvents field in every + * FabricEvent gets populated. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45784,7 +68781,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45792,13 +68789,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - invokeInfrastructureCommand(command, options, optionalCallback) { + getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45806,65 +68803,46 @@ class ServiceFabricClient extends ServiceClient { options = null; } if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._invokeInfrastructureCommand(command, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._invokeInfrastructureCommand(command, options, optionalCallback); - } - } - - /** - * @summary Invokes a read-only query on the given infrastructure service - * instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific queries to a - * particular - * instance of the Infrastructure Service. - * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + return new Promise((resolve, reject) => { + self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback); + } + } + + /** + * @summary Gets all correlated events for a given event. * + * The response is list of FabricEvents. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} eventInstanceId The EventInstanceId. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - invokeInfrastructureQueryWithHttpOperationResponse(command, options) { + getCorrelatedEventListWithHttpOperationResponse(eventInstanceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._invokeInfrastructureQuery(command, options, (err, result, request, response) => { + self._getCorrelatedEventList(eventInstanceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45875,37 +68853,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Invokes a read-only query on the given infrastructure service - * instance. - * - * For clusters that have one or more instances of the Infrastructure Service - * configured, - * this API provides a way to send infrastructure-specific queries to a - * particular - * instance of the Infrastructure Service. - * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. + * @summary Gets all correlated events for a given event. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * The response is list of FabricEvents. * - * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} eventInstanceId The EventInstanceId. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceId] The identity of the infrastructure - * service. This is the full name of the infrastructure service without the - * 'fabric:' URI scheme. This parameter required only for the cluster that have - * more than one instance of infrastructure service running. - * * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45917,7 +68876,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45925,13 +68884,13 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {array} [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. */ - invokeInfrastructureQuery(command, options, optionalCallback) { + getCorrelatedEventList(eventInstanceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45940,71 +68899,55 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._invokeInfrastructureQuery(command, options, (err, result, request, response) => { + self._getCorrelatedEventList(eventInstanceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._invokeInfrastructureQuery(command, options, optionalCallback); + return self._getCorrelatedEventList(eventInstanceId, options, optionalCallback); } } /** - * @summary This API will induce data loss for the specified partition. It will - * trigger a call to the OnDataLossAsync API of the partition. + * @summary Creates or updates an application resource. * - * This API will induce data loss for the specified partition. It will trigger - * a call to the OnDataLoss API of the partition. - * Actual data loss will depend on the specified DataLossMode - * PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is - * triggered for the partition but actual data loss depends on the presence of - * in-flight replication. - * FullDataLoss - All replicas are removed hence all data is lost and - * OnDataLoss is triggered. + * Creates an application with the specified name and description. If an + * application with the same name already exists, then its description are + * updated to the one indicated in this request. * - * This API should only be called with a stateful service as the target. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * Calling this API with a system service as the target is not advised. + * @param {object} applicationResourceDescription Description for creating an + * application resource. * - * Note: Once this API has been called, it cannot be reversed. Calling - * CancelOperation will only stop execution and clean up internal system state. - * It will not restore data if the command has progressed far enough to cause - * data loss. + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. * - * Call the GetDataLossProgress API with the same OperationId to return - * information on the operation started with this API. + * @param {string} [applicationResourceDescription.debugParams] Internal use. * + * @param {array} [applicationResourceDescription.services] describes the + * services in the application. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {object} [applicationResourceDescription.diagnostics] Describes the + * diagnostics definition and usage for an application resource. * - * @param {uuid} partitionId The identity of the partition. + * @param {array} [applicationResourceDescription.diagnostics.sinks] List of + * supported sinks that can be referenced. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {boolean} [applicationResourceDescription.diagnostics.enabled] Status + * of whether or not sinks are enabled. * - * @param {string} dataLossMode This enum is passed to the StartDataLoss API to - * indicate what type of data loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - PartialDataLoss - PartialDataLoss option will cause a quorum of replicas - * to go down, triggering an OnDataLoss event in the system for the given - * partition. - * - FullDataLoss - FullDataLoss option will drop all the replicas which means - * that all the data will be lost. - * . Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @param {array} [applicationResourceDescription.diagnostics.defaultSinkRefs] + * The sinks to be used if diagnostics is enabled. Sink choices can be + * overridden at the service and code package level. * - * @param {object} [options] Optional Parameters. + * @param {string} applicationResourceDescription.name Application resource + * name. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -46015,11 +68958,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startDataLossWithHttpOperationResponse(serviceId, partitionId, operationId, dataLossMode, options) { + createApplicationResourceWithHttpOperationResponse(applicationResourceName, applicationResourceDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, (err, result, request, response) => { + self._createApplicationResource(applicationResourceName, applicationResourceDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46030,59 +68973,43 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary This API will induce data loss for the specified partition. It will - * trigger a call to the OnDataLossAsync API of the partition. + * @summary Creates or updates an application resource. * - * This API will induce data loss for the specified partition. It will trigger - * a call to the OnDataLoss API of the partition. - * Actual data loss will depend on the specified DataLossMode - * PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is - * triggered for the partition but actual data loss depends on the presence of - * in-flight replication. - * FullDataLoss - All replicas are removed hence all data is lost and - * OnDataLoss is triggered. + * Creates an application with the specified name and description. If an + * application with the same name already exists, then its description are + * updated to the one indicated in this request. * - * This API should only be called with a stateful service as the target. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * Calling this API with a system service as the target is not advised. + * @param {object} applicationResourceDescription Description for creating an + * application resource. * - * Note: Once this API has been called, it cannot be reversed. Calling - * CancelOperation will only stop execution and clean up internal system state. - * It will not restore data if the command has progressed far enough to cause - * data loss. + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. * - * Call the GetDataLossProgress API with the same OperationId to return - * information on the operation started with this API. + * @param {string} [applicationResourceDescription.debugParams] Internal use. * + * @param {array} [applicationResourceDescription.services] describes the + * services in the application. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @param {object} [applicationResourceDescription.diagnostics] Describes the + * diagnostics definition and usage for an application resource. * - * @param {uuid} partitionId The identity of the partition. + * @param {array} [applicationResourceDescription.diagnostics.sinks] List of + * supported sinks that can be referenced. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {boolean} [applicationResourceDescription.diagnostics.enabled] Status + * of whether or not sinks are enabled. * - * @param {string} dataLossMode This enum is passed to the StartDataLoss API to - * indicate what type of data loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - PartialDataLoss - PartialDataLoss option will cause a quorum of replicas - * to go down, triggering an OnDataLoss event in the system for the given - * partition. - * - FullDataLoss - FullDataLoss option will drop all the replicas which means - * that all the data will be lost. - * . Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @param {array} [applicationResourceDescription.diagnostics.defaultSinkRefs] + * The sinks to be used if diagnostics is enabled. Sink choices can be + * overridden at the service and code package level. * - * @param {object} [options] Optional Parameters. + * @param {string} applicationResourceDescription.name Application resource + * name. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -46108,7 +69035,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, optionalCallback) { + createApplicationResource(applicationResourceName, applicationResourceDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46117,58 +69044,42 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, (err, result, request, response) => { + self._createApplicationResource(applicationResourceName, applicationResourceDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, optionalCallback); + return self._createApplicationResource(applicationResourceName, applicationResourceDescription, options, optionalCallback); } } /** - * @summary Gets the progress of a partition data loss operation started using - * the StartDataLoss API. + * @summary Gets the application with the given name. * - * Gets the progress of a data loss operation started with StartDataLoss, using - * the OperationId. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. + * Gets the application with the given name. This includes the information + * about the application's services and other runtime information. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDataLossProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { + getApplicationResourceWithHttpOperationResponse(applicationResourceName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDataLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._getApplicationResource(applicationResourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46179,32 +69090,16 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the progress of a partition data loss operation started using - * the StartDataLoss API. - * - * Gets the progress of a data loss operation started with StartDataLoss, using - * the OperationId. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @summary Gets the application with the given name. * - * @param {uuid} partitionId The identity of the partition. + * Gets the application with the given name. This includes the information + * about the application's services and other runtime information. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -46215,7 +69110,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionDataLossProgress} - The deserialized result object. + * @resolve {ApplicationResourceDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46224,14 +69119,14 @@ class ServiceFabricClient extends ServiceClient { * {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 PartitionDataLossProgress} for more + * See {@link ApplicationResourceDescription} 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. */ - getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { + getApplicationResource(applicationResourceName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46240,62 +69135,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDataLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._getApplicationResource(applicationResourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback); + return self._getApplicationResource(applicationResourceName, options, optionalCallback); } } /** - * @summary Induces quorum loss for a given stateful service partition. - * - * Induces quorum loss for a given stateful service partition. This API is - * useful for a temporary quorum loss situation on your service. - * - * Call the GetQuorumLossProgress API with the same OperationId to return - * information on the operation started with this API. - * - * This can only be called on stateful persisted (HasPersistedState==true) - * services. Do not use this API on stateless services or stateful in-memory - * only services. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. - * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @summary Deletes the specified application. * - * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss - * API to indicate what type of quorum loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - QuorumReplicas - Partial Quorum loss mode : Minimum number of replicas for - * a partition will be down that will cause a quorum loss. - * - AllReplicas- Full Quorum loss mode : All replicas for a partition will be - * down that will cause a quorum loss. - * . Possible values include: 'Invalid', 'QuorumReplicas', 'AllReplicas' + * Deletes the application identified by the name. * - * @param {number} quorumLossDuration The amount of time for which the - * partition will be kept in quorum loss. This must be specified in seconds. + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -46305,11 +69165,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startQuorumLossWithHttpOperationResponse(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options) { + deleteApplicationResourceWithHttpOperationResponse(applicationResourceName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, (err, result, request, response) => { + self._deleteApplicationResource(applicationResourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46320,50 +69180,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Induces quorum loss for a given stateful service partition. - * - * Induces quorum loss for a given stateful service partition. This API is - * useful for a temporary quorum loss situation on your service. - * - * Call the GetQuorumLossProgress API with the same OperationId to return - * information on the operation started with this API. - * - * This can only be called on stateful persisted (HasPersistedState==true) - * services. Do not use this API on stateless services or stateful in-memory - * only services. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @summary Deletes the specified application. * - * @param {uuid} partitionId The identity of the partition. - * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * Deletes the application identified by the name. * - * @param {string} quorumLossMode This enum is passed to the StartQuorumLoss - * API to indicate what type of quorum loss to induce. - * - Invalid - Reserved. Do not pass into API. - * - QuorumReplicas - Partial Quorum loss mode : Minimum number of replicas for - * a partition will be down that will cause a quorum loss. - * - AllReplicas- Full Quorum loss mode : All replicas for a partition will be - * down that will cause a quorum loss. - * . Possible values include: 'Invalid', 'QuorumReplicas', 'AllReplicas' - * - * @param {number} quorumLossDuration The amount of time for which the - * partition will be kept in quorum loss. This must be specified in seconds. + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -46388,7 +69213,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, optionalCallback) { + deleteApplicationResource(applicationResourceName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46397,58 +69222,42 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, (err, result, request, response) => { + self._deleteApplicationResource(applicationResourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, optionalCallback); + return self._deleteApplicationResource(applicationResourceName, options, optionalCallback); } } /** - * @summary Gets the progress of a quorum loss operation on a partition started - * using the StartQuorumLoss API. - * - * Gets the progress of a quorum loss operation started with StartQuorumLoss, - * using the provided OperationId. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @summary Gets all the services in the application resource. * - * @param {uuid} partitionId The identity of the partition. + * The operation returns the service descriptions of all the services in the + * application resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getQuorumLossProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { + getServicesWithHttpOperationResponse(applicationResourceName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getQuorumLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._getServices(applicationResourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46459,32 +69268,16 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the progress of a quorum loss operation on a partition started - * using the StartQuorumLoss API. + * @summary Gets all the services in the application resource. * - * Gets the progress of a quorum loss operation started with StartQuorumLoss, - * using the provided OperationId. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. + * The operation returns the service descriptions of all the services in the + * application resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -46495,7 +69288,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionQuorumLossProgress} - The deserialized result object. + * @resolve {PagedServiceResourceDescriptionList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46504,14 +69297,14 @@ class ServiceFabricClient extends ServiceClient { * {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 PartitionQuorumLossProgress} for more - * information. + * See {@link PagedServiceResourceDescriptionList} 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. */ - getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { + getServices(applicationResourceName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46520,71 +69313,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getQuorumLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._getServices(applicationResourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback); + return self._getServices(applicationResourceName, options, optionalCallback); } } /** - * @summary This API will restart some or all replicas or instances of the - * specified partition. - * - * This API is useful for testing failover. - * - * If used to target a stateless service partition, RestartPartitionMode must - * be AllReplicasOrInstances. - * - * Call the GetPartitionRestartProgress API using the same OperationId to get - * the progress. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @summary Gets the description of the specified service in an application + * resource. * - * @param {uuid} partitionId The identity of the partition. + * Gets the description of the service resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {string} restartPartitionMode - Invalid - Reserved. Do not pass into - * API. - * - AllReplicasOrInstances - All replicas or instances in the partition are - * restarted at once. - * - OnlyActiveSecondaries - Only the secondary replicas are restarted. - * . Possible values include: 'Invalid', 'AllReplicasOrInstances', - * 'OnlyActiveSecondaries' + * @param {string} serviceResourceName Service Fabric service resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - startPartitionRestartWithHttpOperationResponse(serviceId, partitionId, operationId, restartPartitionMode, options) { + getServiceWithHttpOperationResponse(applicationResourceName, serviceResourceName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, (err, result, request, response) => { + self._getService(applicationResourceName, serviceResourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46595,45 +69361,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary This API will restart some or all replicas or instances of the - * specified partition. - * - * This API is useful for testing failover. - * - * If used to target a stateless service partition, RestartPartitionMode must - * be AllReplicasOrInstances. - * - * Call the GetPartitionRestartProgress API using the same OperationId to get - * the progress. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * @summary Gets the description of the specified service in an application + * resource. * - * @param {uuid} partitionId The identity of the partition. + * Gets the description of the service resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {string} restartPartitionMode - Invalid - Reserved. Do not pass into - * API. - * - AllReplicasOrInstances - All replicas or instances in the partition are - * restarted at once. - * - OnlyActiveSecondaries - Only the secondary replicas are restarted. - * . Possible values include: 'Invalid', 'AllReplicasOrInstances', - * 'OnlyActiveSecondaries' + * @param {string} serviceResourceName Service Fabric service resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -46644,7 +69383,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceResourceDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46652,13 +69391,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceDescription} 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. */ - startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, optionalCallback) { + getService(applicationResourceName, serviceResourceName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46667,58 +69408,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, (err, result, request, response) => { + self._getService(applicationResourceName, serviceResourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, optionalCallback); + return self._getService(applicationResourceName, serviceResourceName, options, optionalCallback); } } /** - * @summary Gets the progress of a PartitionRestart operation started using - * StartPartitionRestart. - * - * Gets the progress of a PartitionRestart started with StartPartitionRestart - * using the provided OperationId. + * @summary Gets replicas of a given service in an applciation resource. * + * Gets the information about all replicas of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. - * - * @param {uuid} partitionId The identity of the partition. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} serviceResourceName Service Fabric service resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionRestartProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { + getReplicasWithHttpOperationResponse(applicationResourceName, serviceResourceName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._getReplicas(applicationResourceName, serviceResourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46729,32 +69457,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the progress of a PartitionRestart operation started using - * StartPartitionRestart. + * @summary Gets replicas of a given service in an applciation resource. * - * Gets the progress of a PartitionRestart started with StartPartitionRestart - * using the provided OperationId. - * - * - * @param {string} serviceId The identity of the service. This is typically the - * full name of the service without the 'fabric:' URI scheme. Starting from - * version 6.0, hierarchical names are delimited with the "~" character. For - * example, if the service name is "fabric://myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in - * previous versions. + * Gets the information about all replicas of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} serviceResourceName Service Fabric service resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -46765,7 +69480,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionRestartProgress} - The deserialized result object. + * @resolve {PagedServiceResourceReplicaDescriptionList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46774,14 +69489,14 @@ class ServiceFabricClient extends ServiceClient { * {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 PartitionRestartProgress} for more - * information. + * See {@link PagedServiceResourceReplicaDescriptionList} + * 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. */ - getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback) { + getReplicas(applicationResourceName, serviceResourceName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46790,71 +69505,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._getReplicas(applicationResourceName, serviceResourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback); + return self._getReplicas(applicationResourceName, serviceResourceName, options, optionalCallback); } } /** - * @summary Starts or stops a cluster node. - * - * Starts or stops a cluster node. A cluster node is a process, not the OS - * instance itself. To start a node, pass in "Start" for the - * NodeTransitionType parameter. - * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This - * API starts the operation - when the API returns the node may not have - * finished transitioning yet. - * Call GetNodeTransitionProgress with the same OperationId to get the progress - * of the operation. + * @summary Gets a specific replica of a given service in an application + * resource. * + * Gets the information about the specified replica of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {string} nodeName The name of the node. - * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API - * - * @param {string} nodeTransitionType Indicates the type of transition to - * perform. NodeTransitionType.Start will start a stopped node. - * NodeTransitionType.Stop will stop a node that is up. - * - Invalid - Reserved. Do not pass into API. - * - Start - Transition a stopped node to up. - * - Stop - Transition an up node to stopped. - * . Possible values include: 'Invalid', 'Start', 'Stop' + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {string} nodeInstanceId The node instance ID of the target node. - * This can be determined through GetNodeInfo API. + * @param {string} serviceResourceName Service Fabric service resource name. * - * @param {number} stopDurationInSeconds The duration, in seconds, to keep the - * node stopped. The minimum value is 600, the maximum is 14400. After this - * time expires, the node will automatically come back up. + * @param {string} replicaName Service Fabric replica name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - startNodeTransitionWithHttpOperationResponse(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options) { + getReplicaWithHttpOperationResponse(applicationResourceName, serviceResourceName, replicaName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, (err, result, request, response) => { + self._getReplica(applicationResourceName, serviceResourceName, replicaName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46865,45 +69557,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Starts or stops a cluster node. - * - * Starts or stops a cluster node. A cluster node is a process, not the OS - * instance itself. To start a node, pass in "Start" for the - * NodeTransitionType parameter. - * To stop a node, pass in "Stop" for the NodeTransitionType parameter. This - * API starts the operation - when the API returns the node may not have - * finished transitioning yet. - * Call GetNodeTransitionProgress with the same OperationId to get the progress - * of the operation. + * @summary Gets a specific replica of a given service in an application + * resource. * + * Gets the information about the specified replica of a given service of an + * application. The information includes the runtime properties of the replica + * instance. * - * @param {string} nodeName The name of the node. - * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API - * - * @param {string} nodeTransitionType Indicates the type of transition to - * perform. NodeTransitionType.Start will start a stopped node. - * NodeTransitionType.Stop will stop a node that is up. - * - Invalid - Reserved. Do not pass into API. - * - Start - Transition a stopped node to up. - * - Stop - Transition an up node to stopped. - * . Possible values include: 'Invalid', 'Start', 'Stop' + * @param {string} applicationResourceName Service Fabric application resource + * name. * - * @param {string} nodeInstanceId The node instance ID of the target node. - * This can be determined through GetNodeInfo API. + * @param {string} serviceResourceName Service Fabric service resource name. * - * @param {number} stopDurationInSeconds The duration, in seconds, to keep the - * node stopped. The minimum value is 600, the maximum is 14400. After this - * time expires, the node will automatically come back up. + * @param {string} replicaName Service Fabric replica name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -46914,7 +69583,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceResourceReplicaDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46922,13 +69591,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceReplicaDescription} 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. */ - startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback) { + getReplica(applicationResourceName, serviceResourceName, replicaName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46937,51 +69608,62 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, (err, result, request, response) => { + self._getReplica(applicationResourceName, serviceResourceName, replicaName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback); + return self._getReplica(applicationResourceName, serviceResourceName, replicaName, options, optionalCallback); } } /** - * @summary Gets the progress of an operation started using - * StartNodeTransition. + * @summary Creates or updates a volume resource. * - * Gets the progress of an operation started with StartNodeTransition using the - * provided OperationId. + * Creates a volume resource with the specified name and description. If a + * volume with the same name already exists, then its description is updated to + * the one indicated in this request. * + * @param {string} volumeResourceName Service Fabric volume resource name. * - * @param {string} nodeName The name of the node. + * @param {object} volumeResourceDescription Description for creating a volume + * resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} [volumeResourceDescription.description] User readable + * description of the volume. * - * @param {object} [options] Optional Parameters. + * @param {object} [volumeResourceDescription.azureFileParameters] This type + * describes a volume provided by an Azure Files file share. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} volumeResourceDescription.azureFileParameters.accountName + * Name of the Azure storage account for the File Share. + * + * @param {string} [volumeResourceDescription.azureFileParameters.accountKey] + * Access key of the Azure storage account for the File Share. + * + * @param {string} volumeResourceDescription.azureFileParameters.shareName Name + * of the Azure Files file share that provides storage for the volume. + * + * @param {string} volumeResourceDescription.name Volume resource name. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getNodeTransitionProgressWithHttpOperationResponse(nodeName, operationId, options) { + createVolumeResourceWithHttpOperationResponse(volumeResourceName, volumeResourceDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeTransitionProgress(nodeName, operationId, options, (err, result, request, response) => { + self._createVolumeResource(volumeResourceName, volumeResourceDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46992,24 +69674,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the progress of an operation started using - * StartNodeTransition. + * @summary Creates or updates a volume resource. * - * Gets the progress of an operation started with StartNodeTransition using the - * provided OperationId. + * Creates a volume resource with the specified name and description. If a + * volume with the same name already exists, then its description is updated to + * the one indicated in this request. * + * @param {string} volumeResourceName Service Fabric volume resource name. * - * @param {string} nodeName The name of the node. + * @param {object} volumeResourceDescription Description for creating a volume + * resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} [volumeResourceDescription.description] User readable + * description of the volume. * - * @param {object} [options] Optional Parameters. + * @param {object} [volumeResourceDescription.azureFileParameters] This type + * describes a volume provided by an Azure Files file share. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. + * @param {string} volumeResourceDescription.azureFileParameters.accountName + * Name of the Azure storage account for the File Share. + * + * @param {string} [volumeResourceDescription.azureFileParameters.accountKey] + * Access key of the Azure storage account for the File Share. + * + * @param {string} volumeResourceDescription.azureFileParameters.shareName Name + * of the Azure Files file share that provides storage for the volume. + * + * @param {string} volumeResourceDescription.name Volume resource name. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -47021,7 +69714,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {NodeTransitionProgress} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -47029,15 +69722,13 @@ class ServiceFabricClient extends ServiceClient { * * {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 NodeTransitionProgress} 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. */ - getNodeTransitionProgress(nodeName, operationId, options, optionalCallback) { + createVolumeResource(volumeResourceName, volumeResourceDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -47046,64 +69737,41 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeTransitionProgress(nodeName, operationId, options, (err, result, request, response) => { + self._createVolumeResource(volumeResourceName, volumeResourceDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeTransitionProgress(nodeName, operationId, options, optionalCallback); + return self._createVolumeResource(volumeResourceName, volumeResourceDescription, options, optionalCallback); } } /** - * @summary Gets a list of user-induced fault operations filtered by provided - * input. - * - * Gets the a list of user-induced fault operations filtered by provided input. - * - * @param {number} typeFilter Used to filter on OperationType for user-induced - * operations. - * 65535 - select all - * 1 - select PartitionDataLoss. - * 2 - select PartitionQuorumLoss. - * 4 - select PartitionRestart. - * 8 - select NodeTransition. + * @summary Gets the volume resource. * + * Gets the information about the volume resource with a given name. This + * information includes the volume description and other runtime information. * - * @param {number} stateFilter Used to filter on OperationState's for - * user-induced operations. - * 65535 - select All - * 1 - select Running - * 2 - select RollingBack - * 8 - select Completed - * 16 - select Faulted - * 32 - select Cancelled - * 64 - select ForceCancelled - * + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getFaultOperationListWithHttpOperationResponse(typeFilter, stateFilter, options) { + getVolumeResourceWithHttpOperationResponse(volumeResourceName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getFaultOperationList(typeFilter, stateFilter, options, (err, result, request, response) => { + self._getVolumeResource(volumeResourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -47114,38 +69782,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a list of user-induced fault operations filtered by provided - * input. + * @summary Gets the volume resource. * - * Gets the a list of user-induced fault operations filtered by provided input. - * - * @param {number} typeFilter Used to filter on OperationType for user-induced - * operations. - * 65535 - select all - * 1 - select PartitionDataLoss. - * 2 - select PartitionQuorumLoss. - * 4 - select PartitionRestart. - * 8 - select NodeTransition. - * - * - * @param {number} stateFilter Used to filter on OperationState's for - * user-induced operations. - * 65535 - select All - * 1 - select Running - * 2 - select RollingBack - * 8 - select Completed - * 16 - select Faulted - * 32 - select Cancelled - * 64 - select ForceCancelled + * Gets the information about the volume resource with a given name. This + * information includes the volume description and other runtime information. * + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -47156,7 +69801,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {VolumeResourceDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -47164,13 +69809,15 @@ class ServiceFabricClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VolumeResourceDescription} 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. */ - getFaultOperationList(typeFilter, stateFilter, options, optionalCallback) { + getVolumeResource(volumeResourceName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -47179,62 +69826,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getFaultOperationList(typeFilter, stateFilter, options, (err, result, request, response) => { + self._getVolumeResource(volumeResourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getFaultOperationList(typeFilter, stateFilter, options, optionalCallback); + return self._getVolumeResource(volumeResourceName, options, optionalCallback); } } /** - * @summary Cancels a user-induced fault operation. - * - * The following is a list of APIs that start fault operations that may be - * cancelled using CancelOperation - - * - StartDataLoss - * - StartQuorumLoss - * - StartPartitionRestart - * - StartNodeTransition - * - * If force is false, then the specified user-induced operation will be - * gracefully stopped and cleaned up. If force is true, the command will be - * aborted, and some internal state - * may be left behind. Specifying force as true should be used with care. - * Calling this API with force set to true is not allowed until this API has - * already - * been called on the same test command with force set to false first, or - * unless the test command already has an OperationState of - * OperationState.RollingBack. - * Clarification: OperationState.RollingBack means that the system will/is be - * cleaning up internal system state caused by executing the command. It will - * not restore data if the - * test command was to cause data loss. For example, if you call StartDataLoss - * then call this API, the system will only clean up internal state from - * running the command. - * It will not restore the target partition's data, if the command progressed - * far enough to cause data loss. - * - * Important note: if this API is invoked with force==true, internal state may - * be left behind. - * + * @summary Deletes the volume resource. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * Deletes the volume identified by the name. * - * @param {boolean} force Indicates whether to gracefully rollback and clean up - * internal system state modified by executing the user-induced operation. + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -47244,11 +69855,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - cancelOperationWithHttpOperationResponse(operationId, force, options) { + deleteVolumeResourceWithHttpOperationResponse(volumeResourceName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._cancelOperation(operationId, force, options, (err, result, request, response) => { + self._deleteVolumeResource(volumeResourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -47259,50 +69870,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Cancels a user-induced fault operation. - * - * The following is a list of APIs that start fault operations that may be - * cancelled using CancelOperation - - * - StartDataLoss - * - StartQuorumLoss - * - StartPartitionRestart - * - StartNodeTransition - * - * If force is false, then the specified user-induced operation will be - * gracefully stopped and cleaned up. If force is true, the command will be - * aborted, and some internal state - * may be left behind. Specifying force as true should be used with care. - * Calling this API with force set to true is not allowed until this API has - * already - * been called on the same test command with force set to false first, or - * unless the test command already has an OperationState of - * OperationState.RollingBack. - * Clarification: OperationState.RollingBack means that the system will/is be - * cleaning up internal system state caused by executing the command. It will - * not restore data if the - * test command was to cause data loss. For example, if you call StartDataLoss - * then call this API, the system will only clean up internal state from - * running the command. - * It will not restore the target partition's data, if the command progressed - * far enough to cause data loss. - * - * Important note: if this API is invoked with force==true, internal state may - * be left behind. + * @summary Deletes the volume resource. * + * Deletes the volume identified by the name. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API - * - * @param {boolean} force Indicates whether to gracefully rollback and clean up - * internal system state modified by executing the user-induced operation. + * @param {string} volumeResourceName Service Fabric volume resource name. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This specifies the time duration that the client is - * willing to wait for the requested operation to complete. The default value - * for this parameter is 60 seconds. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -47327,7 +69902,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - cancelOperation(operationId, force, options, optionalCallback) { + deleteVolumeResource(volumeResourceName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -47336,17 +69911,20 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._cancelOperation(operationId, force, options, (err, result, request, response) => { + self._deleteVolumeResource(volumeResourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._cancelOperation(operationId, force, options, optionalCallback); + return self._deleteVolumeResource(volumeResourceName, options, optionalCallback); } } } module.exports = ServiceFabricClient; +module.exports['default'] = ServiceFabricClient; +module.exports.ServiceFabricClient = ServiceFabricClient; +module.exports.ServiceFabricModels = models; diff --git a/lib/services/serviceFabric/package-lock.json b/lib/services/serviceFabric/package-lock.json new file mode 100644 index 0000000000..c0c33235ca --- /dev/null +++ b/lib/services/serviceFabric/package-lock.json @@ -0,0 +1,385 @@ +{ + "name": "azure-servicefabric", + "version": "2.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "requires": { + "mime-db": "~1.35.0" + } + }, + "moment": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + }, + "ms-rest": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/ms-rest/-/ms-rest-2.3.6.tgz", + "integrity": "sha512-M+Lx9P7Wy4TeAk7jqPLwGS1QS1gvxF6Xo+OHv5j1g3Kcb44T/GTUuSjxTKarF6aKyeacZH1ZD++Nt7pcql7dDA==", + "requires": { + "duplexer": "^0.1.1", + "is-buffer": "^1.1.6", + "is-stream": "^1.1.0", + "moment": "^2.21.0", + "request": "^2.87.0", + "through": "^2.3.8", + "tunnel": "0.0.5", + "uuid": "^3.2.1" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "tunnel": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.5.tgz", + "integrity": "sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + } + } +} diff --git a/lib/services/serviceFabric/package.json b/lib/services/serviceFabric/package.json index 7958e623e2..9211a9b548 100644 --- a/lib/services/serviceFabric/package.json +++ b/lib/services/serviceFabric/package.json @@ -1,35 +1,24 @@ { "name": "azure-servicefabric", "author": "Microsoft Corporation", - "contributors": [ - "Chen, Jeffrey " - ], - "version": "2.0.0-preview", - "description": "Microsoft Azure Service Fabric Client for node", - "tags": [ - "azure", - "sdk" - ], + "description": "ServiceFabricClient Library with typescript type definitions for node", + "version": "2.0.0", + "dependencies": { + "ms-rest": "^2.3.3" + }, "keywords": [ "node", "azure" ], + "license": "MIT", "main": "./lib/serviceFabricClient.js", "types": "./lib/serviceFabricClient.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/serviceFabric", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } }