diff --git a/lib/services/serviceFabric/lib/models/addRemoveReplicaScalingMechanism.js b/lib/services/serviceFabric/lib/models/addRemoveReplicaScalingMechanism.js new file mode 100644 index 0000000000..c6b053ceae --- /dev/null +++ b/lib/services/serviceFabric/lib/models/addRemoveReplicaScalingMechanism.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'); + +/** + * Describes the horizontal auto scaling mechanism that adds or removes + * replicas (containers or container groups). + * + * @extends models['AutoScalingMechanism'] + */ +class AddRemoveReplicaScalingMechanism extends models['AutoScalingMechanism'] { + /** + * Create a AddRemoveReplicaScalingMechanism. + * @member {number} minCount Minimum number of containers (scale down won't + * be performed below this number). + * @member {number} maxCount Maximum number of containers (scale up won't be + * performed above this number). + * @member {number} scaleIncrement Each time auto scaling is performed, this + * number of containers will be added or removed. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AddRemoveReplicaScalingMechanism + * + * @returns {object} metadata of AddRemoveReplicaScalingMechanism + * + */ + mapper() { + return { + required: false, + serializedName: 'AddRemoveReplica', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingMechanism', + className: 'AddRemoveReplicaScalingMechanism', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + minCount: { + required: true, + serializedName: 'minCount', + type: { + name: 'Number' + } + }, + maxCount: { + required: true, + serializedName: 'maxCount', + type: { + name: 'Number' + } + }, + scaleIncrement: { + required: true, + serializedName: 'scaleIncrement', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AddRemoveReplicaScalingMechanism; diff --git a/lib/services/serviceFabric/lib/models/applicationContainerInstanceExitedEvent.js b/lib/services/serviceFabric/lib/models/applicationContainerInstanceExitedEvent.js new file mode 100644 index 0000000000..69569a34fe --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationContainerInstanceExitedEvent.js @@ -0,0 +1,194 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 Exited event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationContainerInstanceExitedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationContainerInstanceExitedEvent. + * @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 ApplicationContainerInstanceExitedEvent + * + * @returns {object} metadata of ApplicationContainerInstanceExitedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationContainerInstanceExited', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationContainerInstanceExitedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationContainerInstanceExitedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationCreatedEvent.js b/lib/services/serviceFabric/lib/models/applicationCreatedEvent.js index bcf2a77ba4..b68f49e3d3 100644 --- a/lib/services/serviceFabric/lib/models/applicationCreatedEvent.js +++ b/lib/services/serviceFabric/lib/models/applicationCreatedEvent.js @@ -54,6 +54,13 @@ class ApplicationCreatedEvent extends models['ApplicationEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/applicationDeletedEvent.js b/lib/services/serviceFabric/lib/models/applicationDeletedEvent.js index 1e7137b09d..505f7231db 100644 --- a/lib/services/serviceFabric/lib/models/applicationDeletedEvent.js +++ b/lib/services/serviceFabric/lib/models/applicationDeletedEvent.js @@ -53,6 +53,13 @@ class ApplicationDeletedEvent extends models['ApplicationEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/applicationEvent.js b/lib/services/serviceFabric/lib/models/applicationEvent.js index ec73ad890c..63ccf59016 100644 --- a/lib/services/serviceFabric/lib/models/applicationEvent.js +++ b/lib/services/serviceFabric/lib/models/applicationEvent.js @@ -58,6 +58,13 @@ class ApplicationEvent extends models['FabricEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/applicationHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/applicationHealthReportExpiredEvent.js index d1048af4a2..d1a051704a 100644 --- a/lib/services/serviceFabric/lib/models/applicationHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/applicationHealthReportExpiredEvent.js @@ -60,6 +60,13 @@ class ApplicationHealthReportExpiredEvent extends models['ApplicationEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/applicationNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/applicationNewHealthReportEvent.js new file mode 100644 index 0000000000..215d3cd385 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationNewHealthReportEvent.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'); + +/** + * Application Health Report Created event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationNewHealthReportEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationNewHealthReportEvent. + * @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 ApplicationNewHealthReportEvent + * + * @returns {object} metadata of ApplicationNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationProcessExitedEvent.js b/lib/services/serviceFabric/lib/models/applicationProcessExitedEvent.js new file mode 100644 index 0000000000..1d96d55ab8 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationProcessExitedEvent.js @@ -0,0 +1,194 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 Exited event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationProcessExitedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationProcessExitedEvent. + * @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 ApplicationProcessExitedEvent + * + * @returns {object} metadata of ApplicationProcessExitedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationProcessExited', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationProcessExitedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationProcessExitedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationResourceDescription.js b/lib/services/serviceFabric/lib/models/applicationResourceDescription.js index 44ab255e87..fbf60e3742 100644 --- a/lib/services/serviceFabric/lib/models/applicationResourceDescription.js +++ b/lib/services/serviceFabric/lib/models/applicationResourceDescription.js @@ -11,28 +11,19 @@ 'use strict'; /** - * Describes a service fabric application resource. + * This type describes a application resource. * */ class ApplicationResourceDescription { /** * Create a ApplicationResourceDescription. + * @member {string} name Name of the 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 {array} [services] Describes the services in the application. This + * property is used to create or modify services of the application. On get + * only the name of the service is returned. The service description can be + * obtained by querying for the service resource. * @member {object} [diagnostics] Describes the diagnostics definition and * usage for an application resource. * @member {array} [diagnostics.sinks] List of supported sinks that can be @@ -42,7 +33,19 @@ class ApplicationResourceDescription { * @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. + * @member {string} [debugParams] Internal - used by Visual Studio to setup + * the debugging session on the local development environment. + * @member {array} [serviceNames] Names of the services in the application. + * @member {string} [status] Status of the application. Possible values + * include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of 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. */ constructor() { } @@ -61,16 +64,16 @@ class ApplicationResourceDescription { name: 'Composite', className: 'ApplicationResourceDescription', modelProperties: { - description: { - required: false, - serializedName: 'properties.description', + name: { + required: true, + serializedName: 'name', type: { name: 'String' } }, - debugParams: { + description: { required: false, - serializedName: 'properties.debugParams', + serializedName: 'properties.description', type: { name: 'String' } @@ -90,20 +93,34 @@ class ApplicationResourceDescription { } } }, - healthState: { + diagnostics: { required: false, - readOnly: true, - serializedName: 'properties.healthState', + serializedName: 'properties.diagnostics', + type: { + name: 'Composite', + className: 'DiagnosticsDescription' + } + }, + debugParams: { + required: false, + serializedName: 'properties.debugParams', type: { name: 'String' } }, - unhealthyEvaluation: { + serviceNames: { required: false, readOnly: true, - serializedName: 'properties.unhealthyEvaluation', + serializedName: 'properties.serviceNames', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } } }, status: { @@ -122,32 +139,18 @@ class ApplicationResourceDescription { name: 'String' } }, - serviceNames: { + healthState: { required: false, readOnly: true, - serializedName: 'properties.serviceNames', + serializedName: 'properties.healthState', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' } }, - diagnostics: { + unhealthyEvaluation: { required: false, - serializedName: 'properties.diagnostics', - type: { - name: 'Composite', - className: 'DiagnosticsDescription' - } - }, - name: { - required: true, - serializedName: 'name', + readOnly: true, + serializedName: 'properties.unhealthyEvaluation', type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/applicationScopedVolume.js b/lib/services/serviceFabric/lib/models/applicationScopedVolume.js new file mode 100644 index 0000000000..0207af6a83 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationScopedVolume.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 a volume whose lifetime is scoped to the application's lifetime. + * + * @extends models['VolumeReference'] + */ +class ApplicationScopedVolume extends models['VolumeReference'] { + /** + * Create a ApplicationScopedVolume. + * @member {object} creationParameters Describes parameters for creating + * application-scoped volumes. + * @member {string} [creationParameters.description] User readable + * description of the volume. + * @member {string} [creationParameters.kind] Polymorphic Discriminator + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationScopedVolume + * + * @returns {object} metadata of ApplicationScopedVolume + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationScopedVolume', + type: { + name: 'Composite', + className: 'ApplicationScopedVolume', + 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' + } + }, + creationParameters: { + required: true, + serializedName: 'creationParameters', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'ApplicationScopedVolumeCreationParameters', + className: 'ApplicationScopedVolumeCreationParameters' + } + } + } + } + }; + } +} + +module.exports = ApplicationScopedVolume; diff --git a/lib/services/serviceFabric/lib/models/applicationScopedVolumeCreationParameters.js b/lib/services/serviceFabric/lib/models/applicationScopedVolumeCreationParameters.js new file mode 100644 index 0000000000..1d8bc07483 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationScopedVolumeCreationParameters.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 parameters for creating application-scoped volumes. + * + */ +class ApplicationScopedVolumeCreationParameters { + /** + * Create a ApplicationScopedVolumeCreationParameters. + * @member {string} [description] User readable description of the volume. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationScopedVolumeCreationParameters + * + * @returns {object} metadata of ApplicationScopedVolumeCreationParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationScopedVolumeCreationParameters', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'ApplicationScopedVolumeCreationParameters', + className: 'ApplicationScopedVolumeCreationParameters', + modelProperties: { + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationScopedVolumeCreationParameters; diff --git a/lib/services/serviceFabric/lib/models/applicationScopedVolumeCreationParametersServiceFabricVolumeDisk.js b/lib/services/serviceFabric/lib/models/applicationScopedVolumeCreationParametersServiceFabricVolumeDisk.js new file mode 100644 index 0000000000..9d7495092b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationScopedVolumeCreationParametersServiceFabricVolumeDisk.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'; + +const models = require('./index'); + +/** + * Describes parameters for creating application-scoped volumes provided by + * Service Fabric Volume Disks + * + * @extends models['ApplicationScopedVolumeCreationParameters'] + */ +class ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk extends models['ApplicationScopedVolumeCreationParameters'] { + /** + * Create a ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. + * @member {string} sizeDisk Volume size. Possible values include: 'Small', + * 'Medium', 'Large' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk + * + * @returns {object} metadata of ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceFabricVolumeDisk', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'ApplicationScopedVolumeCreationParameters', + className: 'ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk', + modelProperties: { + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + sizeDisk: { + required: true, + serializedName: 'sizeDisk', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeCompletedEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeCompletedEvent.js new file mode 100644 index 0000000000..c53b9a2249 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeCompletedEvent.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'); + +/** + * Application Upgrade Completed event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeCompletedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeCompletedEvent. + * @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 ApplicationUpgradeCompletedEvent + * + * @returns {object} metadata of ApplicationUpgradeCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationUpgradeCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeDomainCompletedEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeDomainCompletedEvent.js new file mode 100644 index 0000000000..73117ca1bc --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeDomainCompletedEvent.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'); + +/** + * Application Upgrade Domain Completed event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeDomainCompletedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeDomainCompletedEvent. + * @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 ApplicationUpgradeDomainCompletedEvent + * + * @returns {object} metadata of ApplicationUpgradeDomainCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeDomainCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeDomainCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationUpgradeDomainCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackCompletedEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackCompletedEvent.js new file mode 100644 index 0000000000..2094d9ca72 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackCompletedEvent.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'); + +/** + * Application Upgrade Rollback Completed event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeRollbackCompletedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeRollbackCompletedEvent. + * @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 ApplicationUpgradeRollbackCompletedEvent + * + * @returns {object} metadata of ApplicationUpgradeRollbackCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeRollbackCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeRollbackCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationUpgradeRollbackCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackStartedEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackStartedEvent.js new file mode 100644 index 0000000000..2636ccbcc9 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeRollbackStartedEvent.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 Rollback Started event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeRollbackStartedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeRollbackStartedEvent. + * @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 ApplicationUpgradeRollbackStartedEvent + * + * @returns {object} metadata of ApplicationUpgradeRollbackStartedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeRollbackStarted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeRollbackStartedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationUpgradeRollbackStartedEvent; diff --git a/lib/services/serviceFabric/lib/models/applicationUpgradeStartedEvent.js b/lib/services/serviceFabric/lib/models/applicationUpgradeStartedEvent.js new file mode 100644 index 0000000000..1ac4dea671 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/applicationUpgradeStartedEvent.js @@ -0,0 +1,145 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 Started event. + * + * @extends models['ApplicationEvent'] + */ +class ApplicationUpgradeStartedEvent extends models['ApplicationEvent'] { + /** + * Create a ApplicationUpgradeStartedEvent. + * @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 ApplicationUpgradeStartedEvent + * + * @returns {object} metadata of ApplicationUpgradeStartedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationUpgradeStarted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ApplicationUpgradeStartedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ApplicationUpgradeStartedEvent; diff --git a/lib/services/serviceFabric/lib/models/autoScalingMechanism.js b/lib/services/serviceFabric/lib/models/autoScalingMechanism.js new file mode 100644 index 0000000000..ec63339be2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/autoScalingMechanism.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'; + +/** + * Describes the mechanism for performing auto scaling operation. Derived + * classes will describe the actual mechanism. + * + */ +class AutoScalingMechanism { + /** + * Create a AutoScalingMechanism. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of AutoScalingMechanism + * + * @returns {object} metadata of AutoScalingMechanism + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoScalingMechanism', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingMechanism', + className: 'AutoScalingMechanism', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AutoScalingMechanism; diff --git a/lib/services/serviceFabric/lib/models/autoScalingMetric.js b/lib/services/serviceFabric/lib/models/autoScalingMetric.js new file mode 100644 index 0000000000..0e3aeef77a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/autoScalingMetric.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'; + +/** + * Describes the metric that is used for triggering auto scaling operation. + * Derived classes will describe resources or metrics. + * + */ +class AutoScalingMetric { + /** + * Create a AutoScalingMetric. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of AutoScalingMetric + * + * @returns {object} metadata of AutoScalingMetric + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoScalingMetric', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingMetric', + className: 'AutoScalingMetric', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AutoScalingMetric; diff --git a/lib/services/serviceFabric/lib/models/autoScalingPolicy.js b/lib/services/serviceFabric/lib/models/autoScalingPolicy.js new file mode 100644 index 0000000000..5c95922d57 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/autoScalingPolicy.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'; + +/** + * Describes the auto scaling policy + * + */ +class AutoScalingPolicy { + /** + * Create a AutoScalingPolicy. + * @member {string} name The name of the auto scaling policy. + * @member {object} trigger Determines when auto scaling operation will be + * invoked. + * @member {string} [trigger.kind] Polymorphic Discriminator + * @member {object} mechanism The mechanism that is used to scale when auto + * scaling operation is invoked. + * @member {string} [mechanism.kind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of AutoScalingPolicy + * + * @returns {object} metadata of AutoScalingPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoScalingPolicy', + type: { + name: 'Composite', + className: 'AutoScalingPolicy', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + trigger: { + required: true, + serializedName: 'trigger', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingTrigger', + className: 'AutoScalingTrigger' + } + }, + mechanism: { + required: true, + serializedName: 'mechanism', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingMechanism', + className: 'AutoScalingMechanism' + } + } + } + } + }; + } +} + +module.exports = AutoScalingPolicy; diff --git a/lib/services/serviceFabric/lib/models/autoScalingResourceMetric.js b/lib/services/serviceFabric/lib/models/autoScalingResourceMetric.js new file mode 100644 index 0000000000..9815007d49 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/autoScalingResourceMetric.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'); + +/** + * Describes the resource that is used for triggering auto scaling. + * + * @extends models['AutoScalingMetric'] + */ +class AutoScalingResourceMetric extends models['AutoScalingMetric'] { + /** + * Create a AutoScalingResourceMetric. + * @member {string} name Name of the resource. Possible values include: + * 'cpu', 'memoryInGB' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AutoScalingResourceMetric + * + * @returns {object} metadata of AutoScalingResourceMetric + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingMetric', + className: 'AutoScalingResourceMetric', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AutoScalingResourceMetric; diff --git a/lib/services/serviceFabric/lib/models/autoScalingTrigger.js b/lib/services/serviceFabric/lib/models/autoScalingTrigger.js new file mode 100644 index 0000000000..90313cc8ab --- /dev/null +++ b/lib/services/serviceFabric/lib/models/autoScalingTrigger.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 auto scaling operation. + * + */ +class AutoScalingTrigger { + /** + * Create a AutoScalingTrigger. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of AutoScalingTrigger + * + * @returns {object} metadata of AutoScalingTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'AutoScalingTrigger', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingTrigger', + className: 'AutoScalingTrigger', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AutoScalingTrigger; diff --git a/lib/services/serviceFabric/lib/models/averageLoadScalingTrigger.js b/lib/services/serviceFabric/lib/models/averageLoadScalingTrigger.js new file mode 100644 index 0000000000..b337db37ba --- /dev/null +++ b/lib/services/serviceFabric/lib/models/averageLoadScalingTrigger.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'); + +/** + * Describes the average load trigger used for auto scaling. + * + * @extends models['AutoScalingTrigger'] + */ +class AverageLoadScalingTrigger extends models['AutoScalingTrigger'] { + /** + * Create a AverageLoadScalingTrigger. + * @member {object} metric Description of the metric that is used for + * scaling. + * @member {string} [metric.kind] Polymorphic Discriminator + * @member {number} lowerLoadThreshold Lower load threshold (if average load + * is below this threshold, service will scale down). + * @member {number} upperLoadThreshold Upper load threshold (if average load + * is above this threshold, service will scale up). + * @member {number} scaleIntervalInSeconds Scale interval that indicates how + * often will this trigger be checked. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AverageLoadScalingTrigger + * + * @returns {object} metadata of AverageLoadScalingTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'AverageLoad', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingTrigger', + className: 'AverageLoadScalingTrigger', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + metric: { + required: true, + serializedName: 'metric', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'AutoScalingMetric', + className: 'AutoScalingMetric' + } + }, + lowerLoadThreshold: { + required: true, + serializedName: 'lowerLoadThreshold', + type: { + name: 'Number' + } + }, + upperLoadThreshold: { + required: true, + serializedName: 'upperLoadThreshold', + type: { + name: 'Number' + } + }, + scaleIntervalInSeconds: { + required: true, + serializedName: 'scaleIntervalInSeconds', + constraints: { + InclusiveMinimum: 60 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AverageLoadScalingTrigger; diff --git a/lib/services/serviceFabric/lib/models/azureInternalMonitoringPipelineSinkDescription.js b/lib/services/serviceFabric/lib/models/azureInternalMonitoringPipelineSinkDescription.js new file mode 100644 index 0000000000..bf2023bc50 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/azureInternalMonitoringPipelineSinkDescription.js @@ -0,0 +1,119 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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'); + +/** + * Diagnostics settings for Geneva. + * + * @extends models['DiagnosticsSinkProperties'] + */ +class AzureInternalMonitoringPipelineSinkDescription extends models['DiagnosticsSinkProperties'] { + /** + * Create a AzureInternalMonitoringPipelineSinkDescription. + * @member {string} [accountName] Azure Internal monitoring pipeline account. + * @member {string} [namespace] Azure Internal monitoring pipeline account + * namespace. + * @member {string} [maConfigUrl] Azure Internal monitoring agent + * configuration. + * @member {object} [fluentdConfigUrl] Azure Internal monitoring agent + * fluentd configuration. + * @member {string} [autoKeyConfigUrl] Azure Internal monitoring pipeline + * autokey associated with the certificate. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureInternalMonitoringPipelineSinkDescription + * + * @returns {object} metadata of AzureInternalMonitoringPipelineSinkDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureInternalMonitoringPipeline', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'DiagnosticsSinkProperties', + className: 'AzureInternalMonitoringPipelineSinkDescription', + 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' + } + }, + accountName: { + required: false, + serializedName: 'accountName', + type: { + name: 'String' + } + }, + namespace: { + required: false, + serializedName: 'namespace', + type: { + name: 'String' + } + }, + maConfigUrl: { + required: false, + serializedName: 'maConfigUrl', + type: { + name: 'String' + } + }, + fluentdConfigUrl: { + required: false, + serializedName: 'fluentdConfigUrl', + type: { + name: 'Object' + } + }, + autoKeyConfigUrl: { + required: false, + serializedName: 'autoKeyConfigUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureInternalMonitoringPipelineSinkDescription; diff --git a/lib/services/serviceFabric/lib/models/backupEpoch.js b/lib/services/serviceFabric/lib/models/backupEpoch.js index 4aeeeb44e8..88edbedccd 100644 --- a/lib/services/serviceFabric/lib/models/backupEpoch.js +++ b/lib/services/serviceFabric/lib/models/backupEpoch.js @@ -24,7 +24,7 @@ class 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 + * @member {string} [dataLossNumber] The current data loss 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. diff --git a/lib/services/serviceFabric/lib/models/backupInfo.js b/lib/services/serviceFabric/lib/models/backupInfo.js index fe3c13d28c..85ac767aa7 100644 --- a/lib/services/serviceFabric/lib/models/backupInfo.js +++ b/lib/services/serviceFabric/lib/models/backupInfo.js @@ -41,11 +41,11 @@ class BackupInfo { * '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 + * @member {string} [epochOfLastBackupRecord.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. - * @member {string} [epochOfLastBackupRecord.dataLossNumber] The current + * @member {string} [epochOfLastBackupRecord.dataLossVersion] 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 @@ -53,6 +53,8 @@ class BackupInfo { * @member {string} [lsnOfLastBackupRecord] LSN of the last record in this * backup. * @member {date} [creationTimeUtc] The date time when this backup was taken. + * @member {string} [serviceManifestVersion] Manifest Version of the service + * this partition backup belongs to. * @member {object} [failureError] Denotes the failure encountered in getting * backup point information. * @member {string} [failureError.code] Defines the fabric error codes that @@ -105,6 +107,7 @@ class BackupInfo { * - "FABRIC_E_BACKUP_NOT_ENABLED" * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" * * - Possible values of the error code for HTTP status code 409 (Conflict) * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" @@ -216,7 +219,7 @@ class BackupInfo { * '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' + * 'SerializationError', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' * @member {string} [failureError.message] Error message. */ constructor() { @@ -296,7 +299,7 @@ class BackupInfo { serializedName: 'EpochOfLastBackupRecord', type: { name: 'Composite', - className: 'BackupEpoch' + className: 'Epoch' } }, lsnOfLastBackupRecord: { @@ -313,6 +316,13 @@ class BackupInfo { name: 'DateTime' } }, + serviceManifestVersion: { + required: false, + serializedName: 'ServiceManifestVersion', + type: { + name: 'String' + } + }, failureError: { required: false, serializedName: 'FailureError', diff --git a/lib/services/serviceFabric/lib/models/backupPolicyDescription.js b/lib/services/serviceFabric/lib/models/backupPolicyDescription.js index 40c8c255f2..d42222cff5 100644 --- a/lib/services/serviceFabric/lib/models/backupPolicyDescription.js +++ b/lib/services/serviceFabric/lib/models/backupPolicyDescription.js @@ -35,6 +35,10 @@ class BackupPolicyDescription { * @member {string} [storage.friendlyName] Friendly name for this backup * storage. * @member {string} [storage.storageKind] Polymorphic Discriminator + * @member {object} [retentionPolicy] Describes the policy to retain backups + * in storage. + * @member {string} [retentionPolicy.retentionPolicyType] Polymorphic + * Discriminator */ constructor() { } @@ -103,6 +107,19 @@ class BackupPolicyDescription { uberParent: 'BackupStorageDescription', className: 'BackupStorageDescription' } + }, + retentionPolicy: { + required: false, + serializedName: 'RetentionPolicy', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'RetentionPolicyType', + clientName: 'retentionPolicyType' + }, + uberParent: 'RetentionPolicyDescription', + className: 'RetentionPolicyDescription' + } } } } diff --git a/lib/services/serviceFabric/lib/models/backupProgressInfo.js b/lib/services/serviceFabric/lib/models/backupProgressInfo.js index ecb09475eb..67b8c4238e 100644 --- a/lib/services/serviceFabric/lib/models/backupProgressInfo.js +++ b/lib/services/serviceFabric/lib/models/backupProgressInfo.js @@ -27,11 +27,11 @@ class BackupProgressInfo { * 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 + * @member {string} [epochOfLastBackupRecord.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. - * @member {string} [epochOfLastBackupRecord.dataLossNumber] The current + * @member {string} [epochOfLastBackupRecord.dataLossVersion] 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 @@ -90,6 +90,7 @@ class BackupProgressInfo { * - "FABRIC_E_BACKUP_NOT_ENABLED" * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" * * - Possible values of the error code for HTTP status code 409 (Conflict) * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" @@ -201,7 +202,7 @@ class BackupProgressInfo { * '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' + * 'SerializationError', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' * @member {string} [failureError.message] Error message. */ constructor() { @@ -254,7 +255,7 @@ class BackupProgressInfo { serializedName: 'EpochOfLastBackupRecord', type: { name: 'Composite', - className: 'BackupEpoch' + className: 'Epoch' } }, lsnOfLastBackupRecord: { diff --git a/lib/services/serviceFabric/lib/models/basicRetentionPolicyDescription.js b/lib/services/serviceFabric/lib/models/basicRetentionPolicyDescription.js new file mode 100644 index 0000000000..e1c9a571ff --- /dev/null +++ b/lib/services/serviceFabric/lib/models/basicRetentionPolicyDescription.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'; + +const models = require('./index'); + +/** + * Describes basic retention policy. + * + * @extends models['RetentionPolicyDescription'] + */ +class BasicRetentionPolicyDescription extends models['RetentionPolicyDescription'] { + /** + * Create a BasicRetentionPolicyDescription. + * @member {moment.duration} retentionDuration It is the minimum duration for + * which a backup created, will remain stored in the storage and might get + * deleted after that span of time. It should be specified in ISO8601 format. + * @member {number} [minimumNumberOfBackups] It is the minimum number of + * backups to be retained at any point of time. If specified with a non zero + * value, backups will not be deleted even if the backups have gone past + * retention duration and have number of backups less than or equal to it. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BasicRetentionPolicyDescription + * + * @returns {object} metadata of BasicRetentionPolicyDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'Basic', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'RetentionPolicyType', + clientName: 'retentionPolicyType' + }, + uberParent: 'RetentionPolicyDescription', + className: 'BasicRetentionPolicyDescription', + modelProperties: { + retentionPolicyType: { + required: true, + serializedName: 'RetentionPolicyType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + retentionDuration: { + required: true, + serializedName: 'RetentionDuration', + type: { + name: 'TimeSpan' + } + }, + minimumNumberOfBackups: { + required: false, + serializedName: 'MinimumNumberOfBackups', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = BasicRetentionPolicyDescription; diff --git a/lib/services/serviceFabric/lib/models/chaosCodePackageRestartScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosCodePackageRestartScheduledEvent.js new file mode 100644 index 0000000000..fcdc04782a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosCodePackageRestartScheduledEvent.js @@ -0,0 +1,145 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 ChaosCodePackageRestartScheduledEvent extends models['ApplicationEvent'] { + /** + * Create a ChaosCodePackageRestartScheduledEvent. + * @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 ChaosCodePackageRestartScheduledEvent + * + * @returns {object} metadata of ChaosCodePackageRestartScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosCodePackageRestartScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosCodePackageRestartScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ChaosCodePackageRestartScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosNodeRestartScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosNodeRestartScheduledEvent.js new file mode 100644 index 0000000000..18ef7de395 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosNodeRestartScheduledEvent.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 Node Fault Scheduled event. + * + * @extends models['NodeEvent'] + */ +class ChaosNodeRestartScheduledEvent extends models['NodeEvent'] { + /** + * Create a ChaosNodeRestartScheduledEvent. + * @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 ChaosNodeRestartScheduledEvent + * + * @returns {object} metadata of ChaosNodeRestartScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosNodeRestartScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosNodeRestartScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ChaosNodeRestartScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosPartitionPrimaryMoveScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosPartitionPrimaryMoveScheduledEvent.js new file mode 100644 index 0000000000..f03cd5d07d --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosPartitionPrimaryMoveScheduledEvent.js @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Chaos Move Primary Fault Scheduled event. + * + * @extends models['PartitionEvent'] + */ +class ChaosPartitionPrimaryMoveScheduledEvent extends models['PartitionEvent'] { + /** + * Create a ChaosPartitionPrimaryMoveScheduledEvent. + * @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 ChaosPartitionPrimaryMoveScheduledEvent + * + * @returns {object} metadata of ChaosPartitionPrimaryMoveScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosPartitionPrimaryMoveScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosPartitionPrimaryMoveScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ChaosPartitionPrimaryMoveScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosPartitionSecondaryMoveScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosPartitionSecondaryMoveScheduledEvent.js new file mode 100644 index 0000000000..ff3ae98cb6 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosPartitionSecondaryMoveScheduledEvent.js @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 ChaosPartitionSecondaryMoveScheduledEvent extends models['PartitionEvent'] { + /** + * Create a ChaosPartitionSecondaryMoveScheduledEvent. + * @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 ChaosPartitionSecondaryMoveScheduledEvent + * + * @returns {object} metadata of ChaosPartitionSecondaryMoveScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosPartitionSecondaryMoveScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosPartitionSecondaryMoveScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ChaosPartitionSecondaryMoveScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosReplicaRemovalScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosReplicaRemovalScheduledEvent.js new file mode 100644 index 0000000000..31c03c3daf --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosReplicaRemovalScheduledEvent.js @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 ChaosReplicaRemovalScheduledEvent extends models['ReplicaEvent'] { + /** + * Create a ChaosReplicaRemovalScheduledEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosReplicaRemovalScheduledEvent + * + * @returns {object} metadata of ChaosReplicaRemovalScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosReplicaRemovalScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosReplicaRemovalScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ChaosReplicaRemovalScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosReplicaRestartScheduledEvent.js b/lib/services/serviceFabric/lib/models/chaosReplicaRestartScheduledEvent.js new file mode 100644 index 0000000000..54e3720bd2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/chaosReplicaRestartScheduledEvent.js @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 ChaosReplicaRestartScheduledEvent extends models['ReplicaEvent'] { + /** + * Create a ChaosReplicaRestartScheduledEvent. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ChaosReplicaRestartScheduledEvent + * + * @returns {object} metadata of ChaosReplicaRestartScheduledEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ChaosReplicaRestartScheduled', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ChaosReplicaRestartScheduledEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ChaosReplicaRestartScheduledEvent; diff --git a/lib/services/serviceFabric/lib/models/chaosStartedEvent.js b/lib/services/serviceFabric/lib/models/chaosStartedEvent.js index 261533277b..4394d7da03 100644 --- a/lib/services/serviceFabric/lib/models/chaosStartedEvent.js +++ b/lib/services/serviceFabric/lib/models/chaosStartedEvent.js @@ -65,6 +65,13 @@ class ChaosStartedEvent extends models['ClusterEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/chaosStoppedEvent.js b/lib/services/serviceFabric/lib/models/chaosStoppedEvent.js index 0d8f89b95c..f3aeeb39b5 100644 --- a/lib/services/serviceFabric/lib/models/chaosStoppedEvent.js +++ b/lib/services/serviceFabric/lib/models/chaosStoppedEvent.js @@ -52,6 +52,13 @@ class ChaosStoppedEvent extends models['ClusterEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js b/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js index 0f57bdfdd8..e6721b4772 100644 --- a/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js +++ b/lib/services/serviceFabric/lib/models/clusterConfigurationUpgradeDescription.js @@ -19,16 +19,21 @@ const moment = require('moment'); class ClusterConfigurationUpgradeDescription { /** * Create a ClusterConfigurationUpgradeDescription. - * @member {string} clusterConfig The cluster configuration. + * @member {string} clusterConfig The cluster configuration as a JSON string. + * For example, [this + * file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) + * contains JSON describing the [nodes and other properties of the + * cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest). * @member {moment.duration} [healthCheckRetryTimeout] The length of time - * between attempts to perform a health checks if the application or cluster - * is not healthy. Default value: moment.duration('PT0H0M0S') . + * between attempts to perform health checks if the application or cluster is + * not healthy. Default value: moment.duration('PT0H0M0S') . * @member {moment.duration} [healthCheckWaitDurationInSeconds] The length of * time to wait after completing an upgrade domain before starting the health * checks process. Default value: moment.duration('PT0H0M0S') . * @member {moment.duration} [healthCheckStableDurationInSeconds] The length - * of time that the application or cluster must remain healthy. Default - * value: moment.duration('PT0H0M0S') . + * of time that the application or cluster must remain healthy before the + * upgrade proceeds to the next upgrade domain. Default value: + * moment.duration('PT0H0M0S') . * @member {moment.duration} [upgradeDomainTimeoutInSeconds] The timeout for * the upgrade domain. Default value: moment.duration('PT0H0M0S') . * @member {moment.duration} [upgradeTimeoutInSeconds] The upgrade timeout. diff --git a/lib/services/serviceFabric/lib/models/clusterEvent.js b/lib/services/serviceFabric/lib/models/clusterEvent.js index e5d5f1deb2..c626492ada 100644 --- a/lib/services/serviceFabric/lib/models/clusterEvent.js +++ b/lib/services/serviceFabric/lib/models/clusterEvent.js @@ -51,6 +51,13 @@ class ClusterEvent extends models['FabricEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/clusterHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/clusterHealthReportExpiredEvent.js index aa8a98e62e..dc66591b30 100644 --- a/lib/services/serviceFabric/lib/models/clusterHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/clusterHealthReportExpiredEvent.js @@ -59,6 +59,13 @@ class ClusterHealthReportExpiredEvent extends models['ClusterEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/clusterNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/clusterNewHealthReportEvent.js new file mode 100644 index 0000000000..edd6371f0a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterNewHealthReportEvent.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'); + +/** + * Cluster Health Report Created event. + * + * @extends models['ClusterEvent'] + */ +class ClusterNewHealthReportEvent extends models['ClusterEvent'] { + /** + * Create a ClusterNewHealthReportEvent. + * @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 ClusterNewHealthReportEvent + * + * @returns {object} metadata of ClusterNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ClusterNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeCompletedEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeCompletedEvent.js new file mode 100644 index 0000000000..dd68a348ee --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeCompletedEvent.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 Completed event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeCompletedEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeCompletedEvent. + * @member {string} targetClusterVersion Target Cluster version. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ClusterUpgradeCompletedEvent + * + * @returns {object} metadata of ClusterUpgradeCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ClusterUpgradeCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeDomainCompletedEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeDomainCompletedEvent.js new file mode 100644 index 0000000000..67662c1cff --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeDomainCompletedEvent.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 Domain Completed event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeDomainCompletedEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeDomainCompletedEvent. + * @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 ClusterUpgradeDomainCompletedEvent + * + * @returns {object} metadata of ClusterUpgradeDomainCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeDomainCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeDomainCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ClusterUpgradeDomainCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackCompletedEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackCompletedEvent.js new file mode 100644 index 0000000000..bde5e45dc7 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackCompletedEvent.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'); + +/** + * Cluster Upgrade Rollback Completed event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeRollbackCompletedEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeRollbackCompletedEvent. + * @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 ClusterUpgradeRollbackCompletedEvent + * + * @returns {object} metadata of ClusterUpgradeRollbackCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeRollbackCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeRollbackCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ClusterUpgradeRollbackCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackStartedEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackStartedEvent.js new file mode 100644 index 0000000000..46f74b28e2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeRollbackStartedEvent.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'); + +/** + * Cluster Upgrade Rollback Started event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeRollbackStartedEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeRollbackStartedEvent. + * @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 ClusterUpgradeRollbackStartedEvent + * + * @returns {object} metadata of ClusterUpgradeRollbackStartedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeRollbackStarted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeRollbackStartedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ClusterUpgradeRollbackStartedEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterUpgradeStartedEvent.js b/lib/services/serviceFabric/lib/models/clusterUpgradeStartedEvent.js new file mode 100644 index 0000000000..ecfc4e50c8 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterUpgradeStartedEvent.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'); + +/** + * Cluster Upgrade Started event. + * + * @extends models['ClusterEvent'] + */ +class ClusterUpgradeStartedEvent extends models['ClusterEvent'] { + /** + * Create a ClusterUpgradeStartedEvent. + * @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 ClusterUpgradeStartedEvent + * + * @returns {object} metadata of ClusterUpgradeStartedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterUpgradeStarted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ClusterUpgradeStartedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ClusterUpgradeStartedEvent; diff --git a/lib/services/serviceFabric/lib/models/clusterVersion.js b/lib/services/serviceFabric/lib/models/clusterVersion.js new file mode 100644 index 0000000000..ef62600af9 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/clusterVersion.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'; + +/** + * The cluster version. + * + */ +class ClusterVersion { + /** + * Create a ClusterVersion. + * @member {string} [version] The Service Fabric cluster runtime version. + */ + constructor() { + } + + /** + * Defines the metadata of ClusterVersion + * + * @returns {object} metadata of ClusterVersion + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterVersion', + type: { + name: 'Composite', + className: 'ClusterVersion', + modelProperties: { + version: { + required: false, + serializedName: 'Version', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ClusterVersion; diff --git a/lib/services/serviceFabric/lib/models/containerCodePackageProperties.js b/lib/services/serviceFabric/lib/models/containerCodePackageProperties.js index fd9c7a00ba..78a36b3f0a 100644 --- a/lib/services/serviceFabric/lib/models/containerCodePackageProperties.js +++ b/lib/services/serviceFabric/lib/models/containerCodePackageProperties.js @@ -25,7 +25,8 @@ class ContainerCodePackageProperties { * @member {string} [imageRegistryCredential.username] The username for the * private registry. * @member {string} [imageRegistryCredential.password] The password for the - * private registry. + * private registry. The password is required for create or update + * operations, however it is not returned in the get or list operations. * @member {string} [entrypoint] Override for the default entry point in the * container. * @member {array} [commands] Command array to execute within the container @@ -38,8 +39,7 @@ class ContainerCodePackageProperties { * 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 The resources required by this container. * @member {object} [resources.requests] Describes the requested resources * for a given container. * @member {number} [resources.requests.memoryInGB] The memory request in GB @@ -51,7 +51,19 @@ class ContainerCodePackageProperties { * @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 {array} [volumeRefs] Volumes to be attached to the container. The + * lifetime of these volumes is independent of the application's lifetime. + * @member {array} [volumes] Volumes to be attached to the container. The + * lifetime of these volumes is scoped to the application's lifetime. + * @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 {array} [reliableCollectionsRefs] A list of ReliableCollection + * resources used by this particular code package. Please refer to + * ReliablecollectionsRef for more details. * @member {object} [instanceView] Runtime information of a container * instance. * @member {number} [instanceView.restartCount] The number of times the @@ -82,12 +94,6 @@ class ContainerCodePackageProperties { * 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() { } @@ -224,21 +230,27 @@ class ContainerCodePackageProperties { name: 'Sequence', element: { required: false, - serializedName: 'ContainerVolumeElementType', + serializedName: 'VolumeReferenceElementType', type: { name: 'Composite', - className: 'ContainerVolume' + className: 'VolumeReference' } } } }, - instanceView: { + volumes: { required: false, - readOnly: true, - serializedName: 'instanceView', + serializedName: 'volumes', type: { - name: 'Composite', - className: 'ContainerInstanceView' + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationScopedVolumeElementType', + type: { + name: 'Composite', + className: 'ApplicationScopedVolume' + } + } } }, diagnostics: { @@ -248,6 +260,30 @@ class ContainerCodePackageProperties { name: 'Composite', className: 'DiagnosticsRef' } + }, + reliableCollectionsRefs: { + required: false, + serializedName: 'reliableCollectionsRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReliableCollectionsRefElementType', + type: { + name: 'Composite', + className: 'ReliableCollectionsRef' + } + } + } + }, + instanceView: { + required: false, + readOnly: true, + serializedName: 'instanceView', + type: { + name: 'Composite', + className: 'ContainerInstanceView' + } } } } diff --git a/lib/services/serviceFabric/lib/models/containerInstanceEvent.js b/lib/services/serviceFabric/lib/models/containerInstanceEvent.js index 9cf71318ce..9aed4e4897 100644 --- a/lib/services/serviceFabric/lib/models/containerInstanceEvent.js +++ b/lib/services/serviceFabric/lib/models/containerInstanceEvent.js @@ -51,6 +51,13 @@ class ContainerInstanceEvent extends models['FabricEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportExpiredEvent.js index 86e7698dd6..c75af1b5a0 100644 --- a/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/deployedApplicationHealthReportExpiredEvent.js @@ -61,6 +61,13 @@ class DeployedApplicationHealthReportExpiredEvent extends models['ApplicationEve name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/deployedApplicationNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/deployedApplicationNewHealthReportEvent.js new file mode 100644 index 0000000000..62b93c6c7c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deployedApplicationNewHealthReportEvent.js @@ -0,0 +1,176 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 DeployedApplicationNewHealthReportEvent extends models['ApplicationEvent'] { + /** + * Create a DeployedApplicationNewHealthReportEvent. + * @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 DeployedApplicationNewHealthReportEvent + * + * @returns {object} metadata of DeployedApplicationNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'DeployedApplicationNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'DeployedApplicationNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = DeployedApplicationNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthReportExpiredEvent.js new file mode 100644 index 0000000000..ab751a3765 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageHealthReportExpiredEvent.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'); + +/** + * Deployed Service Health Report Expired event. + * + * @extends models['ApplicationEvent'] + */ +class DeployedServicePackageHealthReportExpiredEvent extends models['ApplicationEvent'] { + /** + * Create a DeployedServicePackageHealthReportExpiredEvent. + * @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} 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 DeployedServicePackageHealthReportExpiredEvent + * + * @returns {object} metadata of DeployedServicePackageHealthReportExpiredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'DeployedServicePackageHealthReportExpired', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'DeployedServicePackageHealthReportExpiredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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' + } + }, + 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 = DeployedServicePackageHealthReportExpiredEvent; diff --git a/lib/services/serviceFabric/lib/models/deployedServicePackageNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/deployedServicePackageNewHealthReportEvent.js new file mode 100644 index 0000000000..72a8a3eadb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/deployedServicePackageNewHealthReportEvent.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'); + +/** + * Deployed Service Health Report Created event. + * + * @extends models['ApplicationEvent'] + */ +class DeployedServicePackageNewHealthReportEvent extends models['ApplicationEvent'] { + /** + * Create a DeployedServicePackageNewHealthReportEvent. + * @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} 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 DeployedServicePackageNewHealthReportEvent + * + * @returns {object} metadata of DeployedServicePackageNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'DeployedServicePackageNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'DeployedServicePackageNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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' + } + }, + 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 = DeployedServicePackageNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/disableBackupDescription.js b/lib/services/serviceFabric/lib/models/disableBackupDescription.js new file mode 100644 index 0000000000..e101b66fa2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/disableBackupDescription.js @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * It describes the body parameters while disabling backup of a backup + * entity(Application/Service/Partition). + * + */ +class DisableBackupDescription { + /** + * Create a DisableBackupDescription. + * @member {boolean} cleanBackup Boolean flag to delete backups. It can be + * set to true for deleting all the backups which were created for the backup + * entity that is getting disabled for backup. + */ + constructor() { + } + + /** + * Defines the metadata of DisableBackupDescription + * + * @returns {object} metadata of DisableBackupDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'DisableBackupDescription', + type: { + name: 'Composite', + className: 'DisableBackupDescription', + modelProperties: { + cleanBackup: { + required: true, + serializedName: 'CleanBackup', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = DisableBackupDescription; diff --git a/lib/services/serviceFabric/lib/models/endpointRef.js b/lib/services/serviceFabric/lib/models/endpointRef.js new file mode 100644 index 0000000000..07697ba22c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/endpointRef.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 reference to a service endpoint. + * + */ +class EndpointRef { + /** + * Create a EndpointRef. + * @member {string} [name] Name of the endpoint. + */ + constructor() { + } + + /** + * Defines the metadata of EndpointRef + * + * @returns {object} metadata of EndpointRef + * + */ + mapper() { + return { + required: false, + serializedName: 'EndpointRef', + type: { + name: 'Composite', + className: 'EndpointRef', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EndpointRef; diff --git a/lib/services/serviceFabric/lib/models/fabricError.js b/lib/services/serviceFabric/lib/models/fabricError.js index cd678c7145..93b1c8e2f8 100644 --- a/lib/services/serviceFabric/lib/models/fabricError.js +++ b/lib/services/serviceFabric/lib/models/fabricError.js @@ -71,6 +71,7 @@ class FabricError { * - "FABRIC_E_BACKUP_NOT_ENABLED" * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" * * - Possible values of the error code for HTTP status code 409 (Conflict) * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" @@ -182,7 +183,7 @@ class FabricError { * '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' + * 'SerializationError', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' * @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 9a51254db6..b9ad963a3e 100644 --- a/lib/services/serviceFabric/lib/models/fabricErrorError.js +++ b/lib/services/serviceFabric/lib/models/fabricErrorError.js @@ -67,6 +67,7 @@ class FabricErrorError { * - "FABRIC_E_BACKUP_NOT_ENABLED" * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" * * - Possible values of the error code for HTTP status code 409 (Conflict) * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" @@ -178,7 +179,7 @@ class FabricErrorError { * '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' + * 'SerializationError', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' * @member {string} [message] Error message. */ constructor() { diff --git a/lib/services/serviceFabric/lib/models/fabricEvent.js b/lib/services/serviceFabric/lib/models/fabricEvent.js index 21f62dbe8d..6fb5f5530a 100644 --- a/lib/services/serviceFabric/lib/models/fabricEvent.js +++ b/lib/services/serviceFabric/lib/models/fabricEvent.js @@ -19,6 +19,7 @@ class FabricEvent { * Create a FabricEvent. * @member {uuid} eventInstanceId The identifier for the FabricEvent * instance. + * @member {string} [category] The category of event. * @member {date} timeStamp The time event was logged. * @member {boolean} [hasCorrelatedEvents] Shows there is existing related * events available. @@ -53,6 +54,13 @@ class FabricEvent { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/gatewayDestination.js b/lib/services/serviceFabric/lib/models/gatewayDestination.js new file mode 100644 index 0000000000..5190575a8f --- /dev/null +++ b/lib/services/serviceFabric/lib/models/gatewayDestination.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'; + +/** + * Describes destination endpoint for routing traffic. + * + */ +class GatewayDestination { + /** + * Create a GatewayDestination. + * @member {string} applicationName Name of the service fabric Mesh + * application. + * @member {string} serviceName service that contains the endpoint. + * @member {string} endpointName name of the endpoint in the service. + */ + constructor() { + } + + /** + * Defines the metadata of GatewayDestination + * + * @returns {object} metadata of GatewayDestination + * + */ + mapper() { + return { + required: false, + serializedName: 'GatewayDestination', + type: { + name: 'Composite', + className: 'GatewayDestination', + modelProperties: { + applicationName: { + required: true, + serializedName: 'applicationName', + type: { + name: 'String' + } + }, + serviceName: { + required: true, + serializedName: 'serviceName', + type: { + name: 'String' + } + }, + endpointName: { + required: true, + serializedName: 'endpointName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GatewayDestination; diff --git a/lib/services/serviceFabric/lib/models/gatewayResourceDescription.js b/lib/services/serviceFabric/lib/models/gatewayResourceDescription.js new file mode 100644 index 0000000000..f44d90e431 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/gatewayResourceDescription.js @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 gateway resource. + * + */ +class GatewayResourceDescription { + /** + * Create a GatewayResourceDescription. + * @member {string} name Name of the Gateway resource. + * @member {string} [description] User readable description of the gateway. + * @member {object} sourceNetwork Network the gateway should listen on for + * requests. + * @member {string} [sourceNetwork.name] Name of the network + * @member {array} [sourceNetwork.endpointRefs] A list of endpoints that are + * exposed on this network. + * @member {object} destinationNetwork Network that the Application is using. + * @member {string} [destinationNetwork.name] Name of the network + * @member {array} [destinationNetwork.endpointRefs] A list of endpoints that + * are exposed on this network. + * @member {array} [tcp] Configuration for tcp connectivity for this gateway. + * @member {array} [http] Configuration for http connectivity for this + * gateway. + * @member {string} [status] Status of the resource. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the gateway. + * @member {string} [ipAddress] IP address of the gateway. This is populated + * in the response and is ignored for incoming requests. + */ + constructor() { + } + + /** + * Defines the metadata of GatewayResourceDescription + * + * @returns {object} metadata of GatewayResourceDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'GatewayResourceDescription', + type: { + name: 'Composite', + className: 'GatewayResourceDescription', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + sourceNetwork: { + required: true, + serializedName: 'properties.sourceNetwork', + type: { + name: 'Composite', + className: 'NetworkRef' + } + }, + destinationNetwork: { + required: true, + serializedName: 'properties.destinationNetwork', + type: { + name: 'Composite', + className: 'NetworkRef' + } + }, + tcp: { + required: false, + serializedName: 'properties.tcp', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TcpConfigElementType', + type: { + name: 'Composite', + className: 'TcpConfig' + } + } + } + }, + http: { + required: false, + serializedName: 'properties.http', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HttpConfigElementType', + type: { + name: 'Composite', + className: 'HttpConfig' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'properties.statusDetails', + type: { + name: 'String' + } + }, + ipAddress: { + required: false, + readOnly: true, + serializedName: 'properties.ipAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GatewayResourceDescription; diff --git a/lib/services/serviceFabric/lib/models/healthInformation.js b/lib/services/serviceFabric/lib/models/healthInformation.js index 1b7c07718f..bad94b5121 100644 --- a/lib/services/serviceFabric/lib/models/healthInformation.js +++ b/lib/services/serviceFabric/lib/models/healthInformation.js @@ -75,7 +75,7 @@ class HealthInformation { * 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 + * This way, if the reporter has issues (e.g. 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. */ diff --git a/lib/services/serviceFabric/lib/models/httpConfig.js b/lib/services/serviceFabric/lib/models/httpConfig.js new file mode 100644 index 0000000000..43018529a5 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/httpConfig.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'; + +/** + * Describes the http configuration for external connectivity for this network. + * + */ +class HttpConfig { + /** + * Create a HttpConfig. + * @member {string} name http gateway config name. + * @member {number} port Specifies the port at which the service endpoint + * below needs to be exposed. + * @member {array} hosts description for routing. + */ + constructor() { + } + + /** + * Defines the metadata of HttpConfig + * + * @returns {object} metadata of HttpConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'HttpConfig', + type: { + name: 'Composite', + className: 'HttpConfig', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + port: { + required: true, + serializedName: 'port', + type: { + name: 'Number' + } + }, + hosts: { + required: true, + serializedName: 'hosts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HttpHostConfigElementType', + type: { + name: 'Composite', + className: 'HttpHostConfig' + } + } + } + } + } + } + }; + } +} + +module.exports = HttpConfig; diff --git a/lib/services/serviceFabric/lib/models/httpHostConfig.js b/lib/services/serviceFabric/lib/models/httpHostConfig.js new file mode 100644 index 0000000000..9a7f8756cd --- /dev/null +++ b/lib/services/serviceFabric/lib/models/httpHostConfig.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 the hostname properties for http routing. + * + */ +class HttpHostConfig { + /** + * Create a HttpHostConfig. + * @member {string} name http hostname config name. + * @member {array} routes Route information to use for routing. Routes are + * processed in the order they are specified. Specify routes that are more + * specific before routes that can hamdle general cases. + */ + constructor() { + } + + /** + * Defines the metadata of HttpHostConfig + * + * @returns {object} metadata of HttpHostConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'HttpHostConfig', + type: { + name: 'Composite', + className: 'HttpHostConfig', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + routes: { + required: true, + serializedName: 'routes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HttpRouteConfigElementType', + type: { + name: 'Composite', + className: 'HttpRouteConfig' + } + } + } + } + } + } + }; + } +} + +module.exports = HttpHostConfig; diff --git a/lib/services/serviceFabric/lib/models/httpRouteConfig.js b/lib/services/serviceFabric/lib/models/httpRouteConfig.js new file mode 100644 index 0000000000..8ebd708054 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/httpRouteConfig.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'; + +/** + * Describes the hostname properties for http routing. + * + */ +class HttpRouteConfig { + /** + * Create a HttpRouteConfig. + * @member {string} name http route name. + * @member {object} match Describes a rule for http route matching. + * @member {object} [match.path] Path to match for routing. + * @member {string} [match.path.value] Uri path to match for request. + * @member {string} [match.path.rewrite] replacement string for matched part + * of the Uri. + * @member {array} [match.headers] headers and their values to match in + * request. + * @member {object} destination Describes destination endpoint for routing + * traffic. + * @member {string} [destination.applicationName] Name of the service fabric + * Mesh application. + * @member {string} [destination.serviceName] service that contains the + * endpoint. + * @member {string} [destination.endpointName] name of the endpoint in the + * service. + */ + constructor() { + } + + /** + * Defines the metadata of HttpRouteConfig + * + * @returns {object} metadata of HttpRouteConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'HttpRouteConfig', + type: { + name: 'Composite', + className: 'HttpRouteConfig', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + match: { + required: true, + serializedName: 'match', + defaultValue: {}, + type: { + name: 'Composite', + className: 'HttpRouteMatchRule' + } + }, + destination: { + required: true, + serializedName: 'destination', + type: { + name: 'Composite', + className: 'GatewayDestination' + } + } + } + } + }; + } +} + +module.exports = HttpRouteConfig; diff --git a/lib/services/serviceFabric/lib/models/httpRouteMatchHeader.js b/lib/services/serviceFabric/lib/models/httpRouteMatchHeader.js new file mode 100644 index 0000000000..3596108399 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/httpRouteMatchHeader.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'; + +/** + * Describes header information for http route matching. + * + */ +class HttpRouteMatchHeader { + /** + * Create a HttpRouteMatchHeader. + * @member {string} name Name of header to match in request. + * @member {string} [value] Value of header to match in request. + * @member {string} [type] how to match header value. Possible values + * include: 'exact' + */ + constructor() { + } + + /** + * Defines the metadata of HttpRouteMatchHeader + * + * @returns {object} metadata of HttpRouteMatchHeader + * + */ + mapper() { + return { + required: false, + serializedName: 'HttpRouteMatchHeader', + type: { + name: 'Composite', + className: 'HttpRouteMatchHeader', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HttpRouteMatchHeader; diff --git a/lib/services/serviceFabric/lib/models/httpRouteMatchPath.js b/lib/services/serviceFabric/lib/models/httpRouteMatchPath.js new file mode 100644 index 0000000000..aaaa860d31 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/httpRouteMatchPath.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'; + +/** + * Path to match for routing. + * + */ +class HttpRouteMatchPath { + /** + * Create a HttpRouteMatchPath. + * @member {string} value Uri path to match for request. + * @member {string} [rewrite] replacement string for matched part of the Uri. + */ + constructor() { + } + + /** + * Defines the metadata of HttpRouteMatchPath + * + * @returns {object} metadata of HttpRouteMatchPath + * + */ + mapper() { + return { + required: false, + serializedName: 'HttpRouteMatchPath', + type: { + name: 'Composite', + className: 'HttpRouteMatchPath', + modelProperties: { + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + rewrite: { + required: false, + serializedName: 'rewrite', + type: { + name: 'String' + } + }, + type: { + required: true, + isConstant: true, + serializedName: 'type', + defaultValue: 'prefix', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HttpRouteMatchPath; diff --git a/lib/services/serviceFabric/lib/models/httpRouteMatchRule.js b/lib/services/serviceFabric/lib/models/httpRouteMatchRule.js new file mode 100644 index 0000000000..4d0d1ef04e --- /dev/null +++ b/lib/services/serviceFabric/lib/models/httpRouteMatchRule.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'; + +/** + * Describes a rule for http route matching. + * + */ +class HttpRouteMatchRule { + /** + * Create a HttpRouteMatchRule. + * @member {object} path Path to match for routing. + * @member {string} [path.value] Uri path to match for request. + * @member {string} [path.rewrite] replacement string for matched part of the + * Uri. + * @member {array} [headers] headers and their values to match in request. + */ + constructor() { + } + + /** + * Defines the metadata of HttpRouteMatchRule + * + * @returns {object} metadata of HttpRouteMatchRule + * + */ + mapper() { + return { + required: false, + serializedName: 'HttpRouteMatchRule', + type: { + name: 'Composite', + className: 'HttpRouteMatchRule', + modelProperties: { + path: { + required: true, + serializedName: 'path', + defaultValue: {}, + type: { + name: 'Composite', + className: 'HttpRouteMatchPath' + } + }, + headers: { + required: false, + serializedName: 'headers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HttpRouteMatchHeaderElementType', + type: { + name: 'Composite', + className: 'HttpRouteMatchHeader' + } + } + } + } + } + } + }; + } +} + +module.exports = HttpRouteMatchRule; diff --git a/lib/services/serviceFabric/lib/models/imageRegistryCredential.js b/lib/services/serviceFabric/lib/models/imageRegistryCredential.js index f4d7693a3c..560c81d519 100644 --- a/lib/services/serviceFabric/lib/models/imageRegistryCredential.js +++ b/lib/services/serviceFabric/lib/models/imageRegistryCredential.js @@ -20,7 +20,9 @@ class 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. + * @member {string} [password] The password for the private registry. The + * password is required for create or update operations, however it is not + * returned in the get or list operations. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/index.d.ts b/lib/services/serviceFabric/lib/models/index.d.ts index 4426c7a257..42ccdadbc8 100644 --- a/lib/services/serviceFabric/lib/models/index.d.ts +++ b/lib/services/serviceFabric/lib/models/index.d.ts @@ -13,196 +13,554 @@ import * as moment from "moment"; /** * @class - * Initializes a new instance of the AadMetadata class. + * Initializes a new instance of the FabricErrorError class. * @constructor - * Azure Active Directory metadata used for secured connection to cluster. + * Error object containing error code and error message. * - * @member {string} [authority] The AAD authority url. - * @member {string} [client] The AAD client application Id. - * @member {string} [cluster] The AAD cluster application Id. - * @member {string} [login] The AAD login url. - * @member {string} [redirect] The client application redirect address. - * @member {string} [tenant] The AAD tenant Id. - */ -export interface AadMetadata { - authority?: string; - client?: string; - cluster?: string; - login?: string; - redirect?: string; - tenant?: string; -} - -/** - * @class - * Initializes a new instance of the AadMetadataObject class. - * @constructor - * Azure Active Directory metadata object used for secured connection to - * cluster. + * @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. * - * @member {string} [type] The client authentication method. - * @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. - * @member {string} [metadata.login] The AAD login url. - * @member {string} [metadata.redirect] The client application redirect - * address. - * @member {string} [metadata.tenant] The AAD tenant Id. - */ -export interface AadMetadataObject { - type?: string; - metadata?: AadMetadata; -} - -/** - * @class - * Initializes a new instance of the AnalysisEventMetadata class. - * @constructor - * Metadata about an Analysis Event. + * - 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" * - * @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. + * - 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" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" * - * @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. + * - 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" * - * @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. + * - 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', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' + * @member {string} [message] Error message. */ -export interface ApplicationEvent extends FabricEvent { - applicationId: string; +export interface FabricErrorError { + code: string; + message?: string; } /** * @class - * Initializes a new instance of the EntityHealthState class. + * Initializes a new instance of the FabricError class. * @constructor - * A base type for the health state of various entities in the cluster. It - * contains the aggregated health state. + * 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. * - * @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; + * @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" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" + * + * - 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', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' + * @member {string} [error.message] Error message. + */ +export interface FabricError { + error: FabricErrorError; } /** * @class - * Initializes a new instance of the ServiceHealthState class. + * Initializes a new instance of the ContainerLogs class. * @constructor - * Represents the health state of a service, which contains the service - * identifier and its aggregated health state. + * Container logs. * - * @member {string} [serviceName] Name of the service whose health state is - * represented by this object. + * @member {string} [content] Container logs. */ -export interface ServiceHealthState extends EntityHealthState { - serviceName?: string; +export interface ContainerLogs { + content?: string; } /** * @class - * Initializes a new instance of the DeployedApplicationHealthState class. + * Initializes a new instance of the AadMetadata class. * @constructor - * Represents the health state of a deployed application, which contains the - * entity identifier and the aggregated health state. + * Azure Active Directory metadata used for secured connection to cluster. * - * @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} [authority] The AAD authority url. + * @member {string} [client] The AAD client application Id. + * @member {string} [cluster] The AAD cluster application Id. + * @member {string} [login] The AAD login url. + * @member {string} [redirect] The client application redirect address. + * @member {string} [tenant] The AAD tenant Id. */ -export interface DeployedApplicationHealthState extends EntityHealthState { - nodeName?: string; - applicationName?: string; +export interface AadMetadata { + authority?: string; + client?: string; + cluster?: string; + login?: string; + redirect?: string; + tenant?: string; } /** * @class - * Initializes a new instance of the EntityHealth class. + * Initializes a new instance of the AadMetadataObject class. * @constructor - * Health information common to all entities in the cluster. It contains the - * aggregated health state, health events and unhealthy evaluation. + * Azure Active Directory metadata object used for secured connection to + * cluster. * - * @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] 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. + * @member {string} [type] The client authentication method. + * @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. + * @member {string} [metadata.login] The AAD login url. + * @member {string} [metadata.redirect] The client application redirect + * address. + * @member {string} [metadata.tenant] The AAD tenant Id. */ -export interface EntityHealth { - aggregatedHealthState?: string; - healthEvents?: HealthEvent[]; - unhealthyEvaluations?: HealthEvaluationWrapper[]; - healthStatistics?: HealthStatistics; +export interface AadMetadataObject { + type?: string; + metadata?: AadMetadata; } /** * @class - * Initializes a new instance of the ApplicationHealth class. + * Initializes a new instance of the AnalysisEventMetadata class. * @constructor - * Represents the health of the application. Contains the application - * aggregated health state and the service and deployed application health - * states. + * Metadata about an Analysis Event. * - * @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 - * health states as found in the health store. + * @member {moment.duration} [delay] The analysis delay. + * @member {moment.duration} [duration] The duration of analysis. */ -export interface ApplicationHealth extends EntityHealth { - name?: string; - serviceHealthStates?: ServiceHealthState[]; - deployedApplicationHealthStates?: DeployedApplicationHealthState[]; +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 {string} [category] The category of event. + * @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; + category?: 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. + * @constructor + * A base type for the health state of various entities in the cluster. It + * contains the aggregated health state. + * + * @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; +} + +/** + * @class + * Initializes a new instance of the ServiceHealthState class. + * @constructor + * Represents the health state of a service, which contains the service + * identifier and its aggregated health state. + * + * @member {string} [serviceName] Name of the service whose health state is + * represented by this object. + */ +export interface ServiceHealthState extends EntityHealthState { + serviceName?: string; +} + +/** + * @class + * Initializes a new instance of the DeployedApplicationHealthState class. + * @constructor + * Represents the health state of a deployed application, which contains the + * entity identifier and the aggregated health state. + * + * @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; + applicationName?: string; +} + +/** + * @class + * Initializes a new instance of the EntityHealth class. + * @constructor + * Health information common to all entities in the cluster. It contains the + * aggregated health state, health events and unhealthy evaluation. + * + * @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] 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. + */ +export interface EntityHealth { + aggregatedHealthState?: string; + healthEvents?: HealthEvent[]; + unhealthyEvaluations?: HealthEvaluationWrapper[]; + healthStatistics?: HealthStatistics; +} + +/** + * @class + * Initializes a new instance of the ApplicationHealth class. + * @constructor + * Represents the health of the application. Contains the application + * aggregated health state and the service and deployed application health + * states. + * + * @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 + * health states as found in the health store. + */ +export interface ApplicationHealth extends EntityHealth { + name?: string; + serviceHealthStates?: ServiceHealthState[]; + deployedApplicationHealthStates?: DeployedApplicationHealthState[]; } /** @@ -2432,6 +2790,18 @@ export interface ClusterManifest { manifest?: string; } +/** + * @class + * Initializes a new instance of the ClusterVersion class. + * @constructor + * The cluster version. + * + * @member {string} [version] The Service Fabric cluster runtime version. + */ +export interface ClusterVersion { + version?: string; +} + /** * @class * Initializes a new instance of the ContainerApiRequestBody class. @@ -2939,7 +3309,7 @@ export interface DeployedStatelessServiceInstanceInfo extends DeployedServiceRep * 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 + * This way, if the reporter has issues (e.g. 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. */ @@ -3099,29 +3469,6 @@ 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. @@ -3211,642 +3558,300 @@ export interface FabricConfigVersionInfo { /** * @class - * Initializes a new instance of the FabricErrorError class. + * Initializes a new instance of the ClusterConfigurationUpgradeStatusInfo class. * @constructor - * Error object containing error code and error message. - * - * @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. + * Information about a standalone cluster configuration upgrade status. * - * - 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" + * @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. + */ +export interface ClusterConfigurationUpgradeStatusInfo { + upgradeState?: string; + progressStatus?: number; + configVersion?: string; + details?: string; +} + +/** + * @class + * Initializes a new instance of the PartitionInformation class. + * @constructor + * Information about the partition identity, partitioning scheme and keys + * supported by it. * - * - 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" + * @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 { + id?: string; + servicePartitionKind: string; +} + +/** + * @class + * Initializes a new instance of the Int64RangePartitionInformation class. + * @constructor + * Describes the partition information for the integer range that is based on + * partition schemes. * - * - 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" + * @member {string} [lowKey] Specifies the minimum key value handled by this + * partition. + * @member {string} [highKey] Specifies the maximum key value handled by this + * partition. + */ +export interface Int64RangePartitionInformation extends PartitionInformation { + lowKey?: string; + highKey?: string; +} + +/** + * @class + * Initializes a new instance of the NamedPartitionInformation class. + * @constructor + * Describes the partition information for the name as a string that is based + * on partition schemes. * - * - Possible values of the error code for HTTP status code 413 (Request Entity - * Too Large) - * - "FABRIC_E_VALUE_TOO_LARGE" + * @member {string} [name] Name of the partition. + */ +export interface NamedPartitionInformation extends PartitionInformation { + name?: string; +} + +/** + * @class + * Initializes a new instance of the NodeDeactivationTaskId class. + * @constructor + * Identity of the task related to deactivation operation on the node. * - * - 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" + * @member {string} [id] Value of the task id. + * @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; + nodeDeactivationTaskType?: string; +} + +/** + * @class + * Initializes a new instance of the NodeDeactivationTask class. + * @constructor + * The task representing the deactivation operation on the node. * - * - 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" + * @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] 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; + nodeDeactivationIntent?: string; +} + +/** + * @class + * Initializes a new instance of the NodeDeactivationInfo class. + * @constructor + * Information about the node deactivation. This information is valid for a + * node that is undergoing deactivation or has already been deactivated. * - * - 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} [message] Error message. + * @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 FabricErrorError { - code: string; - message?: string; +export interface NodeDeactivationInfo { + nodeDeactivationIntent?: string; + nodeDeactivationStatus?: string; + nodeDeactivationTask?: NodeDeactivationTask[]; + pendingSafetyChecks?: SafetyCheckWrapper[]; } /** * @class - * Initializes a new instance of the FabricError class. + * Initializes a new instance of the NodeEvent class. * @constructor - * 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. + * Represents the base for all Node Events. * - * @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. + * @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. * - * - 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" + * @member {string} [name] Name of the node whose health information is + * described by this object. + */ +export interface NodeHealth extends EntityHealth { + name?: string; +} + +/** + * @class + * Initializes a new instance of the NodeHealthEvaluation class. + * @constructor + * Represents health evaluation for a node, containing information about the + * data and the algorithm used by health store to evaluate health. The + * evaluation is returned only when the aggregated health state is either Error + * or Warning. * - * - 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} [error.message] Error message. + * @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 FabricError { - error: FabricErrorError; +export interface NodeHealthEvaluation extends HealthEvaluation { + nodeName?: string; + unhealthyEvaluations?: HealthEvaluationWrapper[]; } /** * @class - * Initializes a new instance of the ClusterConfigurationUpgradeStatusInfo class. + * Initializes a new instance of the NodeInfo class. * @constructor - * Information about a standalone cluster configuration upgrade status. + * Information about a node in Service Fabric cluster. * - * @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. + * @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. + * @member {string} [codeVersion] The version of Service Fabric binaries that + * the node is running. + * @member {string} [configVersion] The version of Service Fabric cluster + * manifest that the node is using. + * @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 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] 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 + * remains same across restarts, the InstanceId changes every time node + * restarts. + * @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. + * @member {string} [nodeDownTimeInSeconds] Time in seconds since the node has + * been in NodeStatus Down. Value zero indicates node is not NodeStatus Down. + * @member {date} [nodeUpAt] Date time in UTC when the node came up. If the + * node has never been up then this value will be zero date time. + * @member {date} [nodeDownAt] Date time in UTC when the node went down. If + * node has never been down then this value will be zero date time. */ -export interface ClusterConfigurationUpgradeStatusInfo { - upgradeState?: string; - progressStatus?: number; +export interface NodeInfo { + name?: string; + ipAddressOrFQDN?: string; + type?: string; + codeVersion?: string; configVersion?: string; - details?: string; + nodeStatus?: string; + nodeUpTimeInSeconds?: string; + healthState?: string; + isSeedNode?: boolean; + upgradeDomain?: string; + faultDomain?: string; + id?: NodeId; + instanceId?: string; + nodeDeactivationInfo?: NodeDeactivationInfo; + isStopped?: boolean; + nodeDownTimeInSeconds?: string; + nodeUpAt?: Date; + nodeDownAt?: Date; } /** * @class - * Initializes a new instance of the PartitionInformation class. + * Initializes a new instance of the NodeLoadMetricInformation class. * @constructor - * Information about the partition identity, partitioning scheme and keys - * supported by it. + * Represents data structure that contains load information for a certain + * metric on a node. * - * @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 + * @member {string} [name] Name of the metric for which this load information + * is provided. + * @member {string} [nodeCapacity] Total capacity on the node for this metric. + * @member {string} [nodeLoad] Current load on the node for this metric. + * @member {string} [nodeRemainingCapacity] The remaining capacity on the node + * for this metric. + * @member {boolean} [isCapacityViolation] Indicates if there is a capacity + * violation for this metric on the node. + * @member {string} [nodeBufferedCapacity] The value that indicates the + * reserved capacity for this metric on the node. + * @member {string} [nodeRemainingBufferedCapacity] The remaining reserved + * capacity for this metric on the node. */ -export interface PartitionInformation { - id?: string; - servicePartitionKind: string; +export interface NodeLoadMetricInformation { + name?: string; + nodeCapacity?: string; + nodeLoad?: string; + nodeRemainingCapacity?: string; + isCapacityViolation?: boolean; + nodeBufferedCapacity?: string; + nodeRemainingBufferedCapacity?: string; } /** * @class - * Initializes a new instance of the Int64RangePartitionInformation class. + * Initializes a new instance of the NodeLoadInfo class. * @constructor - * Describes the partition information for the integer range that is based on - * partition schemes. + * Information about load on a Service Fabric node. It holds a summary of all + * metrics and their load on a node. * - * @member {string} [lowKey] Specifies the minimum key value handled by this - * partition. - * @member {string} [highKey] Specifies the maximum key value handled by this - * partition. - */ -export interface Int64RangePartitionInformation extends PartitionInformation { - lowKey?: string; - highKey?: string; -} - -/** - * @class - * Initializes a new instance of the NamedPartitionInformation class. - * @constructor - * Describes the partition information for the name as a string that is based - * on partition schemes. - * - * @member {string} [name] Name of the partition. - */ -export interface NamedPartitionInformation extends PartitionInformation { - name?: string; -} - -/** - * @class - * Initializes a new instance of the NodeDeactivationTaskId class. - * @constructor - * Identity of the task related to deactivation operation on the node. - * - * @member {string} [id] Value of the task id. - * @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; - nodeDeactivationTaskType?: string; -} - -/** - * @class - * Initializes a new instance of the NodeDeactivationTask class. - * @constructor - * The task representing the deactivation operation on the node. - * - * @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] 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; - nodeDeactivationIntent?: string; -} - -/** - * @class - * Initializes a new instance of the NodeDeactivationInfo class. - * @constructor - * Information about the node deactivation. This information is valid for a - * node that is undergoing deactivation or has already been deactivated. - * - * @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; - nodeDeactivationStatus?: string; - nodeDeactivationTask?: NodeDeactivationTask[]; - 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] Name of the node whose health information is - * described by this object. - */ -export interface NodeHealth extends EntityHealth { - name?: string; -} - -/** - * @class - * Initializes a new instance of the NodeHealthEvaluation class. - * @constructor - * Represents health evaluation for a node, containing information about the - * data and the algorithm used by health store to evaluate health. The - * evaluation is returned only when the aggregated health state is either Error - * or Warning. - * - * @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; - unhealthyEvaluations?: HealthEvaluationWrapper[]; -} - -/** - * @class - * Initializes a new instance of the NodeInfo class. - * @constructor - * Information about a node in Service Fabric cluster. - * - * @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. - * @member {string} [codeVersion] The version of Service Fabric binaries that - * the node is running. - * @member {string} [configVersion] The version of Service Fabric cluster - * manifest that the node is using. - * @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 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] 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 - * remains same across restarts, the InstanceId changes every time node - * restarts. - * @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. - * @member {string} [nodeDownTimeInSeconds] Time in seconds since the node has - * been in NodeStatus Down. Value zero indicates node is not NodeStatus Down. - * @member {date} [nodeUpAt] Date time in UTC when the node came up. If the - * node has never been up then this value will be zero date time. - * @member {date} [nodeDownAt] Date time in UTC when the node went down. If - * node has never been down then this value will be zero date time. - */ -export interface NodeInfo { - name?: string; - ipAddressOrFQDN?: string; - type?: string; - codeVersion?: string; - configVersion?: string; - nodeStatus?: string; - nodeUpTimeInSeconds?: string; - healthState?: string; - isSeedNode?: boolean; - upgradeDomain?: string; - faultDomain?: string; - id?: NodeId; - instanceId?: string; - nodeDeactivationInfo?: NodeDeactivationInfo; - isStopped?: boolean; - nodeDownTimeInSeconds?: string; - nodeUpAt?: Date; - nodeDownAt?: Date; -} - -/** - * @class - * Initializes a new instance of the NodeLoadMetricInformation class. - * @constructor - * Represents data structure that contains load information for a certain - * metric on a node. - * - * @member {string} [name] Name of the metric for which this load information - * is provided. - * @member {string} [nodeCapacity] Total capacity on the node for this metric. - * @member {string} [nodeLoad] Current load on the node for this metric. - * @member {string} [nodeRemainingCapacity] The remaining capacity on the node - * for this metric. - * @member {boolean} [isCapacityViolation] Indicates if there is a capacity - * violation for this metric on the node. - * @member {string} [nodeBufferedCapacity] The value that indicates the - * reserved capacity for this metric on the node. - * @member {string} [nodeRemainingBufferedCapacity] The remaining reserved - * capacity for this metric on the node. - */ -export interface NodeLoadMetricInformation { - name?: string; - nodeCapacity?: string; - nodeLoad?: string; - nodeRemainingCapacity?: string; - isCapacityViolation?: boolean; - nodeBufferedCapacity?: string; - nodeRemainingBufferedCapacity?: string; -} - -/** - * @class - * Initializes a new instance of the NodeLoadInfo class. - * @constructor - * Information about load on a Service Fabric node. It holds a summary of all - * metrics and their load on a node. - * - * @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. + * @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. */ export interface NodeLoadInfo { nodeName?: string; @@ -5300,26 +5305,25 @@ 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] 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 + * @member {object} [primaryEpoch] 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} [primaryEpoch.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. - * @member {string} [currentConfigurationEpoch.dataLossVersion] 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} [primaryEpoch.dataLossVersion] 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 StatefulServicePartitionInfo extends ServicePartitionInfo { targetReplicaSetSize?: number; minReplicaSetSize?: number; lastQuorumLossDuration?: moment.Duration; - currentConfigurationEpoch?: Epoch; + primaryEpoch?: Epoch; } /** @@ -5583,12 +5587,15 @@ export interface WaitForReconfigurationSafetyCheck extends PartitionSafetyCheck * @member {date} [lastReportedUtc] Gets the UTC time when the load was * reported. * @member {string} [name] The name of the load metric. - * @member {string} [value] The value of the load metric. + * @member {string} [value] The value of the load metric. In future releases of + * Service Fabric this parameter will be deprecated in favor of CurrentValue. + * @member {string} [currentValue] The value of the load metric. */ export interface LoadMetricReport { lastReportedUtc?: Date; name?: string; value?: string; + currentValue?: string; } /** @@ -6064,15 +6071,20 @@ export interface ClusterUpgradeProgressObject { * @constructor * Describes the parameters for a standalone cluster configuration upgrade. * - * @member {string} clusterConfig The cluster configuration. + * @member {string} clusterConfig The cluster configuration as a JSON string. + * For example, [this + * file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) + * contains JSON describing the [nodes and other properties of the + * cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest). * @member {moment.duration} [healthCheckRetryTimeout] The length of time - * between attempts to perform a health checks if the application or cluster is + * between attempts to perform health checks if the application or cluster is * not healthy. Default value: moment.duration('PT0H0M0S') . * @member {moment.duration} [healthCheckWaitDurationInSeconds] The length of * time to wait after completing an upgrade domain before starting the health * checks process. Default value: moment.duration('PT0H0M0S') . * @member {moment.duration} [healthCheckStableDurationInSeconds] The length of - * time that the application or cluster must remain healthy. Default value: + * time that the application or cluster must remain healthy before the upgrade + * proceeds to the next upgrade domain. Default value: * moment.duration('PT0H0M0S') . * @member {moment.duration} [upgradeDomainTimeoutInSeconds] The timeout for * the upgrade domain. Default value: moment.duration('PT0H0M0S') . @@ -7857,1662 +7869,2727 @@ export interface ComposeDeploymentUpgradeProgressInfo { /** * @class - * Initializes a new instance of the PagedComposeDeploymentStatusInfoList class. + * Initializes a new instance of the PagedComposeDeploymentStatusInfoList class. + * @constructor + * 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 + * 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 compose deployment status information. + */ +export interface PagedComposeDeploymentStatusInfoList { + continuationToken?: string; + items?: ComposeDeploymentStatusInfo[]; +} + +/** + * @class + * Initializes a new instance of the CreateComposeDeploymentDescription class. + * @constructor + * Defines description for creating a Service Fabric compose deployment. + * + * @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] 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. + */ +export interface CreateComposeDeploymentDescription { + deploymentName: string; + composeFileContent: string; + registryCredential?: RegistryCredential; +} + +/** + * @class + * Initializes a new instance of the DeployedServicePackageInfo class. + * @constructor + * Information about service package deployed on a Service Fabric node. + * + * @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] 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; + version?: string; + status?: string; + servicePackageActivationId?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceCorrelationDescription class. + * @constructor + * Creates a particular correlation between services. + * + * @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 PartitionSchemeDescription class. + * @constructor + * Describes how the service is partitioned. + * + * @member {string} partitionScheme Polymorphic Discriminator + */ +export interface PartitionSchemeDescription { + partitionScheme: string; +} + +/** + * @class + * Initializes a new instance of the NamedPartitionSchemeDescription class. + * @constructor + * Describes the named partition scheme of the service. + * + * @member {number} count The number of partitions. + * @member {array} names Array of size specified by the ‘Count’ parameter, for + * the names of the partitions. + */ +export interface NamedPartitionSchemeDescription extends PartitionSchemeDescription { + count: number; + names: string[]; +} + +/** + * @class + * Initializes a new instance of the SingletonPartitionSchemeDescription class. + * @constructor + * Describes the partition scheme of a singleton-partitioned, or + * non-partitioned service. + * + */ +export interface SingletonPartitionSchemeDescription extends PartitionSchemeDescription { +} + +/** + * @class + * Initializes a new instance of the UniformInt64RangePartitionSchemeDescription class. + * @constructor + * Describes a partitioning scheme where an integer range is allocated evenly + * across a number of partitions. + * + * @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 partitions. + * @member {string} highKey String indicating the upper bound of the partition + * key range that + * should be split between the partitions. + */ +export interface UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { + count: number; + lowKey: string; + 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. + * @constructor + * A ServiceDescription contains all of the information necessary to create a + * service. + * + * @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 + * 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] 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] 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 { + applicationName?: string; + serviceName: string; + serviceTypeName: string; + initializationData?: number[]; + partitionDescription: PartitionSchemeDescription; + placementConstraints?: string; + correlationScheme?: ServiceCorrelationDescription[]; + serviceLoadMetrics?: ServiceLoadMetricDescription[]; + servicePlacementPolicies?: ServicePlacementPolicyDescription[]; + defaultMoveCost?: string; + isDefaultMoveCostSpecified?: boolean; + servicePackageActivationMode?: string; + serviceDnsName?: string; + scalingPolicies?: ScalingPolicyDescription[]; + serviceKind: string; +} + +/** + * @class + * Initializes a new instance of the StatefulServiceDescription class. + * @constructor + * Describes a stateful service. + * + * @member {number} targetReplicaSetSize The target replica set size as a + * number. + * @member {number} minReplicaSetSize The minimum replica set size as a number. + * @member {boolean} hasPersistedState A flag indicating whether this is a + * persistent service which stores states on the local disk. If it is then the + * value of this property is true, if not it is false. + * @member {number} [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 + * QuorumLossWaitDuration (2) and StandByReplicaKeepDuration(4) are set. + * + * - None - Does not indicate any other properties are set. The value is zero. + * - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration + * property is set. The value is 1. + * - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is + * set. The value is 2. + * - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration + * property is set. The value is 4. + * @member {number} [replicaRestartWaitDurationSeconds] The duration, in + * seconds, between when a replica goes down and when a new replica is created. + * @member {number} [quorumLossWaitDurationSeconds] The maximum duration, in + * seconds, for which a partition is allowed to be in a state of quorum loss. + * @member {number} [standByReplicaKeepDurationSeconds] The definition on how + * long StandBy replicas should be maintained before being removed. + */ +export interface StatefulServiceDescription extends ServiceDescription { + targetReplicaSetSize: number; + minReplicaSetSize: number; + hasPersistedState: boolean; + flags?: number; + replicaRestartWaitDurationSeconds?: number; + quorumLossWaitDurationSeconds?: number; + standByReplicaKeepDurationSeconds?: number; +} + +/** + * @class + * Initializes a new instance of the StatelessServiceDescription class. + * @constructor + * Describes a stateless service. + * + * @member {number} instanceCount The instance count. + */ +export interface StatelessServiceDescription extends ServiceDescription { + instanceCount: number; +} + +/** + * @class + * Initializes a new instance of the ReplicatorQueueStatus class. + * @constructor + * Provides various statistics of the queue used in the service fabric + * replicator. + * Contains information about the service fabric replicator like the + * replication/copy queue utilization, last acknowledgement received timestamp, + * etc. + * 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. + * @member {string} [queueMemorySize] Represents the virtual memory consumed by + * the queue in bytes. + * @member {string} [firstSequenceNumber] On a primary replicator, this is + * semantically the sequence number of the operation for which all the + * secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is the smallest sequence number of the + * operation that is present in the queue. + * @member {string} [completedSequenceNumber] On a primary replicator, this is + * semantically the highest sequence number of the operation for which all the + * secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * that has been applied to the persistent state. + * @member {string} [committedSequenceNumber] On a primary replicator, this is + * semantically the highest sequence number of the operation for which a write + * quorum of the secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * of the in-order operation received from the primary. + * @member {string} [lastSequenceNumber] Represents the latest sequence number + * of the operation that is available in the queue. + */ +export interface ReplicatorQueueStatus { + queueUtilizationPercentage?: number; + queueMemorySize?: string; + firstSequenceNumber?: string; + completedSequenceNumber?: string; + committedSequenceNumber?: string; + lastSequenceNumber?: string; +} + +/** + * @class + * Initializes a new instance of the ReplicatorStatus class. + * @constructor + * 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} kind Polymorphic Discriminator + */ +export interface ReplicatorStatus { + kind: string; +} + +/** + * @class + * Initializes a new instance of the RemoteReplicatorAcknowledgementDetail class. + * @constructor + * Provides various statistics of the acknowledgements that are being received + * from the remote replicator. + * + * @member {string} [averageReceiveDuration] Represents the average duration it + * takes for the remote replicator to receive an operation. + * @member {string} [averageApplyDuration] Represents the average duration it + * takes for the remote replicator to apply an operation. This usually entails + * writing the operation to disk. + * @member {string} [notReceivedCount] Represents the number of operations not + * yet received by a remote replicator. + * @member {string} [receivedAndNotAppliedCount] Represents the number of + * operations received and not yet applied by a remote replicator. + */ +export interface RemoteReplicatorAcknowledgementDetail { + averageReceiveDuration?: string; + averageApplyDuration?: string; + notReceivedCount?: string; + receivedAndNotAppliedCount?: string; +} + +/** + * @class + * Initializes a new instance of the RemoteReplicatorAcknowledgementStatus class. + * @constructor + * Provides details about the remote replicators from the primary replicator's + * point of view. + * + * @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 + * operation. + * @member {string} + * [replicationStreamAcknowledgementDetail.averageApplyDuration] Represents the + * average duration it takes for the remote replicator to apply an operation. + * This usually entails writing the operation to disk. + * @member {string} [replicationStreamAcknowledgementDetail.notReceivedCount] + * Represents the number of operations not yet received by a remote replicator. + * @member {string} + * [replicationStreamAcknowledgementDetail.receivedAndNotAppliedCount] + * Represents the number of operations received and not yet applied by a remote + * replicator. + * @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. + * @member {string} [copyStreamAcknowledgementDetail.averageApplyDuration] + * Represents the average duration it takes for the remote replicator to apply + * an operation. This usually entails writing the operation to disk. + * @member {string} [copyStreamAcknowledgementDetail.notReceivedCount] + * Represents the number of operations not yet received by a remote replicator. + * @member {string} + * [copyStreamAcknowledgementDetail.receivedAndNotAppliedCount] Represents the + * number of operations received and not yet applied by a remote replicator. + */ +export interface RemoteReplicatorAcknowledgementStatus { + replicationStreamAcknowledgementDetail?: RemoteReplicatorAcknowledgementDetail; + copyStreamAcknowledgementDetail?: RemoteReplicatorAcknowledgementDetail; +} + +/** + * @class + * Initializes a new instance of the RemoteReplicatorStatus class. + * @constructor + * Represents the state of the secondary replicator from the primary + * replicator’s point of view. + * + * @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. + * UTC 0 represents an invalid value, indicating that no acknowledgement + * messages were ever processed. + * @member {string} [lastReceivedReplicationSequenceNumber] The highest + * replication operation sequence number that the secondary has received from + * the primary. + * @member {string} [lastAppliedReplicationSequenceNumber] The highest + * replication operation sequence number that the secondary has applied to its + * state. + * @member {boolean} [isInBuild] A value that indicates whether the secondary + * replica is in the process of being built. + * @member {string} [lastReceivedCopySequenceNumber] The highest copy operation + * sequence number that the secondary has received from the primary. + * A value of -1 implies that the secondary has received all copy operations. + * @member {string} [lastAppliedCopySequenceNumber] The highest copy 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] 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 + * receive an operation. + * @member {string} + * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.averageApplyDuration] + * Represents the average duration it takes for the remote replicator to apply + * an operation. This usually entails writing the operation to disk. + * @member {string} + * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.notReceivedCount] + * Represents the number of operations not yet received by a remote replicator. + * @member {string} + * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.receivedAndNotAppliedCount] + * Represents the number of operations received and not yet applied by a 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 + * receive an operation. + * @member {string} + * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.averageApplyDuration] + * Represents the average duration it takes for the remote replicator to apply + * an operation. This usually entails writing the operation to disk. + * @member {string} + * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.notReceivedCount] + * Represents the number of operations not yet received by a remote replicator. + * @member {string} + * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.receivedAndNotAppliedCount] + * Represents the number of operations received and not yet applied by a remote + * replicator. + */ +export interface RemoteReplicatorStatus { + replicaId?: string; + lastAcknowledgementProcessedTimeUtc?: Date; + lastReceivedReplicationSequenceNumber?: string; + lastAppliedReplicationSequenceNumber?: string; + isInBuild?: boolean; + lastReceivedCopySequenceNumber?: string; + lastAppliedCopySequenceNumber?: string; + remoteReplicatorAcknowledgementStatus?: RemoteReplicatorAcknowledgementStatus; +} + +/** + * @class + * Initializes a new instance of the PrimaryReplicatorStatus class. + * @constructor + * 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. + * @member {string} [replicationQueueStatus.queueMemorySize] Represents the + * virtual memory consumed by the queue in bytes. + * @member {string} [replicationQueueStatus.firstSequenceNumber] On a primary + * replicator, this is semantically the sequence number of the operation for + * which all the secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is the smallest sequence number of the + * operation that is present in the queue. + * @member {string} [replicationQueueStatus.completedSequenceNumber] On a + * primary replicator, this is semantically the highest sequence number of the + * operation for which all the secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * that has been applied to the persistent state. + * @member {string} [replicationQueueStatus.committedSequenceNumber] On a + * primary replicator, this is semantically the highest sequence number of the + * operation for which a write quorum of the secondary replicas have sent an + * acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * 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] The status of all the active and idle + * secondary replicators that the primary is aware of. + */ +export interface PrimaryReplicatorStatus extends ReplicatorStatus { + replicationQueueStatus?: ReplicatorQueueStatus; + remoteReplicators?: RemoteReplicatorStatus[]; +} + +/** + * @class + * Initializes a new instance of the SecondaryReplicatorStatus class. + * @constructor + * 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. + * @member {string} [replicationQueueStatus.queueMemorySize] Represents the + * virtual memory consumed by the queue in bytes. + * @member {string} [replicationQueueStatus.firstSequenceNumber] On a primary + * replicator, this is semantically the sequence number of the operation for + * which all the secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is the smallest sequence number of the + * operation that is present in the queue. + * @member {string} [replicationQueueStatus.completedSequenceNumber] On a + * primary replicator, this is semantically the highest sequence number of the + * operation for which all the secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * that has been applied to the persistent state. + * @member {string} [replicationQueueStatus.committedSequenceNumber] On a + * primary replicator, this is semantically the highest sequence number of the + * operation for which a write quorum of the secondary replicas have sent an + * acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * 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 {date} [lastReplicationOperationReceivedTimeUtc] The last time-stamp + * (UTC) at which a replication operation was received from the primary. + * UTC 0 represents an invalid value, indicating that a replication operation + * message was never received. + * @member {boolean} [isInBuild] Value that indicates whether the replica is + * currently being built. + * @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. + * @member {string} [copyQueueStatus.queueMemorySize] Represents the virtual + * memory consumed by the queue in bytes. + * @member {string} [copyQueueStatus.firstSequenceNumber] On a primary + * replicator, this is semantically the sequence number of the operation for + * which all the secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is the smallest sequence number of the + * operation that is present in the queue. + * @member {string} [copyQueueStatus.completedSequenceNumber] On a primary + * replicator, this is semantically the highest sequence number of the + * operation for which all the secondary replicas have sent an acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * that has been applied to the persistent state. + * @member {string} [copyQueueStatus.committedSequenceNumber] On a primary + * replicator, this is semantically the highest sequence number of the + * operation for which a write quorum of the secondary replicas have sent an + * acknowledgement. + * On a secondary replicator, this is semantically the highest sequence number + * of the in-order operation received from the primary. + * @member {string} [copyQueueStatus.lastSequenceNumber] Represents the latest + * sequence number of the operation that is available in the queue. + * @member {date} [lastCopyOperationReceivedTimeUtc] The last time-stamp (UTC) + * at which a copy operation was received from the primary. + * UTC 0 represents an invalid value, indicating that a copy operation message + * was never received. + * @member {date} [lastAcknowledgementSentTimeUtc] The last time-stamp (UTC) at + * which an acknowledgment was sent to the primary replicator. + * UTC 0 represents an invalid value, indicating that an acknowledgment message + * was never sent. + */ +export interface SecondaryReplicatorStatus extends ReplicatorStatus { + replicationQueueStatus?: ReplicatorQueueStatus; + lastReplicationOperationReceivedTimeUtc?: Date; + isInBuild?: boolean; + copyQueueStatus?: ReplicatorQueueStatus; + lastCopyOperationReceivedTimeUtc?: Date; + lastAcknowledgementSentTimeUtc?: Date; +} + +/** + * @class + * Initializes a new instance of the SecondaryActiveReplicatorStatus class. + * @constructor + * Status of the secondary replicator when it is in active mode and is part of + * the replica set. + * + */ +export interface SecondaryActiveReplicatorStatus extends SecondaryReplicatorStatus { +} + +/** + * @class + * Initializes a new instance of the SecondaryIdleReplicatorStatus class. + * @constructor + * Status of the secondary replicator when it is in idle mode and is being + * built by the primary. + * + */ +export interface SecondaryIdleReplicatorStatus extends SecondaryReplicatorStatus { +} + +/** + * @class + * Initializes a new instance of the LoadMetricReportInfo class. + * @constructor + * Information about load reported by replica. + * + * @member {string} [name] The name of the metric. + * @member {number} [value] The value of the load for the metric. In future + * releases of Service Fabric this parameter will be deprecated in favor of + * CurrentValue. + * @member {string} [currentValue] The double value of the load for the metric. + * @member {date} [lastReportedUtc] The UTC time when the load is reported. + */ +export interface LoadMetricReportInfo { + name?: string; + value?: number; + currentValue?: string; + lastReportedUtc?: Date; +} + +/** + * @class + * Initializes a new instance of the DeployedServiceReplicaDetailInfo class. + * @constructor + * Information about a Service Fabric service replica deployed on a node. + * + * @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] List of load reported by replica. + * @member {string} serviceKind Polymorphic Discriminator + */ +export interface DeployedServiceReplicaDetailInfo { + serviceName?: string; + partitionId?: string; + currentServiceOperation?: string; + currentServiceOperationStartTimeUtc?: Date; + reportedLoad?: LoadMetricReportInfo[]; + serviceKind: string; +} + +/** + * @class + * Initializes a new instance of the ReplicaStatusBase class. + * @constructor + * Information about the replica. + * + * @member {string} kind Polymorphic Discriminator + */ +export interface ReplicaStatusBase { + kind: string; +} + +/** + * @class + * Initializes a new instance of the KeyValueStoreReplicaStatus class. + * @constructor + * Key value store related information for the replica. + * + * @member {string} [databaseRowCountEstimate] Value indicating the estimated + * number of rows in the underlying database. + * @member {string} [databaseLogicalSizeEstimate] Value indicating the + * estimated size of the underlying database. + * @member {string} [copyNotificationCurrentKeyFilter] Value indicating the + * latest key-prefix filter applied to enumeration during the callback. Null if + * there is no pending callback. + * @member {string} [copyNotificationCurrentProgress] Value indicating the + * latest number of keys enumerated during the callback. 0 if there is no + * pending callback. + * @member {string} [statusDetails] Value indicating the current status details + * of the replica. + */ +export interface KeyValueStoreReplicaStatus extends ReplicaStatusBase { + databaseRowCountEstimate?: string; + databaseLogicalSizeEstimate?: string; + copyNotificationCurrentKeyFilter?: string; + copyNotificationCurrentProgress?: string; + statusDetails?: string; +} + +/** + * @class + * Initializes a new instance of the DeployedStatefulServiceReplicaDetailInfo class. + * @constructor + * 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] 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] 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] 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 + * indicating the estimated size of the underlying database. + * @member {string} [replicaStatus.copyNotificationCurrentKeyFilter] Value + * indicating the latest key-prefix filter applied to enumeration during the + * callback. Null if there is no pending callback. + * @member {string} [replicaStatus.copyNotificationCurrentProgress] Value + * indicating the latest number of keys enumerated during the callback. 0 if + * there is no pending callback. + * @member {string} [replicaStatus.statusDetails] Value indicating the current + * status details of the replica. + * @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] Information + * about current reconfiguration like phase, type, previous configuration role + * of replica and reconfiguration start date time. + * @member {string} + * [deployedServiceReplicaQueryResult.reconfigurationInformation.previousConfigurationRole] + * Replica role before reconfiguration started. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' + * @member {string} + * [deployedServiceReplicaQueryResult.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} + * [deployedServiceReplicaQueryResult.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} + * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationStartTimeUtc] + * Start time (in UTC) of the ongoing reconfiguration. If no reconfiguration is + * taking place then this value will be zero date-time. + */ +export interface DeployedStatefulServiceReplicaDetailInfo extends DeployedServiceReplicaDetailInfo { + replicaId?: string; + currentReplicatorOperation?: string; + readStatus?: string; + writeStatus?: string; + replicatorStatus?: ReplicatorStatus; + replicaStatus?: KeyValueStoreReplicaStatus; + deployedServiceReplicaQueryResult?: DeployedStatefulServiceReplicaInfo; +} + +/** + * @class + * Initializes a new instance of the DeployedStatelessServiceInstanceDetailInfo class. + * @constructor + * 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] 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; + deployedServiceReplicaQueryResult?: DeployedStatelessServiceInstanceInfo; +} + +/** + * @class + * Initializes a new instance of the ServiceUpdateDescription class. + * @constructor + * A ServiceUpdateDescription contains all of the information necessary to + * update a service. + * + * @member {string} [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. + * @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] 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 { + flags?: string; + placementConstraints?: string; + correlationScheme?: ServiceCorrelationDescription[]; + loadMetrics?: ServiceLoadMetricDescription[]; + servicePlacementPolicies?: ServicePlacementPolicyDescription[]; + defaultMoveCost?: string; + scalingPolicies?: ScalingPolicyDescription[]; + serviceKind: string; +} + +/** + * @class + * Initializes a new instance of the StatefulServiceUpdateDescription class. + * @constructor + * Describes an update for a stateful service. + * + * @member {number} [targetReplicaSetSize] The target replica set size as a + * number. + * @member {number} [minReplicaSetSize] The minimum replica set size as a + * number. + * @member {string} [replicaRestartWaitDurationSeconds] The duration, in + * seconds, between when a replica goes down and when a new replica is created. + * @member {string} [quorumLossWaitDurationSeconds] The maximum duration, in + * seconds, for which a partition is allowed to be in a state of quorum loss. + * @member {string} [standByReplicaKeepDurationSeconds] The definition on how + * long StandBy replicas should be maintained before being removed. + */ +export interface StatefulServiceUpdateDescription extends ServiceUpdateDescription { + targetReplicaSetSize?: number; + minReplicaSetSize?: number; + replicaRestartWaitDurationSeconds?: string; + quorumLossWaitDurationSeconds?: string; + standByReplicaKeepDurationSeconds?: string; +} + +/** + * @class + * Initializes a new instance of the StatelessServiceUpdateDescription class. + * @constructor + * Describes an update for a stateless service. + * + * @member {number} [instanceCount] The instance count. + */ +export interface StatelessServiceUpdateDescription extends ServiceUpdateDescription { + instanceCount?: number; +} + +/** + * @class + * Initializes a new instance of the FileVersion class. + * @constructor + * Information about the version of image store file. + * + * @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 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; +} + +/** + * @class + * Initializes a new instance of the FileInfo class. + * @constructor + * Information about a image store file. + * + * @member {string} [fileSize] The size of file in bytes. + * @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 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 + * store root path. + */ +export interface FileInfo { + fileSize?: string; + fileVersion?: FileVersion; + modifiedDate?: Date; + storeRelativePath?: string; +} + +/** + * @class + * Initializes a new instance of the FolderInfo class. + * @constructor + * Information about a image store folder. It includes how many files this + * folder contains and its image store relative path. + * + * @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 { + storeRelativePath?: string; + fileCount?: string; +} + +/** + * @class + * Initializes a new instance of the ImageStoreContent class. + * @constructor + * Information about the image store content. + * + * @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 objects + * represents subfolders found under the given image store relative path. + */ +export interface ImageStoreContent { + storeFiles?: FileInfo[]; + storeFolders?: FolderInfo[]; +} + +/** + * @class + * Initializes a new instance of the ImageStoreCopyDescription class. + * @constructor + * Information about how to copy image store content from one image store + * relative path to another image store relative path. + * + * @member {string} remoteSource The relative path of source image store + * content to be copied from. + * @member {string} remoteDestination The relative path of destination image + * store content to be copied to. + * @member {array} [skipFiles] The list of the file names to be skipped for + * copying. + * @member {boolean} [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. + */ +export interface ImageStoreCopyDescription { + remoteSource: string; + remoteDestination: string; + skipFiles?: string[]; + checkMarkFile?: boolean; +} + +/** + * @class + * Initializes a new instance of the RestartDeployedCodePackageDescription class. + * @constructor + * Defines description for restarting a deployed code package on Service Fabric + * node. + * + * @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; + servicePackageActivationId?: string; + codePackageName: string; + codePackageInstanceId: string; +} + +/** + * @class + * Initializes a new instance of the DeployedServiceTypeInfo class. + * @constructor + * Information about service type deployed on a node, information such as the + * status of the service type registration on a node. + * + * @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; + serviceManifestName?: string; + codePackageName?: string; + status?: string; + servicePackageActivationId?: string; +} + +/** + * @class + * Initializes a new instance of the ResolvedServiceEndpoint class. * @constructor - * 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 - * be obtained by executing the same query with the continuation token provided - * in this list. + * Endpoint of a resolved service partition. * - * @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. + * @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 + * listener with the value as the address of that listener. */ -export interface PagedComposeDeploymentStatusInfoList { - continuationToken?: string; - items?: ComposeDeploymentStatusInfo[]; +export interface ResolvedServiceEndpoint { + kind?: string; + address?: string; } /** * @class - * Initializes a new instance of the CreateComposeDeploymentDescription class. + * Initializes a new instance of the ResolvedServicePartition class. * @constructor - * Defines description for creating a Service Fabric compose deployment. + * Information about a service partition and its associated endpoints. * - * @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] 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} 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 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. */ -export interface CreateComposeDeploymentDescription { - deploymentName: string; - composeFileContent: string; - registryCredential?: RegistryCredential; +export interface ResolvedServicePartition { + name: string; + partitionInformation: PartitionInformation; + endpoints: ResolvedServiceEndpoint[]; + version: string; } /** * @class - * Initializes a new instance of the DeployedServicePackageInfo class. + * Initializes a new instance of the SelectedPartition class. * @constructor - * Information about service package deployed on a Service Fabric node. + * This class returns information about the partition that the user-induced + * operation acted upon. * - * @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] 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. + * @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 DeployedServicePackageInfo { - name?: string; - version?: string; - status?: string; - servicePackageActivationId?: string; +export interface SelectedPartition { + serviceName?: string; + partitionId?: string; } /** * @class - * Initializes a new instance of the ServiceCorrelationDescription class. + * Initializes a new instance of the InvokeDataLossResult class. * @constructor - * Creates a particular correlation between services. + * Represents information about an operation in a terminal state (Completed or + * Faulted). * - * @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. + * @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] 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 ServiceCorrelationDescription { - scheme: string; - serviceName: string; +export interface InvokeDataLossResult { + errorCode?: number; + selectedPartition?: SelectedPartition; } /** * @class - * Initializes a new instance of the PartitionSchemeDescription class. + * Initializes a new instance of the InvokeQuorumLossResult class. * @constructor - * Describes how the service is partitioned. + * Represents information about an operation in a terminal state (Completed or + * Faulted). * - * @member {string} partitionScheme Polymorphic Discriminator + * @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] 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 PartitionSchemeDescription { - partitionScheme: string; +export interface InvokeQuorumLossResult { + errorCode?: number; + selectedPartition?: SelectedPartition; } /** * @class - * Initializes a new instance of the NamedPartitionSchemeDescription class. + * Initializes a new instance of the NodeResult class. * @constructor - * Describes the named partition scheme of the service. + * Contains information about a node that was targeted by a user-induced + * operation. * - * @member {number} count The number of partitions. - * @member {array} names Array of size specified by the ‘Count’ parameter, for - * the names of the partitions. + * @member {string} [nodeName] The name of a Service Fabric node. + * @member {string} [nodeInstanceId] The node instance id. */ -export interface NamedPartitionSchemeDescription extends PartitionSchemeDescription { - count: number; - names: string[]; +export interface NodeResult { + nodeName?: string; + nodeInstanceId?: string; } /** * @class - * Initializes a new instance of the SingletonPartitionSchemeDescription class. + * Initializes a new instance of the NodeTransitionResult class. * @constructor - * Describes the partition scheme of a singleton-partitioned, or - * non-partitioned service. + * Represents information about an operation in a terminal state (Completed or + * Faulted). * + * @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] 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 SingletonPartitionSchemeDescription extends PartitionSchemeDescription { +export interface NodeTransitionResult { + errorCode?: number; + nodeResult?: NodeResult; } /** * @class - * Initializes a new instance of the UniformInt64RangePartitionSchemeDescription class. + * Initializes a new instance of the NodeTransitionProgress class. * @constructor - * Describes a partitioning scheme where an integer range is allocated evenly - * across a number of partitions. + * Information about an NodeTransition operation. This class contains an + * OperationState and a NodeTransitionResult. The NodeTransitionResult is not + * valid until OperationState + * is Completed or Faulted. * - * @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 partitions. - * @member {string} highKey String indicating the upper bound of the partition - * key range that - * should be split between the partitions. + * @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] 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. */ -export interface UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { - count: number; - lowKey: string; - highKey: string; +export interface NodeTransitionProgress { + state?: string; + nodeTransitionResult?: NodeTransitionResult; } /** * @class - * Initializes a new instance of the ScalingTriggerDescription class. + * Initializes a new instance of the OperationStatus class. * @constructor - * Describes the trigger for performing a scaling operation. + * Contains the OperationId, OperationState, and OperationType for user-induced + * operations. * - * @member {string} kind Polymorphic Discriminator + * @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 ScalingTriggerDescription { - kind: string; +export interface OperationStatus { + operationId?: string; + state?: string; + type?: string; } /** * @class - * Initializes a new instance of the ScalingMechanismDescription class. + * Initializes a new instance of the PartitionDataLossProgress class. * @constructor - * Describes the mechanism for performing a scaling operation. + * Information about a partition data loss user-induced operation. * - * @member {string} kind Polymorphic Discriminator + * @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] 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 ScalingMechanismDescription { - kind: string; +export interface PartitionDataLossProgress { + state?: string; + invokeDataLossResult?: InvokeDataLossResult; } /** * @class - * Initializes a new instance of the ScalingPolicyDescription class. + * Initializes a new instance of the PartitionQuorumLossProgress class. * @constructor - * Describes how the scaling should be performed + * Information about a partition quorum loss user-induced operation. * - * @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 + * @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] 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 ScalingPolicyDescription { - scalingTrigger: ScalingTriggerDescription; - scalingMechanism: ScalingMechanismDescription; +export interface PartitionQuorumLossProgress { + state?: string; + invokeQuorumLossResult?: InvokeQuorumLossResult; } /** * @class - * Initializes a new instance of the ServiceDescription class. + * Initializes a new instance of the RestartPartitionResult class. * @constructor - * A ServiceDescription contains all of the information necessary to create a - * service. + * Represents information about an operation in a terminal state (Completed or + * Faulted). * - * @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 - * 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] 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] 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 + * @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] 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 ServiceDescription { - applicationName?: string; - serviceName: string; - serviceTypeName: string; - initializationData?: number[]; - partitionDescription: PartitionSchemeDescription; - placementConstraints?: string; - correlationScheme?: ServiceCorrelationDescription[]; - serviceLoadMetrics?: ServiceLoadMetricDescription[]; - servicePlacementPolicies?: ServicePlacementPolicyDescription[]; - defaultMoveCost?: string; - isDefaultMoveCostSpecified?: boolean; - servicePackageActivationMode?: string; - serviceDnsName?: string; - scalingPolicies?: ScalingPolicyDescription[]; - serviceKind: string; +export interface RestartPartitionResult { + errorCode?: number; + selectedPartition?: SelectedPartition; } /** * @class - * Initializes a new instance of the StatefulServiceDescription class. + * Initializes a new instance of the PartitionRestartProgress class. * @constructor - * Describes a stateful service. - * - * @member {number} targetReplicaSetSize The target replica set size as a - * number. - * @member {number} minReplicaSetSize The minimum replica set size as a number. - * @member {boolean} hasPersistedState A flag indicating whether this is a - * persistent service which stores states on the local disk. If it is then the - * value of this property is true, if not it is false. - * @member {number} [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 - * QuorumLossWaitDuration (2) and StandByReplicaKeepDuration(4) are set. + * Information about a partition restart user-induced operation. * - * - None - Does not indicate any other properties are set. The value is zero. - * - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration - * property is set. The value is 1. - * - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is - * set. The value is 2. - * - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration - * property is set. The value is 4. - * @member {number} [replicaRestartWaitDurationSeconds] The duration, in - * seconds, between when a replica goes down and when a new replica is created. - * @member {number} [quorumLossWaitDurationSeconds] The maximum duration, in - * seconds, for which a partition is allowed to be in a state of quorum loss. - * @member {number} [standByReplicaKeepDurationSeconds] The definition on how - * long StandBy replicas should be maintained before being removed. + * @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] 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 StatefulServiceDescription extends ServiceDescription { - targetReplicaSetSize: number; - minReplicaSetSize: number; - hasPersistedState: boolean; - flags?: number; - replicaRestartWaitDurationSeconds?: number; - quorumLossWaitDurationSeconds?: number; - standByReplicaKeepDurationSeconds?: number; +export interface PartitionRestartProgress { + state?: string; + restartPartitionResult?: RestartPartitionResult; } /** * @class - * Initializes a new instance of the StatelessServiceDescription class. + * Initializes a new instance of the PackageSharingPolicyInfo class. * @constructor - * Describes a stateless service. + * Represents a policy for the package sharing. * - * @member {number} instanceCount The instance count. + * @member {string} [sharedPackageName] The name of code, configuration or data + * package that should be shared. + * @member {string} [packageSharingScope] Represents the scope for + * PackageSharingPolicy. This is specified during DeployServicePackageToNode + * operation. Possible values include: 'None', 'All', 'Code', 'Config', 'Data' */ -export interface StatelessServiceDescription extends ServiceDescription { - instanceCount: number; +export interface PackageSharingPolicyInfo { + sharedPackageName?: string; + packageSharingScope?: string; } /** * @class - * Initializes a new instance of the ReplicatorQueueStatus class. + * Initializes a new instance of the DeployServicePackageToNodeDescription class. * @constructor - * Provides various statistics of the queue used in the service fabric - * replicator. - * Contains information about the service fabric replicator like the - * replication/copy queue utilization, last acknowledgement received timestamp, - * etc. - * Depending on the role of the replicator, the properties in this type imply - * different meanings. + * Defines description for downloading packages associated with a service + * manifest to image cache on a Service Fabric node. * - * @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. - * @member {string} [queueMemorySize] Represents the virtual memory consumed by - * the queue in bytes. - * @member {string} [firstSequenceNumber] On a primary replicator, this is - * semantically the sequence number of the operation for which all the - * secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is the smallest sequence number of the - * operation that is present in the queue. - * @member {string} [completedSequenceNumber] On a primary replicator, this is - * semantically the highest sequence number of the operation for which all the - * secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * that has been applied to the persistent state. - * @member {string} [committedSequenceNumber] On a primary replicator, this is - * semantically the highest sequence number of the operation for which a write - * quorum of the secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * of the in-order operation received from the primary. - * @member {string} [lastSequenceNumber] Represents the latest sequence number - * of the operation that is available in the queue. + * @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 ReplicatorQueueStatus { - queueUtilizationPercentage?: number; - queueMemorySize?: string; - firstSequenceNumber?: string; - completedSequenceNumber?: string; - committedSequenceNumber?: string; - lastSequenceNumber?: string; +export interface DeployServicePackageToNodeDescription { + serviceManifestName: string; + applicationTypeName: string; + applicationTypeVersion: string; + nodeName: string; + packageSharingPolicy?: PackageSharingPolicyInfo[]; } /** * @class - * Initializes a new instance of the ReplicatorStatus class. + * Initializes a new instance of the ResumeApplicationUpgradeDescription class. * @constructor - * 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. + * Describes the parameters for resuming an unmonitored manual Service Fabric + * application upgrade * - * @member {string} kind Polymorphic Discriminator + * @member {string} upgradeDomainName The name of the upgrade domain in which + * to resume the upgrade. */ -export interface ReplicatorStatus { - kind: string; +export interface ResumeApplicationUpgradeDescription { + upgradeDomainName: string; } /** * @class - * Initializes a new instance of the RemoteReplicatorAcknowledgementDetail class. + * Initializes a new instance of the ApplicationUpgradeUpdateDescription class. * @constructor - * Provides various statistics of the acknowledgements that are being received - * from the remote replicator. + * Describes the parameters for updating an ongoing application upgrade. * - * @member {string} [averageReceiveDuration] Represents the average duration it - * takes for the remote replicator to receive an operation. - * @member {string} [averageApplyDuration] Represents the average duration it - * takes for the remote replicator to apply an operation. This usually entails - * writing the operation to disk. - * @member {string} [notReceivedCount] Represents the number of operations not - * yet received by a remote replicator. - * @member {string} [receivedAndNotAppliedCount] Represents the number of - * operations received and not yet applied by a remote replicator. + * @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} + * [applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] The + * maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * @member {object} [applicationHealthPolicy.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 + * values are Byte values from zero to 100 + * + * The percentage represents the maximum tolerated percentage of partitions + * that can be unhealthy before the service is considered in error. + * If the percentage is respected but there is at least one unhealthy + * partition, the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy partitions + * over the total number of partitions in the service. + * The computation rounds up to tolerate one failure on small numbers of + * partitions. Default percentage is zero. + * @member {number} + * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. + * + * The percentage represents the maximum tolerated percentage of replicas that + * can be unhealthy before the partition is considered in error. + * If the percentage is respected but there is at least one unhealthy replica, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy replicas + * over the total number of replicas in the partition. + * The computation rounds up to tolerate one failure on small numbers of + * replicas. Default percentage is zero. + * @member {number} + * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum allowed percentage of unhealthy services. Allowed values are + * Byte values from zero to 100. + * + * The percentage represents the maximum tolerated percentage of services that + * can be unhealthy before the application is considered in error. + * If the percentage is respected but there is at least one unhealthy service, + * the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy services of the + * specific service type over the total number of services of the specific + * service type. + * The computation rounds up to tolerate one failure on small numbers of + * services. Default percentage is zero. + * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] 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] + * 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] + * 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 RemoteReplicatorAcknowledgementDetail { - averageReceiveDuration?: string; - averageApplyDuration?: string; - notReceivedCount?: string; - receivedAndNotAppliedCount?: string; +export interface ApplicationUpgradeUpdateDescription { + name: string; + upgradeKind: string; + applicationHealthPolicy?: ApplicationHealthPolicy; + updateDescription?: RollingUpgradeUpdateDescription; } /** * @class - * Initializes a new instance of the RemoteReplicatorAcknowledgementStatus class. + * Initializes a new instance of the NameDescription class. * @constructor - * Provides details about the remote replicators from the primary replicator's - * point of view. + * Describes a Service Fabric name. * - * @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 - * operation. - * @member {string} - * [replicationStreamAcknowledgementDetail.averageApplyDuration] Represents the - * average duration it takes for the remote replicator to apply an operation. - * This usually entails writing the operation to disk. - * @member {string} [replicationStreamAcknowledgementDetail.notReceivedCount] - * Represents the number of operations not yet received by a remote replicator. - * @member {string} - * [replicationStreamAcknowledgementDetail.receivedAndNotAppliedCount] - * Represents the number of operations received and not yet applied by a remote - * replicator. - * @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. - * @member {string} [copyStreamAcknowledgementDetail.averageApplyDuration] - * Represents the average duration it takes for the remote replicator to apply - * an operation. This usually entails writing the operation to disk. - * @member {string} [copyStreamAcknowledgementDetail.notReceivedCount] - * Represents the number of operations not yet received by a remote replicator. - * @member {string} - * [copyStreamAcknowledgementDetail.receivedAndNotAppliedCount] Represents the - * number of operations received and not yet applied by a remote replicator. + * @member {string} name The Service Fabric name, including the 'fabric:' URI + * scheme. */ -export interface RemoteReplicatorAcknowledgementStatus { - replicationStreamAcknowledgementDetail?: RemoteReplicatorAcknowledgementDetail; - copyStreamAcknowledgementDetail?: RemoteReplicatorAcknowledgementDetail; +export interface NameDescription { + name: string; } /** * @class - * Initializes a new instance of the RemoteReplicatorStatus class. + * Initializes a new instance of the PagedSubNameInfoList class. * @constructor - * Represents the state of the secondary replicator from the primary - * replicator’s point of view. - * - * @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. - * UTC 0 represents an invalid value, indicating that no acknowledgement - * messages were ever processed. - * @member {string} [lastReceivedReplicationSequenceNumber] The highest - * replication operation sequence number that the secondary has received from - * the primary. - * @member {string} [lastAppliedReplicationSequenceNumber] The highest - * replication operation sequence number that the secondary has applied to its - * state. - * @member {boolean} [isInBuild] A value that indicates whether the secondary - * replica is in the process of being built. - * @member {string} [lastReceivedCopySequenceNumber] The highest copy operation - * sequence number that the secondary has received from the primary. - * A value of -1 implies that the secondary has received all copy operations. - * @member {string} [lastAppliedCopySequenceNumber] The highest copy 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] 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 - * receive an operation. - * @member {string} - * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.averageApplyDuration] - * Represents the average duration it takes for the remote replicator to apply - * an operation. This usually entails writing the operation to disk. - * @member {string} - * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.notReceivedCount] - * Represents the number of operations not yet received by a remote replicator. - * @member {string} - * [remoteReplicatorAcknowledgementStatus.replicationStreamAcknowledgementDetail.receivedAndNotAppliedCount] - * Represents the number of operations received and not yet applied by a 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 - * receive an operation. - * @member {string} - * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.averageApplyDuration] - * Represents the average duration it takes for the remote replicator to apply - * an operation. This usually entails writing the operation to disk. - * @member {string} - * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.notReceivedCount] - * Represents the number of operations not yet received by a remote replicator. - * @member {string} - * [remoteReplicatorAcknowledgementStatus.copyStreamAcknowledgementDetail.receivedAndNotAppliedCount] - * Represents the number of operations received and not yet applied by a remote - * replicator. + * 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 RemoteReplicatorStatus { - replicaId?: string; - lastAcknowledgementProcessedTimeUtc?: Date; - lastReceivedReplicationSequenceNumber?: string; - lastAppliedReplicationSequenceNumber?: string; - isInBuild?: boolean; - lastReceivedCopySequenceNumber?: string; - lastAppliedCopySequenceNumber?: string; - remoteReplicatorAcknowledgementStatus?: RemoteReplicatorAcknowledgementStatus; +export interface PagedSubNameInfoList { + continuationToken?: string; + isConsistent?: boolean; + subNames?: string[]; } /** * @class - * Initializes a new instance of the PrimaryReplicatorStatus class. + * Initializes a new instance of the PropertyValue class. * @constructor - * Provides statistics about the Service Fabric Replicator, when it is - * functioning in a Primary role. + * Describes a Service Fabric property value. * - * @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. - * @member {string} [replicationQueueStatus.queueMemorySize] Represents the - * virtual memory consumed by the queue in bytes. - * @member {string} [replicationQueueStatus.firstSequenceNumber] On a primary - * replicator, this is semantically the sequence number of the operation for - * which all the secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is the smallest sequence number of the - * operation that is present in the queue. - * @member {string} [replicationQueueStatus.completedSequenceNumber] On a - * primary replicator, this is semantically the highest sequence number of the - * operation for which all the secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * that has been applied to the persistent state. - * @member {string} [replicationQueueStatus.committedSequenceNumber] On a - * primary replicator, this is semantically the highest sequence number of the - * operation for which a write quorum of the secondary replicas have sent an - * acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * 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] The status of all the active and idle - * secondary replicators that the primary is aware of. + * @member {string} kind Polymorphic Discriminator */ -export interface PrimaryReplicatorStatus extends ReplicatorStatus { - replicationQueueStatus?: ReplicatorQueueStatus; - remoteReplicators?: RemoteReplicatorStatus[]; +export interface PropertyValue { + kind: string; } /** * @class - * Initializes a new instance of the SecondaryReplicatorStatus class. + * Initializes a new instance of the BinaryPropertyValue class. * @constructor - * Provides statistics about the Service Fabric Replicator, when it is - * functioning in a ActiveSecondary role. + * Describes a Service Fabric property value of type Binary. * - * @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. - * @member {string} [replicationQueueStatus.queueMemorySize] Represents the - * virtual memory consumed by the queue in bytes. - * @member {string} [replicationQueueStatus.firstSequenceNumber] On a primary - * replicator, this is semantically the sequence number of the operation for - * which all the secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is the smallest sequence number of the - * operation that is present in the queue. - * @member {string} [replicationQueueStatus.completedSequenceNumber] On a - * primary replicator, this is semantically the highest sequence number of the - * operation for which all the secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * that has been applied to the persistent state. - * @member {string} [replicationQueueStatus.committedSequenceNumber] On a - * primary replicator, this is semantically the highest sequence number of the - * operation for which a write quorum of the secondary replicas have sent an - * acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * 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 {date} [lastReplicationOperationReceivedTimeUtc] The last time-stamp - * (UTC) at which a replication operation was received from the primary. - * UTC 0 represents an invalid value, indicating that a replication operation - * message was never received. - * @member {boolean} [isInBuild] Value that indicates whether the replica is - * currently being built. - * @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. - * @member {string} [copyQueueStatus.queueMemorySize] Represents the virtual - * memory consumed by the queue in bytes. - * @member {string} [copyQueueStatus.firstSequenceNumber] On a primary - * replicator, this is semantically the sequence number of the operation for - * which all the secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is the smallest sequence number of the - * operation that is present in the queue. - * @member {string} [copyQueueStatus.completedSequenceNumber] On a primary - * replicator, this is semantically the highest sequence number of the - * operation for which all the secondary replicas have sent an acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * that has been applied to the persistent state. - * @member {string} [copyQueueStatus.committedSequenceNumber] On a primary - * replicator, this is semantically the highest sequence number of the - * operation for which a write quorum of the secondary replicas have sent an - * acknowledgement. - * On a secondary replicator, this is semantically the highest sequence number - * of the in-order operation received from the primary. - * @member {string} [copyQueueStatus.lastSequenceNumber] Represents the latest - * sequence number of the operation that is available in the queue. - * @member {date} [lastCopyOperationReceivedTimeUtc] The last time-stamp (UTC) - * at which a copy operation was received from the primary. - * UTC 0 represents an invalid value, indicating that a copy operation message - * was never received. - * @member {date} [lastAcknowledgementSentTimeUtc] The last time-stamp (UTC) at - * which an acknowledgment was sent to the primary replicator. - * UTC 0 represents an invalid value, indicating that an acknowledgment message - * was never sent. + * @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 SecondaryReplicatorStatus extends ReplicatorStatus { - replicationQueueStatus?: ReplicatorQueueStatus; - lastReplicationOperationReceivedTimeUtc?: Date; - isInBuild?: boolean; - copyQueueStatus?: ReplicatorQueueStatus; - lastCopyOperationReceivedTimeUtc?: Date; - lastAcknowledgementSentTimeUtc?: Date; +export interface BinaryPropertyValue extends PropertyValue { + data: number[]; } /** * @class - * Initializes a new instance of the SecondaryActiveReplicatorStatus class. + * Initializes a new instance of the Int64PropertyValue class. * @constructor - * Status of the secondary replicator when it is in active mode and is part of - * the replica set. + * Describes a Service Fabric property value of type Int64. * + * @member {string} data The data of the property value. */ -export interface SecondaryActiveReplicatorStatus extends SecondaryReplicatorStatus { +export interface Int64PropertyValue extends PropertyValue { + data: string; } /** * @class - * Initializes a new instance of the SecondaryIdleReplicatorStatus class. + * Initializes a new instance of the DoublePropertyValue class. * @constructor - * Status of the secondary replicator when it is in idle mode and is being - * built by the primary. + * Describes a Service Fabric property value of type Double. * + * @member {number} data The data of the property value. */ -export interface SecondaryIdleReplicatorStatus extends SecondaryReplicatorStatus { +export interface DoublePropertyValue extends PropertyValue { + data: number; } /** * @class - * Initializes a new instance of the LoadMetricReportInfo class. + * Initializes a new instance of the StringPropertyValue class. * @constructor - * Information about load reported by replica. + * Describes a Service Fabric property value of type String. * - * @member {string} [name] The name of the metric. - * @member {number} [value] The value of the load for the metric.. - * @member {date} [lastReportedUtc] The UTC time when the load is reported. + * @member {string} data The data of the property value. */ -export interface LoadMetricReportInfo { - name?: string; - value?: number; - lastReportedUtc?: Date; +export interface StringPropertyValue extends PropertyValue { + data: string; } /** * @class - * Initializes a new instance of the DeployedServiceReplicaDetailInfo class. + * Initializes a new instance of the GuidPropertyValue class. * @constructor - * Information about a Service Fabric service replica deployed on a node. + * Describes a Service Fabric property value of type Guid. * - * @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] List of load reported by replica. - * @member {string} serviceKind Polymorphic Discriminator + * @member {uuid} data The data of the property value. */ -export interface DeployedServiceReplicaDetailInfo { - serviceName?: string; - partitionId?: string; - currentServiceOperation?: string; - currentServiceOperationStartTimeUtc?: Date; - reportedLoad?: LoadMetricReportInfo[]; - serviceKind: string; +export interface GuidPropertyValue extends PropertyValue { + data: string; } /** * @class - * Initializes a new instance of the ReplicaStatusBase class. + * Initializes a new instance of the PropertyMetadata class. * @constructor - * Information about the replica. + * The metadata associated with a property, including the property's name. * - * @member {string} kind Polymorphic Discriminator + * @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 ReplicaStatusBase { - kind: string; +export interface PropertyMetadata { + typeId?: string; + customTypeId?: string; + parent?: string; + sizeInBytes?: number; + lastModifiedUtcTimestamp?: Date; + sequenceNumber?: string; } /** * @class - * Initializes a new instance of the KeyValueStoreReplicaStatus class. + * Initializes a new instance of the PropertyInfo class. * @constructor - * Key value store related information for the replica. + * Information about a Service Fabric property. * - * @member {string} [databaseRowCountEstimate] Value indicating the estimated - * number of rows in the underlying database. - * @member {string} [databaseLogicalSizeEstimate] Value indicating the - * estimated size of the underlying database. - * @member {string} [copyNotificationCurrentKeyFilter] Value indicating the - * latest key-prefix filter applied to enumeration during the callback. Null if - * there is no pending callback. - * @member {string} [copyNotificationCurrentProgress] Value indicating the - * latest number of keys enumerated during the callback. 0 if there is no - * pending callback. - * @member {string} [statusDetails] Value indicating the current status details - * of the replica. + * @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 KeyValueStoreReplicaStatus extends ReplicaStatusBase { - databaseRowCountEstimate?: string; - databaseLogicalSizeEstimate?: string; - copyNotificationCurrentKeyFilter?: string; - copyNotificationCurrentProgress?: string; - statusDetails?: string; +export interface PropertyInfo { + name: string; + value?: PropertyValue; + metadata: PropertyMetadata; } /** * @class - * Initializes a new instance of the DeployedStatefulServiceReplicaDetailInfo class. + * Initializes a new instance of the PagedPropertyInfoList class. * @constructor - * Information about a stateful replica running in a code package. Note - * DeployedServiceReplicaQueryResult will contain duplicate data like - * ServiceKind, ServiceName, PartitionId and replicaId. + * 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. * - * @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] 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] 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 - * indicating the estimated size of the underlying database. - * @member {string} [replicaStatus.copyNotificationCurrentKeyFilter] Value - * indicating the latest key-prefix filter applied to enumeration during the - * callback. Null if there is no pending callback. - * @member {string} [replicaStatus.copyNotificationCurrentProgress] Value - * indicating the latest number of keys enumerated during the callback. 0 if - * there is no pending callback. - * @member {string} [replicaStatus.statusDetails] Value indicating the current - * status details of the replica. - * @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] Information - * about current reconfiguration like phase, type, previous configuration role - * of replica and reconfiguration start date time. - * @member {string} - * [deployedServiceReplicaQueryResult.reconfigurationInformation.previousConfigurationRole] - * Replica role before reconfiguration started. Possible values include: - * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary' - * @member {string} - * [deployedServiceReplicaQueryResult.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} - * [deployedServiceReplicaQueryResult.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} - * [deployedServiceReplicaQueryResult.reconfigurationInformation.reconfigurationStartTimeUtc] - * Start time (in UTC) of the ongoing reconfiguration. If no reconfiguration is - * taking place then this value will be zero date-time. + * @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 DeployedStatefulServiceReplicaDetailInfo extends DeployedServiceReplicaDetailInfo { - replicaId?: string; - currentReplicatorOperation?: string; - readStatus?: string; - writeStatus?: string; - replicatorStatus?: ReplicatorStatus; - replicaStatus?: KeyValueStoreReplicaStatus; - deployedServiceReplicaQueryResult?: DeployedStatefulServiceReplicaInfo; +export interface PagedPropertyInfoList { + continuationToken?: string; + isConsistent?: boolean; + properties?: PropertyInfo[]; } /** * @class - * Initializes a new instance of the DeployedStatelessServiceInstanceDetailInfo class. + * Initializes a new instance of the PropertyDescription class. * @constructor - * Information about a stateless instance running in a code package. Note that - * DeployedServiceReplicaQueryResult will contain duplicate data like - * ServiceKind, ServiceName, PartitionId and InstanceId. + * Description of a Service Fabric property. * - * @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. + * @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 DeployedStatelessServiceInstanceDetailInfo extends DeployedServiceReplicaDetailInfo { - instanceId?: string; - deployedServiceReplicaQueryResult?: DeployedStatelessServiceInstanceInfo; +export interface PropertyDescription { + propertyName: string; + customTypeId?: string; + value: PropertyValue; } /** * @class - * Initializes a new instance of the ServiceUpdateDescription class. + * Initializes a new instance of the PropertyBatchOperation class. * @constructor - * A ServiceUpdateDescription contains all of the information necessary to - * update a service. - * - * @member {string} [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. + * Represents the base type for property operations that can be put into a + * batch and submitted. * - * - 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. - * @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] 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 + * @member {string} propertyName The name of the Service Fabric property. + * @member {string} kind Polymorphic Discriminator */ -export interface ServiceUpdateDescription { - flags?: string; - placementConstraints?: string; - correlationScheme?: ServiceCorrelationDescription[]; - loadMetrics?: ServiceLoadMetricDescription[]; - servicePlacementPolicies?: ServicePlacementPolicyDescription[]; - defaultMoveCost?: string; - scalingPolicies?: ScalingPolicyDescription[]; - serviceKind: string; +export interface PropertyBatchOperation { + propertyName: string; + kind: string; } /** * @class - * Initializes a new instance of the StatefulServiceUpdateDescription class. + * Initializes a new instance of the PropertyBatchDescriptionList class. * @constructor - * Describes an update for a stateful service. + * Describes a list of property batch operations to be executed. Either all or + * none of the operations will be committed. * - * @member {number} [targetReplicaSetSize] The target replica set size as a - * number. - * @member {number} [minReplicaSetSize] The minimum replica set size as a - * number. - * @member {string} [replicaRestartWaitDurationSeconds] The duration, in - * seconds, between when a replica goes down and when a new replica is created. - * @member {string} [quorumLossWaitDurationSeconds] The maximum duration, in - * seconds, for which a partition is allowed to be in a state of quorum loss. - * @member {string} [standByReplicaKeepDurationSeconds] The definition on how - * long StandBy replicas should be maintained before being removed. + * @member {array} [operations] A list of the property batch operations to be + * executed. */ -export interface StatefulServiceUpdateDescription extends ServiceUpdateDescription { - targetReplicaSetSize?: number; - minReplicaSetSize?: number; - replicaRestartWaitDurationSeconds?: string; - quorumLossWaitDurationSeconds?: string; - standByReplicaKeepDurationSeconds?: string; +export interface PropertyBatchDescriptionList { + operations?: PropertyBatchOperation[]; } /** * @class - * Initializes a new instance of the StatelessServiceUpdateDescription class. + * Initializes a new instance of the CheckExistsPropertyBatchOperation class. * @constructor - * Describes an update for a stateless service. + * 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 {number} [instanceCount] The instance count. + * @member {boolean} exists Whether or not the property should exist for the + * operation to pass. */ -export interface StatelessServiceUpdateDescription extends ServiceUpdateDescription { - instanceCount?: number; +export interface CheckExistsPropertyBatchOperation extends PropertyBatchOperation { + exists: boolean; } /** * @class - * Initializes a new instance of the FileVersion class. + * Initializes a new instance of the CheckSequencePropertyBatchOperation class. * @constructor - * Information about the version of image store file. + * 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 {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 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. + * @member {string} sequenceNumber The expected sequence number. */ -export interface FileVersion { - versionNumber?: string; - epochDataLossNumber?: string; - epochConfigurationNumber?: string; +export interface CheckSequencePropertyBatchOperation extends PropertyBatchOperation { + sequenceNumber: string; } /** * @class - * Initializes a new instance of the FileInfo class. + * Initializes a new instance of the CheckValuePropertyBatchOperation class. * @constructor - * Information about a image store file. + * 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. * - * @member {string} [fileSize] The size of file in bytes. - * @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 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 - * store root path. + * @member {object} value The expected property value. + * @member {string} [value.kind] Polymorphic Discriminator */ -export interface FileInfo { - fileSize?: string; - fileVersion?: FileVersion; - modifiedDate?: Date; - storeRelativePath?: string; +export interface CheckValuePropertyBatchOperation extends PropertyBatchOperation { + value: PropertyValue; } /** * @class - * Initializes a new instance of the FolderInfo class. + * Initializes a new instance of the DeletePropertyBatchOperation class. * @constructor - * Information about a image store folder. It includes how many files this - * folder contains and its image store relative path. + * 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. * - * @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 { - storeRelativePath?: string; - fileCount?: string; +export interface DeletePropertyBatchOperation extends PropertyBatchOperation { } /** * @class - * Initializes a new instance of the ImageStoreContent class. + * Initializes a new instance of the GetPropertyBatchOperation class. * @constructor - * Information about the image store content. + * 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 {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 objects - * represents subfolders found under the given image store relative path. + * @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 ImageStoreContent { - storeFiles?: FileInfo[]; - storeFolders?: FolderInfo[]; +export interface GetPropertyBatchOperation extends PropertyBatchOperation { + includeValue?: boolean; } /** * @class - * Initializes a new instance of the ImageStoreCopyDescription class. + * Initializes a new instance of the PutPropertyBatchOperation class. * @constructor - * Information about how to copy image store content from one image store - * relative path to another image store relative path. + * 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. * - * @member {string} remoteSource The relative path of source image store - * content to be copied from. - * @member {string} remoteDestination The relative path of destination image - * store content to be copied to. - * @member {array} [skipFiles] The list of the file names to be skipped for - * copying. - * @member {boolean} [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. + * @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 ImageStoreCopyDescription { - remoteSource: string; - remoteDestination: string; - skipFiles?: string[]; - checkMarkFile?: boolean; +export interface PutPropertyBatchOperation extends PropertyBatchOperation { + value: PropertyValue; + customTypeId?: string; } /** * @class - * Initializes a new instance of the RestartDeployedCodePackageDescription class. + * Initializes a new instance of the PropertyBatchInfo class. * @constructor - * Defines description for restarting a deployed code package on Service Fabric - * node. + * Information about the results of a property batch. * - * @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. + * @member {string} kind Polymorphic Discriminator */ -export interface RestartDeployedCodePackageDescription { - serviceManifestName: string; - servicePackageActivationId?: string; - codePackageName: string; - codePackageInstanceId: string; +export interface PropertyBatchInfo { + kind: string; } /** * @class - * Initializes a new instance of the DeployedServiceTypeInfo class. + * Initializes a new instance of the SuccessfulPropertyBatchInfo class. * @constructor - * Information about service type deployed on a node, information such as the - * status of the service type registration on a node. + * Derived from PropertyBatchInfo. Represents the property batch succeeding. + * Contains the results of any "Get" operations in the batch. * - * @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. + * @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 DeployedServiceTypeInfo { - serviceTypeName?: string; - serviceManifestName?: string; - codePackageName?: string; - status?: string; - servicePackageActivationId?: string; +export interface SuccessfulPropertyBatchInfo extends PropertyBatchInfo { + properties?: { [propertyName: string]: PropertyInfo }; } /** * @class - * Initializes a new instance of the ResolvedServiceEndpoint class. + * Initializes a new instance of the FailedPropertyBatchInfo class. * @constructor - * Endpoint of a resolved service partition. + * Derived from PropertyBatchInfo. Represents the property batch failing. + * Contains information about the specific batch failure. * - * @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 - * listener with the value as the address of that listener. + * @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 ResolvedServiceEndpoint { - kind?: string; - address?: string; +export interface FailedPropertyBatchInfo extends PropertyBatchInfo { + errorMessage?: string; + operationIndex?: number; } /** * @class - * Initializes a new instance of the ResolvedServicePartition class. + * Initializes a new instance of the BackupScheduleDescription class. * @constructor - * Information about a service partition and its associated endpoints. + * Describes the backup schedule parameters. * - * @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 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. + * @member {string} scheduleKind Polymorphic Discriminator */ -export interface ResolvedServicePartition { - name: string; - partitionInformation: PartitionInformation; - endpoints: ResolvedServiceEndpoint[]; - version: string; +export interface BackupScheduleDescription { + scheduleKind: string; } /** * @class - * Initializes a new instance of the SelectedPartition class. - * @constructor - * This class returns information about the partition that the user-induced - * operation acted upon. - * - * @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. + * 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 SelectedPartition { - serviceName?: string; - partitionId?: string; +export interface BackupStorageDescription { + friendlyName?: string; + storageKind: string; } /** * @class - * Initializes a new instance of the InvokeDataLossResult class. + * Initializes a new instance of the RetentionPolicyDescription class. * @constructor - * Represents information about an operation in a terminal state (Completed or - * Faulted). + * Describes the retention policy configured. * - * @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] 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. + * @member {string} retentionPolicyType Polymorphic Discriminator */ -export interface InvokeDataLossResult { - errorCode?: number; - selectedPartition?: SelectedPartition; +export interface RetentionPolicyDescription { + retentionPolicyType: string; } /** * @class - * Initializes a new instance of the InvokeQuorumLossResult class. + * Initializes a new instance of the BackupPolicyDescription class. * @constructor - * Represents information about an operation in a terminal state (Completed or - * Faulted). + * Describes a backup policy for configuring periodic backup. * - * @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] 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. + * @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 + * @member {object} [retentionPolicy] Describes the policy to retain backups in + * storage. + * @member {string} [retentionPolicy.retentionPolicyType] Polymorphic + * Discriminator */ -export interface InvokeQuorumLossResult { - errorCode?: number; - selectedPartition?: SelectedPartition; +export interface BackupPolicyDescription { + name: string; + autoRestoreOnDataLoss: boolean; + maxIncrementalBackups: number; + schedule: BackupScheduleDescription; + storage: BackupStorageDescription; + retentionPolicy?: RetentionPolicyDescription; } /** * @class - * Initializes a new instance of the NodeResult class. + * Initializes a new instance of the PagedBackupPolicyDescriptionList class. * @constructor - * Contains information about a node that was targeted by a user-induced - * operation. + * 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} [nodeName] The name of a Service Fabric node. - * @member {string} [nodeInstanceId] The node instance id. + * @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 NodeResult { - nodeName?: string; - nodeInstanceId?: string; +export interface PagedBackupPolicyDescriptionList { + continuationToken?: string; + items?: BackupPolicyDescription[]; } /** * @class - * Initializes a new instance of the NodeTransitionResult class. + * Initializes a new instance of the BasicRetentionPolicyDescription class. * @constructor - * Represents information about an operation in a terminal state (Completed or - * Faulted). + * Describes basic retention policy. * - * @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] 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. + * @member {moment.duration} retentionDuration It is the minimum duration for + * which a backup created, will remain stored in the storage and might get + * deleted after that span of time. It should be specified in ISO8601 format. + * @member {number} [minimumNumberOfBackups] It is the minimum number of + * backups to be retained at any point of time. If specified with a non zero + * value, backups will not be deleted even if the backups have gone past + * retention duration and have number of backups less than or equal to it. */ -export interface NodeTransitionResult { - errorCode?: number; - nodeResult?: NodeResult; +export interface BasicRetentionPolicyDescription extends RetentionPolicyDescription { + retentionDuration: moment.Duration; + minimumNumberOfBackups?: number; } /** * @class - * Initializes a new instance of the NodeTransitionProgress class. + * Initializes a new instance of the DisableBackupDescription class. * @constructor - * Information about an NodeTransition operation. This class contains an - * OperationState and a NodeTransitionResult. The NodeTransitionResult is not - * valid until OperationState - * is Completed or Faulted. + * It describes the body parameters while disabling backup of a backup + * entity(Application/Service/Partition). * - * @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] 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. + * @member {boolean} cleanBackup Boolean flag to delete backups. It can be set + * to true for deleting all the backups which were created for the backup + * entity that is getting disabled for backup. */ -export interface NodeTransitionProgress { - state?: string; - nodeTransitionResult?: NodeTransitionResult; +export interface DisableBackupDescription { + cleanBackup: boolean; } /** * @class - * Initializes a new instance of the OperationStatus class. + * Initializes a new instance of the BackupConfigurationInfo class. * @constructor - * Contains the OperationId, OperationState, and OperationType for user-induced - * operations. + * Describes the backup configuration information. * - * @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' + * @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 OperationStatus { - operationId?: string; - state?: string; - type?: string; +export interface BackupConfigurationInfo { + policyName?: string; + policyInheritedFrom?: string; + suspensionInfo?: BackupSuspensionInfo; + kind: string; } /** * @class - * Initializes a new instance of the PartitionDataLossProgress class. + * Initializes a new instance of the ApplicationBackupConfigurationInfo class. * @constructor - * Information about a partition data loss user-induced operation. + * Backup configuration information for a specific Service Fabric application + * specifying what backup policy is being applied and suspend description, if + * any. * - * @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] 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. + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. */ -export interface PartitionDataLossProgress { - state?: string; - invokeDataLossResult?: InvokeDataLossResult; +export interface ApplicationBackupConfigurationInfo extends BackupConfigurationInfo { + applicationName?: string; } /** * @class - * Initializes a new instance of the PartitionQuorumLossProgress class. + * Initializes a new instance of the ServiceBackupConfigurationInfo class. * @constructor - * Information about a partition quorum loss user-induced operation. + * Backup configuration information for a specific Service Fabric service + * specifying what backup policy is being applied and suspend description, if + * any. * - * @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] 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. + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. */ -export interface PartitionQuorumLossProgress { - state?: string; - invokeQuorumLossResult?: InvokeQuorumLossResult; +export interface ServiceBackupConfigurationInfo extends BackupConfigurationInfo { + serviceName?: string; } /** * @class - * Initializes a new instance of the RestartPartitionResult class. + * Initializes a new instance of the BackupSuspensionInfo class. * @constructor - * Represents information about an operation in a terminal state (Completed or - * Faulted). + * Describes the backup suspension details. * - * @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] 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. + * @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 RestartPartitionResult { - errorCode?: number; - selectedPartition?: SelectedPartition; +export interface BackupSuspensionInfo { + isSuspended?: boolean; + suspensionInheritedFrom?: string; } /** * @class - * Initializes a new instance of the PartitionRestartProgress class. + * Initializes a new instance of the PagedBackupConfigurationInfoList class. * @constructor - * Information about a partition restart user-induced operation. + * 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} [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] 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. + * @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 PartitionRestartProgress { - state?: string; - restartPartitionResult?: RestartPartitionResult; +export interface PagedBackupConfigurationInfoList { + continuationToken?: string; + items?: BackupConfigurationInfo[]; } /** * @class - * Initializes a new instance of the PackageSharingPolicyInfo class. + * Initializes a new instance of the RestorePartitionDescription class. * @constructor - * Represents a policy for the package sharing. + * Specifies the parameters needed to trigger a restore of a specific + * partition. * - * @member {string} [sharedPackageName] The name of code, configuration or data - * package that should be shared. - * @member {string} [packageSharingScope] Represents the scope for - * PackageSharingPolicy. This is specified during DeployServicePackageToNode - * operation. Possible values include: 'None', 'All', 'Code', 'Config', 'Data' + * @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 PackageSharingPolicyInfo { - sharedPackageName?: string; - packageSharingScope?: string; +export interface RestorePartitionDescription { + backupId: string; + backupLocation: string; + backupStorage?: BackupStorageDescription; } /** * @class - * Initializes a new instance of the DeployServicePackageToNodeDescription class. + * Initializes a new instance of the RestoreProgressInfo class. * @constructor - * Defines description for downloading packages associated with a service - * manifest to image cache on a Service Fabric node. + * Describes the progress of a restore operation on a partition. * - * @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; - applicationTypeName: string; - applicationTypeVersion: string; - nodeName: string; - packageSharingPolicy?: PackageSharingPolicyInfo[]; + * @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.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. + * @member {string} [restoredEpoch.dataLossVersion] 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" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" + * + * - 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', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' + * @member {string} [failureError.message] Error message. + */ +export interface RestoreProgressInfo { + restoreState?: string; + timeStampUtc?: Date; + restoredEpoch?: Epoch; + restoredLsn?: string; + failureError?: FabricErrorError; } /** * @class - * Initializes a new instance of the ResumeApplicationUpgradeDescription class. + * Initializes a new instance of the BackupPartitionDescription class. * @constructor - * Describes the parameters for resuming an unmonitored manual Service Fabric - * application upgrade + * Describes the parameters for triggering partition's backup. * - * @member {string} upgradeDomainName The name of the upgrade domain in which - * to resume the upgrade. + * @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 ResumeApplicationUpgradeDescription { - upgradeDomainName: string; +export interface BackupPartitionDescription { + backupStorage?: BackupStorageDescription; } /** * @class - * Initializes a new instance of the ApplicationUpgradeUpdateDescription class. + * Initializes a new instance of the BackupInfo class. * @constructor - * Describes the parameters for updating an ongoing application upgrade. + * Represents a backup point which can be used to trigger a restore. * - * @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} - * [applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] The - * maximum allowed percentage of unhealthy deployed applications. Allowed - * values are Byte values from zero to 100. - * The percentage represents the maximum tolerated percentage of deployed - * applications that can be unhealthy before the application is considered in - * error. - * This is calculated by dividing the number of unhealthy deployed applications - * over the number of nodes where the application is currently deployed on in - * the cluster. - * The computation rounds up to tolerate one failure on small numbers of nodes. - * Default percentage is zero. - * @member {object} [applicationHealthPolicy.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 - * values are Byte values from zero to 100 + * @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.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. + * @member {string} [epochOfLastBackupRecord.dataLossVersion] 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 {string} [serviceManifestVersion] Manifest Version of the service + * this partition backup belongs to. + * @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. * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * - 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" * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * - 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" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] 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] - * 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] - * 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; - upgradeKind: string; - applicationHealthPolicy?: ApplicationHealthPolicy; - updateDescription?: RollingUpgradeUpdateDescription; -} - -/** - * @class - * Initializes a new instance of the NameDescription class. - * @constructor - * Describes a Service Fabric name. + * - 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" * - * @member {string} name The Service Fabric name, including the 'fabric:' URI - * scheme. + * - 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', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' + * @member {string} [failureError.message] Error message. */ -export interface NameDescription { - name: string; +export interface BackupInfo { + backupId?: string; + backupChainId?: string; + applicationName?: string; + serviceName?: string; + partitionInformation?: PartitionInformation; + backupLocation?: string; + backupType?: string; + epochOfLastBackupRecord?: Epoch; + lsnOfLastBackupRecord?: string; + creationTimeUtc?: Date; + serviceManifestVersion?: string; + failureError?: FabricErrorError; } /** * @class - * Initializes a new instance of the PagedSubNameInfoList class. + * Initializes a new instance of the PagedBackupInfoList 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. + * 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 @@ -9520,1988 +10597,1918 @@ export interface NameDescription { * 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. + * @member {array} [items] List of backup information. */ -export interface PagedSubNameInfoList { +export interface PagedBackupInfoList { continuationToken?: string; - isConsistent?: boolean; - subNames?: string[]; -} - -/** - * @class - * Initializes a new instance of the PropertyValue class. - * @constructor - * Describes a Service Fabric property value. - * - * @member {string} kind Polymorphic Discriminator - */ -export interface PropertyValue { - kind: string; -} - -/** - * @class - * Initializes a new instance of the BinaryPropertyValue class. - * @constructor - * Describes a Service Fabric property value of type Binary. - * - * @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} data The data of the property value. - */ -export interface StringPropertyValue extends PropertyValue { - data: string; -} - -/** - * @class - * Initializes a new instance of the GuidPropertyValue class. - * @constructor - * Describes a Service Fabric property value of type Guid. - * - * @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; + items?: BackupInfo[]; } /** * @class - * Initializes a new instance of the PropertyInfo class. + * Initializes a new instance of the AzureBlobBackupStorageDescription class. * @constructor - * Information about a Service Fabric property. + * Describes the parameters for Azure blob store used for storing and + * enumerating backups. * - * @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. + * @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 PropertyInfo { - name: string; - value?: PropertyValue; - metadata: PropertyMetadata; +export interface AzureBlobBackupStorageDescription extends BackupStorageDescription { + connectionString: string; + containerName: string; } /** * @class - * Initializes a new instance of the PagedPropertyInfoList class. + * Initializes a new instance of the FileShareBackupStorageDescription class. * @constructor - * 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. + * Describes the parameters for file share storage used for storing or + * enumerating backups. * - * @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. + * @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 PagedPropertyInfoList { - continuationToken?: string; - isConsistent?: boolean; - properties?: PropertyInfo[]; +export interface FileShareBackupStorageDescription extends BackupStorageDescription { + path: string; + primaryUserName?: string; + primaryPassword?: string; + secondaryUserName?: string; + secondaryPassword?: string; } /** * @class - * Initializes a new instance of the PropertyDescription class. + * Initializes a new instance of the FrequencyBasedBackupScheduleDescription class. * @constructor - * Description of a Service Fabric property. + * Describes the frequency based backup schedule. * - * @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 + * @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 PropertyDescription { - propertyName: string; - customTypeId?: string; - value: PropertyValue; +export interface FrequencyBasedBackupScheduleDescription extends BackupScheduleDescription { + interval: moment.Duration; } /** * @class - * Initializes a new instance of the PropertyBatchOperation class. + * Initializes a new instance of the TimeBasedBackupScheduleDescription class. * @constructor - * Represents the base type for property operations that can be put into a - * batch and submitted. + * Describes the time based backup schedule. * - * @member {string} propertyName The name of the Service Fabric property. - * @member {string} kind Polymorphic Discriminator + * @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 PropertyBatchOperation { - propertyName: string; - kind: string; +export interface TimeBasedBackupScheduleDescription extends BackupScheduleDescription { + scheduleFrequencyType: string; + runDays?: string[]; + runTimes: Date[]; } /** * @class - * Initializes a new instance of the PropertyBatchDescriptionList class. + * Initializes a new instance of the BackupProgressInfo class. * @constructor - * Describes a list of property batch operations to be executed. Either all or - * none of the operations will be committed. + * Describes the progress of a partition's backup. * - * @member {array} [operations] A list of the property batch operations to be - * executed. + * @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.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. + * @member {string} [epochOfLastBackupRecord.dataLossVersion] 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" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" + * + * - 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', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' + * @member {string} [failureError.message] Error message. */ -export interface PropertyBatchDescriptionList { - operations?: PropertyBatchOperation[]; +export interface BackupProgressInfo { + backupState?: string; + timeStampUtc?: Date; + backupId?: string; + backupLocation?: string; + epochOfLastBackupRecord?: Epoch; + lsnOfLastBackupRecord?: string; + failureError?: FabricErrorError; } /** * @class - * Initializes a new instance of the CheckExistsPropertyBatchOperation class. + * Initializes a new instance of the PartitionBackupConfigurationInfo 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. + * Backup configuration information, for a specific partition, specifying what + * backup policy is being applied and suspend description, if any. * - * @member {boolean} exists Whether or not the property should exist for the - * operation to pass. + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {uuid} [partitionId] The partition ID indentifying the partition. */ -export interface CheckExistsPropertyBatchOperation extends PropertyBatchOperation { - exists: boolean; +export interface PartitionBackupConfigurationInfo extends BackupConfigurationInfo { + serviceName?: string; + partitionId?: string; } /** * @class - * Initializes a new instance of the CheckSequencePropertyBatchOperation class. + * Initializes a new instance of the BackupEntity 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. + * Describes the Service Fabric entity that is configured for backup. * - * @member {string} sequenceNumber The expected sequence number. + * @member {string} entityKind Polymorphic Discriminator */ -export interface CheckSequencePropertyBatchOperation extends PropertyBatchOperation { - sequenceNumber: string; +export interface BackupEntity { + entityKind: string; } /** * @class - * Initializes a new instance of the CheckValuePropertyBatchOperation class. + * Initializes a new instance of the ApplicationBackupEntity class. * @constructor - * 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. + * Identifies the Service Fabric application which is being backed up. * - * @member {object} value The expected property value. - * @member {string} [value.kind] Polymorphic Discriminator + * @member {string} [applicationName] The name of the application, including + * the 'fabric:' URI scheme. */ -export interface CheckValuePropertyBatchOperation extends PropertyBatchOperation { - value: PropertyValue; +export interface ApplicationBackupEntity extends BackupEntity { + applicationName?: string; } /** * @class - * Initializes a new instance of the DeletePropertyBatchOperation class. + * Initializes a new instance of the ServiceBackupEntity 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. + * 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 DeletePropertyBatchOperation extends PropertyBatchOperation { +export interface ServiceBackupEntity extends BackupEntity { + serviceName?: string; } /** * @class - * Initializes a new instance of the GetPropertyBatchOperation class. + * Initializes a new instance of the PartitionBackupEntity 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. + * Identifies the Service Fabric stateful partition which is being backed up. * - * @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 . + * @member {string} [serviceName] The full name of the service with 'fabric:' + * URI scheme. + * @member {uuid} [partitionId] The partition ID indentifying the partition. */ -export interface GetPropertyBatchOperation extends PropertyBatchOperation { - includeValue?: boolean; +export interface PartitionBackupEntity extends BackupEntity { + serviceName?: string; + partitionId?: string; } /** * @class - * Initializes a new instance of the PutPropertyBatchOperation class. + * Initializes a new instance of the EnableBackupDescription class. * @constructor - * 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. + * Specifies the parameters needed to enable periodic backup. * - * @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. + * @member {string} backupPolicyName Name of the backup policy to be used for + * enabling periodic backups. */ -export interface PutPropertyBatchOperation extends PropertyBatchOperation { - value: PropertyValue; - customTypeId?: string; +export interface EnableBackupDescription { + backupPolicyName: string; } /** * @class - * Initializes a new instance of the PropertyBatchInfo class. + * Initializes a new instance of the PagedBackupEntityList class. * @constructor - * Information about the results of a property batch. + * 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} kind Polymorphic Discriminator + * @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 PropertyBatchInfo { - kind: string; +export interface PagedBackupEntityList { + continuationToken?: string; + items?: BackupEntity[]; } /** * @class - * Initializes a new instance of the SuccessfulPropertyBatchInfo class. + * Initializes a new instance of the GetBackupByStorageQueryDescription class. * @constructor - * Derived from PropertyBatchInfo. Represents the property batch succeeding. - * Contains the results of any "Get" operations in the batch. + * Describes additional filters to be applied, while listing backups, and + * backup storage details from where to fetch the backups. * - * @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. + * @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 SuccessfulPropertyBatchInfo extends PropertyBatchInfo { - properties?: { [propertyName: string]: PropertyInfo }; +export interface GetBackupByStorageQueryDescription { + startDateTimeFilter?: Date; + endDateTimeFilter?: Date; + latest?: boolean; + storage: BackupStorageDescription; + backupEntity: BackupEntity; } /** * @class - * Initializes a new instance of the FailedPropertyBatchInfo class. + * Initializes a new instance of the NodeImpact class. * @constructor - * Derived from PropertyBatchInfo. Represents the property batch failing. - * Contains information about the specific batch failure. + * Describes the expected impact of a repair to a particular node. * - * @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. + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @member {string} scheduleKind Polymorphic Discriminator + * @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 BackupScheduleDescription { - scheduleKind: string; +export interface NodeImpact { + nodeName: string; + impactLevel?: string; } /** * @class - * Initializes a new instance of the BackupStorageDescription class. + * Initializes a new instance of the RepairImpactDescriptionBase class. * @constructor - * Describes the parameters for the backup storage. + * Describes the expected impact of executing a repair task. * - * @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. + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @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; + * @member {string} kind Polymorphic Discriminator + */ +export interface RepairImpactDescriptionBase { + kind: string; } /** * @class - * Initializes a new instance of the PagedBackupPolicyDescriptionList class. + * Initializes a new instance of the NodeRepairImpactDescription 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. + * Describes the expected impact of a repair on a set of nodes. * - * @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. + * 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 PagedBackupPolicyDescriptionList { - continuationToken?: string; - items?: BackupPolicyDescription[]; +export interface NodeRepairImpactDescription extends RepairImpactDescriptionBase { + nodeImpactList?: NodeImpact[]; } /** * @class - * Initializes a new instance of the BackupConfigurationInfo class. + * Initializes a new instance of the RepairTargetDescriptionBase class. * @constructor - * Describes the backup configuration information. + * 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} [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; +export interface RepairTargetDescriptionBase { kind: string; } /** * @class - * Initializes a new instance of the ApplicationBackupConfigurationInfo class. + * Initializes a new instance of the NodeRepairTargetDescription class. * @constructor - * Backup configuration information for a specific Service Fabric application - * specifying what backup policy is being applied and suspend description, if - * any. + * Describes the list of nodes targeted by a repair action. * - * @member {string} [applicationName] The name of the application, including - * the 'fabric:' URI scheme. + * 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 ApplicationBackupConfigurationInfo extends BackupConfigurationInfo { - applicationName?: string; +export interface NodeRepairTargetDescription extends RepairTargetDescriptionBase { + nodeNames?: string[]; } /** * @class - * Initializes a new instance of the ServiceBackupConfigurationInfo class. + * Initializes a new instance of the RepairTaskHistory class. * @constructor - * Backup configuration information for a specific Service Fabric service - * specifying what backup policy is being applied and suspend description, if - * any. + * A record of the times when the repair task entered each state. * - * @member {string} [serviceName] The full name of the service with 'fabric:' - * URI scheme. + * 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 ServiceBackupConfigurationInfo extends BackupConfigurationInfo { - serviceName?: string; +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 BackupSuspensionInfo class. + * Initializes a new instance of the RepairTask class. * @constructor - * Describes the backup suspension details. + * Represents a repair task, which includes information about what kind of + * repair was requested, what its progress is, and what its final result was. * - * @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' + * 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 BackupSuspensionInfo { - isSuspended?: boolean; - suspensionInheritedFrom?: string; +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 PagedBackupConfigurationInfoList class. + * Initializes a new instance of the RepairTaskCancelDescription 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. + * Describes a request to cancel a repair task. * - * @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. + * 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 PagedBackupConfigurationInfoList { - continuationToken?: string; - items?: BackupConfigurationInfo[]; +export interface RepairTaskCancelDescription { + taskId: string; + version?: string; + requestAbort?: boolean; } /** * @class - * Initializes a new instance of the RestorePartitionDescription class. + * Initializes a new instance of the RepairTaskDeleteDescription class. * @constructor - * Specifies the parameters needed to trigger a restore of a specific - * partition. + * Describes a request to delete a completed repair task. * - * @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 + * 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 RestorePartitionDescription { - backupId: string; - backupLocation: string; - backupStorage?: BackupStorageDescription; +export interface RepairTaskDeleteDescription { + taskId: string; + version?: string; } /** * @class - * Initializes a new instance of the RestoreProgressInfo class. + * Initializes a new instance of the RepairTaskUpdateHealthPolicyDescription 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" + * Describes a request to update the health policy of a repair task. * - * - 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" + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * - 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. + * @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 RestoreProgressInfo { - restoreState?: string; - timeStampUtc?: Date; - restoredEpoch?: BackupEpoch; - restoredLsn?: string; - failureError?: FabricErrorError; +export interface RepairTaskUpdateHealthPolicyDescription { + taskId: string; + version?: string; + performPreparingHealthCheck?: boolean; + performRestoringHealthCheck?: boolean; } /** * @class - * Initializes a new instance of the BackupPartitionDescription class. + * Initializes a new instance of the RepairTaskUpdateInfo class. * @constructor - * Describes the parameters for triggering partition's backup. + * Describes the result of an operation that created or updated a repair task. * - * @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 + * 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 BackupPartitionDescription { - backupStorage?: BackupStorageDescription; +export interface RepairTaskUpdateInfo { + version: string; } /** * @class - * Initializes a new instance of the BackupInfo class. + * Initializes a new instance of the UploadChunkRange class. * @constructor - * Represents a backup point which can be used to trigger a restore. + * Information about which portion of the file to upload. * - * @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. + * @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. * - * - 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" + * @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 * - * - 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" + * @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 AveragePartitionLoadScalingTrigger class. + * @constructor + * Represents a scaling trigger related to an average load of a metric/resource + * of a partition. * - * - 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" + * @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. * - * - Possible values of the error code for HTTP status code 413 (Request Entity - * Too Large) - * - "FABRIC_E_VALUE_TOO_LARGE" + * @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. * - * - 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" + * @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' * - * - 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" + * @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. * - * - 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. + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {string} applicationDefinitionKind Application definition kind. */ -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; +export interface ApplicationCreatedEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; + applicationDefinitionKind: string; } /** * @class - * Initializes a new instance of the PagedBackupInfoList class. + * Initializes a new instance of the ApplicationDeletedEvent 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. + * Application Deleted event. * - * @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. + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. */ -export interface PagedBackupInfoList { - continuationToken?: string; - items?: BackupInfo[]; +export interface ApplicationDeletedEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; } /** * @class - * Initializes a new instance of the AzureBlobBackupStorageDescription class. + * Initializes a new instance of the ApplicationNewHealthReportEvent class. * @constructor - * Describes the parameters for Azure blob store used for storing and - * enumerating backups. + * Application Health Report Created event. * - * @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. + * @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 AzureBlobBackupStorageDescription extends BackupStorageDescription { - connectionString: string; - containerName: string; +export interface ApplicationNewHealthReportEvent 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 FileShareBackupStorageDescription class. + * Initializes a new instance of the ApplicationHealthReportExpiredEvent class. * @constructor - * Describes the parameters for file share storage used for storing or - * enumerating backups. + * Application Health Report Expired event. * - * @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 + * @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 FileShareBackupStorageDescription extends BackupStorageDescription { - path: string; - primaryUserName?: string; - primaryPassword?: string; - secondaryUserName?: string; - secondaryPassword?: string; +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 FrequencyBasedBackupScheduleDescription class. + * Initializes a new instance of the ApplicationUpgradeCompletedEvent class. * @constructor - * Describes the frequency based backup schedule. + * Application Upgrade Completed event. * - * @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. + * @member {string} applicationTypeName Application type name. + * @member {string} applicationTypeVersion Application type version. + * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in + * milli-seconds. */ -export interface FrequencyBasedBackupScheduleDescription extends BackupScheduleDescription { - interval: moment.Duration; +export interface ApplicationUpgradeCompletedEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; + overallUpgradeElapsedTimeInMs: number; } /** * @class - * Initializes a new instance of the TimeBasedBackupScheduleDescription class. + * Initializes a new instance of the ApplicationUpgradeDomainCompletedEvent class. * @constructor - * Describes the time based backup schedule. + * Application Upgrade Domain Completed event. * - * @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. + * @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 TimeBasedBackupScheduleDescription extends BackupScheduleDescription { - scheduleFrequencyType: string; - runDays?: string[]; - runTimes: Date[]; +export interface ApplicationUpgradeDomainCompletedEvent extends ApplicationEvent { + applicationTypeName: string; + currentApplicationTypeVersion: string; + applicationTypeVersion: string; + upgradeState: string; + upgradeDomains: string; + upgradeDomainElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationUpgradeRollbackCompletedEvent class. + * @constructor + * Application Upgrade Rollback Completed 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 ApplicationUpgradeRollbackCompletedEvent extends ApplicationEvent { + applicationTypeName: string; + applicationTypeVersion: string; + failureReason: string; + overallUpgradeElapsedTimeInMs: number; } /** * @class - * Initializes a new instance of the BackupProgressInfo class. + * Initializes a new instance of the ApplicationUpgradeRollbackStartedEvent 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" + * Application Upgrade Rollback Started event. * - * - 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" + * @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 ApplicationUpgradeRollbackStartedEvent extends ApplicationEvent { + applicationTypeName: string; + currentApplicationTypeVersion: string; + applicationTypeVersion: string; + failureReason: string; + overallUpgradeElapsedTimeInMs: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationUpgradeStartedEvent class. + * @constructor + * Application Upgrade Started event. * - * - 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. + * @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 BackupProgressInfo { - backupState?: string; - timeStampUtc?: Date; - backupId?: string; - backupLocation?: string; - epochOfLastBackupRecord?: BackupEpoch; - lsnOfLastBackupRecord?: string; - failureError?: FabricErrorError; +export interface ApplicationUpgradeStartedEvent extends ApplicationEvent { + applicationTypeName: string; + currentApplicationTypeVersion: string; + applicationTypeVersion: string; + upgradeType: string; + rollingUpgradeMode: string; + failureAction: string; } /** * @class - * Initializes a new instance of the PartitionBackupConfigurationInfo class. + * Initializes a new instance of the DeployedApplicationNewHealthReportEvent class. * @constructor - * Backup configuration information, for a specific partition, specifying what - * backup policy is being applied and suspend description, if any. + * Deployed Application Health Report Created event. * - * @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. + * @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 PartitionBackupConfigurationInfo extends BackupConfigurationInfo { - serviceName?: string; - partitionId?: string; +export interface DeployedApplicationNewHealthReportEvent 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 BackupEntity class. + * Initializes a new instance of the DeployedApplicationHealthReportExpiredEvent class. * @constructor - * Describes the Service Fabric entity that is configured for backup. + * Deployed Application Health Report Expired event. * - * @member {string} entityKind Polymorphic Discriminator + * @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 BackupEntity { - entityKind: string; +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 ApplicationBackupEntity class. + * Initializes a new instance of the ApplicationProcessExitedEvent class. * @constructor - * Identifies the Service Fabric application which is being backed up. + * Process Exited event. * - * @member {string} [applicationName] The name of the application, including - * the 'fabric:' URI scheme. + * @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 ApplicationBackupEntity extends BackupEntity { - applicationName?: string; +export interface ApplicationProcessExitedEvent 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 ServiceBackupEntity class. + * Initializes a new instance of the ApplicationContainerInstanceExitedEvent class. * @constructor - * Identifies the Service Fabric stateful service which is being backed up. + * Container Exited event. * - * @member {string} [serviceName] The full name of the service with 'fabric:' - * URI scheme. + * @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 ServiceBackupEntity extends BackupEntity { - serviceName?: string; +export interface ApplicationContainerInstanceExitedEvent 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 PartitionBackupEntity class. + * Initializes a new instance of the NodeAbortedEvent class. * @constructor - * Identifies the Service Fabric stateful partition which is being backed up. + * Node Aborted event. * - * @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. + * @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 PartitionBackupEntity extends BackupEntity { - serviceName?: string; - partitionId?: string; +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 EnableBackupDescription class. + * Initializes a new instance of the NodeAddedToClusterEvent class. * @constructor - * Specifies the parameters needed to enable periodic backup. + * Node Added event. * - * @member {string} backupPolicyName Name of the backup policy to be used for - * enabling periodic backups. + * @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 EnableBackupDescription { - backupPolicyName: string; +export interface NodeAddedToClusterEvent extends NodeEvent { + nodeId: string; + nodeInstance: number; + nodeType: string; + fabricVersion: string; + ipAddressOrFQDN: string; + nodeCapacities: string; } /** * @class - * Initializes a new instance of the PagedBackupEntityList class. + * Initializes a new instance of the NodeClosedEvent 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. + * Node Closed event. * - * @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. + * @member {string} nodeId Id of Node. + * @member {number} nodeInstance Id of Node instance. + * @member {string} error Describes error. */ -export interface PagedBackupEntityList { - continuationToken?: string; - items?: BackupEntity[]; +export interface NodeClosedEvent extends NodeEvent { + nodeId: string; + nodeInstance: number; + error: string; } /** * @class - * Initializes a new instance of the GetBackupByStorageQueryDescription class. + * Initializes a new instance of the NodeDeactivateCompletedEvent class. * @constructor - * Describes additional filters to be applied, while listing backups, and - * backup storage details from where to fetch the backups. + * Node Deactivate Completed event. * - * @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 + * @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 GetBackupByStorageQueryDescription { - startDateTimeFilter?: Date; - endDateTimeFilter?: Date; - latest?: boolean; - storage: BackupStorageDescription; - backupEntity: BackupEntity; +export interface NodeDeactivateCompletedEvent extends NodeEvent { + nodeInstance: number; + effectiveDeactivateIntent: string; + batchIdsWithDeactivateIntent: string; + startTime: Date; } /** * @class - * Initializes a new instance of the NodeImpact class. + * Initializes a new instance of the NodeDeactivateStartedEvent 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. + * Node Deactivate Started event. * - * @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 {number} nodeInstance Id of Node instance. + * @member {string} batchId Batch Id. + * @member {string} deactivateIntent Describes deactivate intent. */ -export interface NodeImpact { - nodeName: string; - impactLevel?: string; +export interface NodeDeactivateStartedEvent extends NodeEvent { + nodeInstance: number; + batchId: string; + deactivateIntent: string; } /** * @class - * Initializes a new instance of the RepairImpactDescriptionBase class. + * Initializes a new instance of the NodeDownEvent 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. + * Node Down event. * - * @member {string} kind Polymorphic Discriminator + * @member {number} nodeInstance Id of Node instance. + * @member {date} lastNodeUpAt Time when Node was last up. */ -export interface RepairImpactDescriptionBase { - kind: string; +export interface NodeDownEvent extends NodeEvent { + nodeInstance: number; + lastNodeUpAt: Date; } /** * @class - * Initializes a new instance of the NodeRepairImpactDescription class. + * Initializes a new instance of the NodeNewHealthReportEvent 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. + * Node Health Report Created event. * - * @member {array} [nodeImpactList] The list of nodes impacted by a repair - * action and their respective expected impact. + * @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 NodeRepairImpactDescription extends RepairImpactDescriptionBase { - nodeImpactList?: NodeImpact[]; +export interface NodeNewHealthReportEvent 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 RepairTargetDescriptionBase class. + * Initializes a new instance of the NodeHealthReportExpiredEvent 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. + * Node Health Report Expired event. * - * @member {string} kind Polymorphic Discriminator + * @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 RepairTargetDescriptionBase { - kind: string; +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 NodeRepairTargetDescription class. + * Initializes a new instance of the NodeOpenSucceededEvent 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. + * Node Opened Succeeded event. * - * @member {array} [nodeNames] The list of nodes targeted by a repair action. + * @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 NodeRepairTargetDescription extends RepairTargetDescriptionBase { - nodeNames?: string[]; +export interface NodeOpenSucceededEvent 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 RepairTaskHistory class. + * Initializes a new instance of the NodeOpenFailedEvent 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. + * Node Open Failed event. * - * @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 {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 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 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 RepairTask class. + * Initializes a new instance of the NodeRemovedFromClusterEvent 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. + * Node Removed event. * - * @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. + * @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 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 NodeRemovedFromClusterEvent extends NodeEvent { + nodeId: string; + nodeInstance: number; + nodeType: string; + fabricVersion: string; + ipAddressOrFQDN: string; + nodeCapacities: string; } /** * @class - * Initializes a new instance of the RepairTaskApproveDescription class. + * Initializes a new instance of the NodeUpEvent 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. + * Node Up event. * - * @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; + * @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 RepairTaskCancelDescription class. + * Initializes a new instance of the PartitionNewHealthReportEvent 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. + * Partition Health Report Created event. * - * @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} 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 RepairTaskCancelDescription { - taskId: string; - version?: string; - requestAbort?: boolean; +export interface PartitionNewHealthReportEvent 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 RepairTaskDeleteDescription class. + * Initializes a new instance of the PartitionHealthReportExpiredEvent 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. + * Partition Health Report Expired event. * - * @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 {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 RepairTaskDeleteDescription { - taskId: string; - version?: string; +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 RepairTaskUpdateHealthPolicyDescription class. + * Initializes a new instance of the PartitionReconfiguredEvent class. * @constructor - * Describes a request to update the health policy of a repair task. + * Partition Reconfiguration event. * - * 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. + * @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 RepairTaskUpdateHealthPolicyDescription { - taskId: string; - version?: string; - performPreparingHealthCheck?: boolean; - performRestoringHealthCheck?: boolean; +export interface PartitionReconfiguredEvent 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 RepairTaskUpdateInfo class. + * Initializes a new instance of the PartitionPrimaryMoveAnalysisEvent 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. + * Partition Primary Move Analysis event. * - * @member {string} version The new version of the repair task. + * @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 RepairTaskUpdateInfo { - version: string; +export interface PartitionPrimaryMoveAnalysisEvent extends PartitionAnalysisEvent { + whenMoveCompleted: Date; + previousNode: string; + currentNode: string; + moveReason: string; + relevantTraces: string; } /** * @class - * Initializes a new instance of the UploadChunkRange class. + * Initializes a new instance of the ServiceCreatedEvent class. * @constructor - * Information about which portion of the file to upload. + * Service Created event. * - * @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. + * @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 UploadChunkRange { - startPosition?: string; - endPosition?: string; +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 UploadSessionInfo class. + * Initializes a new instance of the ServiceDeletedEvent class. * @constructor - * Information about an image store upload session. A session is associated - * with a relative path in the image store. + * Service Deleted event. * - * @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. + * @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 UploadSessionInfo { - storeRelativePath?: string; - sessionId?: string; - modifiedDate?: Date; - fileSize?: string; - expectedRanges?: UploadChunkRange[]; +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 UploadSession class. + * Initializes a new instance of the ServiceNewHealthReportEvent class. * @constructor - * Information about a image store upload session + * Service Health Report Created event. * - * @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. + * @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 UploadSession { - uploadSessions?: UploadSessionInfo[]; +export interface ServiceNewHealthReportEvent 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 ContainerLogs class. + * Initializes a new instance of the ServiceHealthReportExpiredEvent class. * @constructor - * Container logs. + * Service Health Report Expired event. * - * @member {string} [content] Container logs. + * @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 ContainerLogs { - content?: string; +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 AveragePartitionLoadScalingTrigger class. + * Initializes a new instance of the DeployedServicePackageNewHealthReportEvent class. * @constructor - * Represents a scaling trigger related to an average load of a metric/resource - * of a partition. + * Deployed Service Health Report Created event. * - * @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. + * @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} 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 AveragePartitionLoadScalingTrigger extends ScalingTriggerDescription { - metricName: string; - lowerLoadThreshold: string; - upperLoadThreshold: string; - scaleIntervalInSeconds: number; +export interface DeployedServicePackageNewHealthReportEvent extends ApplicationEvent { + serviceManifestName: string; + servicePackageInstanceId: number; + servicePackageActivationId: string; + 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 AverageServiceLoadScalingTrigger class. + * Initializes a new instance of the DeployedServicePackageHealthReportExpiredEvent class. * @constructor - * Represents a scaling policy related to an average load of a metric/resource - * of a service. + * Deployed Service Health Report Expired event. * - * @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. + * @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} 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 AverageServiceLoadScalingTrigger extends ScalingTriggerDescription { - metricName: string; - lowerLoadThreshold: string; - upperLoadThreshold: string; - scaleIntervalInSeconds: number; +export interface DeployedServicePackageHealthReportExpiredEvent extends ApplicationEvent { + serviceManifest: string; + servicePackageInstanceId: number; + servicePackageActivationId: string; + 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 PartitionInstanceCountScaleMechanism class. + * Initializes a new instance of the StatefulReplicaNewHealthReportEvent class. * @constructor - * Represents a scaling mechanism for adding or removing instances of stateless - * service partition. + * Stateful Replica Health Report Created event. * - * @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. + * @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 PartitionInstanceCountScaleMechanism extends ScalingMechanismDescription { - minInstanceCount: number; - maxInstanceCount: number; - scaleIncrement: number; +export interface StatefulReplicaNewHealthReportEvent 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 AddRemoveIncrementalNamedPartitionScalingMechanism class. + * Initializes a new instance of the StatefulReplicaHealthReportExpiredEvent 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' + * Stateful Replica Health Report Expired event. * - * @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. + * @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 AddRemoveIncrementalNamedPartitionScalingMechanism extends ScalingMechanismDescription { - minPartitionCount: number; - maxPartitionCount: number; - scaleIncrement: number; +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 ApplicationCreatedEvent class. + * Initializes a new instance of the StatelessReplicaNewHealthReportEvent class. * @constructor - * Application Created event. + * Stateless Replica Health Report Created event. * - * @member {string} applicationTypeName Application type name. - * @member {string} applicationTypeVersion Application type version. - * @member {string} applicationDefinitionKind Application definition kind. + * @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 ApplicationCreatedEvent extends ApplicationEvent { - applicationTypeName: string; - applicationTypeVersion: string; - applicationDefinitionKind: string; +export interface StatelessReplicaNewHealthReportEvent 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 ApplicationDeletedEvent class. + * Initializes a new instance of the StatelessReplicaHealthReportExpiredEvent class. * @constructor - * Application Deleted event. + * Stateless Replica Health Report Expired event. * - * @member {string} applicationTypeName Application type name. - * @member {string} applicationTypeVersion Application type version. + * @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 ApplicationDeletedEvent extends ApplicationEvent { - applicationTypeName: string; - applicationTypeVersion: string; +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 ApplicationHealthReportCreatedEvent class. + * Initializes a new instance of the ClusterNewHealthReportEvent class. * @constructor - * Application Health Report Created event. + * Cluster 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. @@ -11511,8 +12518,7 @@ export interface ApplicationDeletedEvent extends ApplicationEvent { * @member {boolean} removeWhenExpired Indicates the removal when it expires. * @member {date} sourceUtcTimestamp Source time. */ -export interface ApplicationHealthReportCreatedEvent extends ApplicationEvent { - applicationInstanceId: number; +export interface ClusterNewHealthReportEvent extends ClusterEvent { sourceId: string; property: string; healthState: string; @@ -11525,11 +12531,10 @@ export interface ApplicationHealthReportCreatedEvent extends ApplicationEvent { /** * @class - * Initializes a new instance of the ApplicationHealthReportExpiredEvent class. + * Initializes a new instance of the ClusterHealthReportExpiredEvent class. * @constructor - * Application Health Report Expired event. + * Cluster 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. @@ -11539,8 +12544,7 @@ export interface ApplicationHealthReportCreatedEvent extends ApplicationEvent { * @member {boolean} removeWhenExpired Indicates the removal when it expires. * @member {date} sourceUtcTimestamp Source time. */ -export interface ApplicationHealthReportExpiredEvent extends ApplicationEvent { - applicationInstanceId: number; +export interface ClusterHealthReportExpiredEvent extends ClusterEvent { sourceId: string; property: string; healthState: string; @@ -11553,40 +12557,33 @@ export interface ApplicationHealthReportExpiredEvent extends ApplicationEvent { /** * @class - * Initializes a new instance of the ApplicationUpgradeCompleteEvent class. + * Initializes a new instance of the ClusterUpgradeCompletedEvent class. * @constructor - * Application Upgrade Complete event. + * Cluster Upgrade Completed event. * - * @member {string} applicationTypeName Application type name. - * @member {string} applicationTypeVersion Application type version. - * @member {number} overallUpgradeElapsedTimeInMs Overall upgrade time in - * milli-seconds. + * @member {string} targetClusterVersion Target Cluster version. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. */ -export interface ApplicationUpgradeCompleteEvent extends ApplicationEvent { - applicationTypeName: string; - applicationTypeVersion: string; +export interface ClusterUpgradeCompletedEvent extends ClusterEvent { + targetClusterVersion: string; overallUpgradeElapsedTimeInMs: number; } /** * @class - * Initializes a new instance of the ApplicationUpgradeDomainCompleteEvent class. + * Initializes a new instance of the ClusterUpgradeDomainCompletedEvent class. * @constructor - * Application Upgrade Domain Complete event. + * Cluster Upgrade Domain Completed event. * - * @member {string} applicationTypeName Application type name. - * @member {string} currentApplicationTypeVersion Current Application type - * version. - * @member {string} applicationTypeVersion Target Application type version. + * @member {string} targetClusterVersion Target Cluster version. * @member {string} upgradeState State of upgrade. * @member {string} upgradeDomains Upgrade domains. - * @member {number} upgradeDomainElapsedTimeInMs Upgrade time of domain in + * @member {number} upgradeDomainElapsedTimeInMs Duration of domain upgrade in * milli-seconds. */ -export interface ApplicationUpgradeDomainCompleteEvent extends ApplicationEvent { - applicationTypeName: string; - currentApplicationTypeVersion: string; - applicationTypeVersion: string; +export interface ClusterUpgradeDomainCompletedEvent extends ClusterEvent { + targetClusterVersion: string; upgradeState: string; upgradeDomains: string; upgradeDomainElapsedTimeInMs: number; @@ -11594,63 +12591,53 @@ export interface ApplicationUpgradeDomainCompleteEvent extends ApplicationEvent /** * @class - * Initializes a new instance of the ApplicationUpgradeRollbackCompleteEvent class. + * Initializes a new instance of the ClusterUpgradeRollbackCompletedEvent class. * @constructor - * Application Upgrade Rollback Complete event. + * Cluster Upgrade Rollback Completed 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. + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} failureReason Describes failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. */ -export interface ApplicationUpgradeRollbackCompleteEvent extends ApplicationEvent { - applicationTypeName: string; - applicationTypeVersion: string; +export interface ClusterUpgradeRollbackCompletedEvent extends ClusterEvent { + targetClusterVersion: string; failureReason: string; overallUpgradeElapsedTimeInMs: number; } /** * @class - * Initializes a new instance of the ApplicationUpgradeRollbackStartEvent class. + * Initializes a new instance of the ClusterUpgradeRollbackStartedEvent class. * @constructor - * Application Upgrade Rollback Start event. + * Cluster Upgrade Rollback Started 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. + * @member {string} targetClusterVersion Target Cluster version. + * @member {string} failureReason Describes failure. + * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade + * in milli-seconds. */ -export interface ApplicationUpgradeRollbackStartEvent extends ApplicationEvent { - applicationTypeName: string; - currentApplicationTypeVersion: string; - applicationTypeVersion: string; +export interface ClusterUpgradeRollbackStartedEvent extends ClusterEvent { + targetClusterVersion: string; failureReason: string; overallUpgradeElapsedTimeInMs: number; } /** * @class - * Initializes a new instance of the ApplicationUpgradeStartEvent class. + * Initializes a new instance of the ClusterUpgradeStartedEvent class. * @constructor - * Application Upgrade Start event. + * Cluster Upgrade Started event. * - * @member {string} applicationTypeName Application type name. - * @member {string} currentApplicationTypeVersion Current Application type - * version. - * @member {string} applicationTypeVersion Target Application type version. + * @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 ApplicationUpgradeStartEvent extends ApplicationEvent { - applicationTypeName: string; - currentApplicationTypeVersion: string; - applicationTypeVersion: string; +export interface ClusterUpgradeStartedEvent extends ClusterEvent { + currentClusterVersion: string; + targetClusterVersion: string; upgradeType: string; rollingUpgradeMode: string; failureAction: string; @@ -11658,1381 +12645,1168 @@ export interface ApplicationUpgradeStartEvent extends ApplicationEvent { /** * @class - * Initializes a new instance of the DeployedApplicationHealthReportCreatedEvent class. + * Initializes a new instance of the ChaosStoppedEvent class. * @constructor - * Deployed Application Health Report Created event. + * Chaos Stopped 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. + * @member {string} reason Describes reason. */ -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; +export interface ChaosStoppedEvent extends ClusterEvent { + reason: string; } /** * @class - * Initializes a new instance of the DeployedApplicationHealthReportExpiredEvent class. + * Initializes a new instance of the ChaosStartedEvent class. * @constructor - * Deployed Application Health Report Expired event. + * Chaos Started event. * - * @member {number} applicationInstanceId Id of Application instance. + * @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 ChaosCodePackageRestartScheduledEvent 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} 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. + * @member {string} serviceManifestName Service manifest name. + * @member {string} codePackageName Code package name. + * @member {string} servicePackageActivationId Id of Service package + * activation. */ -export interface DeployedApplicationHealthReportExpiredEvent extends ApplicationEvent { - applicationInstanceId: number; +export interface ChaosCodePackageRestartScheduledEvent extends ApplicationEvent { + faultGroupId: string; + faultId: string; nodeName: string; - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; + serviceManifestName: string; + codePackageName: string; + servicePackageActivationId: string; } /** * @class - * Initializes a new instance of the ProcessDeactivatedEvent class. + * Initializes a new instance of the ChaosReplicaRemovalScheduledEvent class. * @constructor - * Process Deactivated event. + * Chaos Remove Replica Fault Scheduled 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. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. + */ +export interface ChaosReplicaRemovalScheduledEvent extends ReplicaEvent { + faultGroupId: string; + faultId: string; + serviceUri: string; +} + +/** + * @class + * Initializes a new instance of the ChaosPartitionSecondaryMoveScheduledEvent 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 ProcessDeactivatedEvent extends ApplicationEvent { +export interface ChaosPartitionSecondaryMoveScheduledEvent extends PartitionEvent { + faultGroupId: string; + faultId: string; serviceName: string; - servicePackageName: string; - servicePackageActivationId: string; - isExclusive: boolean; - codePackageName: string; - entryPointType: string; - exeName: string; - processId: number; - hostId: string; - exitCode: number; - unexpectedTermination: boolean; - startTime: Date; + sourceNode: string; + destinationNode: string; + forcedMove: boolean; } /** * @class - * Initializes a new instance of the ContainerDeactivatedEvent class. + * Initializes a new instance of the ChaosPartitionPrimaryMoveScheduledEvent class. * @constructor - * Container Deactivated event. + * Chaos Move Primary Fault Scheduled 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. + * @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 ContainerDeactivatedEvent extends ApplicationEvent { +export interface ChaosPartitionPrimaryMoveScheduledEvent extends PartitionEvent { + faultGroupId: string; + faultId: string; serviceName: string; - servicePackageName: string; - servicePackageActivationId: string; - isExclusive: boolean; - codePackageName: string; - entryPointType: string; - imageName: string; - containerName: string; - hostId: string; - exitCode: number; - unexpectedTermination: boolean; - startTime: Date; + nodeTo: string; + forcedMove: boolean; } /** * @class - * Initializes a new instance of the NodeAbortedEvent class. + * Initializes a new instance of the ChaosReplicaRestartScheduledEvent class. * @constructor - * Node Aborted event. + * Chaos Restart Replica Fault Scheduled 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 {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. + * @member {string} serviceUri Service name. */ -export interface NodeAbortedEvent extends NodeEvent { - nodeInstance: number; - nodeId: string; - upgradeDomain: string; - faultDomain: string; - ipAddressOrFQDN: string; - hostname: string; - isSeedNode: boolean; - nodeVersion: string; +export interface ChaosReplicaRestartScheduledEvent extends ReplicaEvent { + faultGroupId: string; + faultId: string; + serviceUri: string; } /** * @class - * Initializes a new instance of the NodeAbortingEvent class. + * Initializes a new instance of the ChaosNodeRestartScheduledEvent class. * @constructor - * Node Aborting event. + * Chaos Restart Node Fault Scheduled 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 {number} nodeInstanceId Id of Node instance. + * @member {uuid} faultGroupId Id of fault group. + * @member {uuid} faultId Id of fault. */ -export interface NodeAbortingEvent extends NodeEvent { - nodeInstance: number; - nodeId: string; - upgradeDomain: string; - faultDomain: string; - ipAddressOrFQDN: string; - hostname: string; - isSeedNode: boolean; - nodeVersion: string; +export interface ChaosNodeRestartScheduledEvent extends NodeEvent { + nodeInstanceId: number; + faultGroupId: string; + faultId: string; } /** * @class - * Initializes a new instance of the NodeAddedEvent class. + * Initializes a new instance of the SecretResourcePropertiesBase class. * @constructor - * Node Added event. + * This type describes the properties of a secret resource, including its kind. * - * @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. + * @member {string} kind Polymorphic Discriminator */ -export interface NodeAddedEvent extends NodeEvent { - nodeId: string; - nodeInstance: number; - nodeType: string; - fabricVersion: string; - ipAddressOrFQDN: string; - nodeCapacities: string; +export interface SecretResourcePropertiesBase { + kind: string; } /** * @class - * Initializes a new instance of the NodeCloseEvent class. + * Initializes a new instance of the SecretResourceProperties class. * @constructor - * Node Close event. + * Describes the properties of a secret resource. * - * @member {string} nodeId Id of Node. - * @member {string} nodeInstance Id of Node instance. - * @member {string} error Describes error. + * @member {string} [description] User readable description of the secret. + * @member {string} [status] Status of the resource. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the secret. + * @member {string} [contentType] The type of the content stored in the secret + * value. The value of this property is opaque to Service Fabric. Once set, the + * value of this property cannot be changed. */ -export interface NodeCloseEvent extends NodeEvent { - nodeId: string; - nodeInstance: string; - error: string; +export interface SecretResourceProperties extends SecretResourcePropertiesBase { + description?: string; + readonly status?: string; + readonly statusDetails?: string; + contentType?: string; } /** * @class - * Initializes a new instance of the NodeClosingEvent class. + * Initializes a new instance of the InlinedValueSecretResourceProperties class. * @constructor - * Node Closing event. + * Describes the properties of a secret resource whose value is provided + * explicitly as plaintext. The secret resource may have multiple values, each + * being uniquely versioned. The secret value of each version is stored + * encrypted, and delivered as plaintext into the context of applications + * referencing it. * - * @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; +export interface InlinedValueSecretResourceProperties extends SecretResourceProperties { } /** * @class - * Initializes a new instance of the NodeDeactivateCompleteEvent class. + * Initializes a new instance of the SecretResourceDescription class. * @constructor - * Node Deactivate Complete event. + * This type describes a secret resource. * - * @member {number} nodeInstance Id of Node instance. - * @member {string} effectiveDeactivateIntent Describes deactivate intent. - * @member {string} batchIdsWithDeactivateIntent Batch Ids. - * @member {date} startTime Start time. + * @member {object} properties Describes the properties of a secret resource. + * @member {string} [properties.description] User readable description of the + * secret. + * @member {string} [properties.status] Status of the resource. Possible values + * include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [properties.statusDetails] Gives additional information + * about the current status of the secret. + * @member {string} [properties.contentType] The type of the content stored in + * the secret value. The value of this property is opaque to Service Fabric. + * Once set, the value of this property cannot be changed. + * @member {string} name Name of the Secret resource. */ -export interface NodeDeactivateCompleteEvent extends NodeEvent { - nodeInstance: number; - effectiveDeactivateIntent: string; - batchIdsWithDeactivateIntent: string; - startTime: Date; +export interface SecretResourceDescription { + properties: SecretResourceProperties; + name: string; } /** * @class - * Initializes a new instance of the NodeDeactivateStartEvent class. + * Initializes a new instance of the PagedSecretResourceDescriptionList class. * @constructor - * Node Deactivate Start event. + * The list of secret resources. 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 {number} nodeInstance Id of Node instance. - * @member {string} batchId Batch Id. - * @member {string} deactivateIntent Describes deactivate intent. + * @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] One page of the list. */ -export interface NodeDeactivateStartEvent extends NodeEvent { - nodeInstance: number; - batchId: string; - deactivateIntent: string; +export interface PagedSecretResourceDescriptionList { + continuationToken?: string; + items?: SecretResourceDescription[]; } /** * @class - * Initializes a new instance of the NodeDownEvent class. + * Initializes a new instance of the SecretValue class. * @constructor - * Node Down event. + * This type represents the unencrypted value of the secret. * - * @member {number} nodeInstance Id of Node instance. - * @member {date} lastNodeUpAt Time when Node was last up. + * @member {string} [value] The actual value of the secret. */ -export interface NodeDownEvent extends NodeEvent { - nodeInstance: number; - lastNodeUpAt: Date; +export interface SecretValue { + value?: string; } /** * @class - * Initializes a new instance of the NodeHealthReportCreatedEvent class. + * Initializes a new instance of the SecretValueProperties class. * @constructor - * Node Health Report Created event. + * This type describes properties of secret value resource. * - * @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. + * @member {string} [value] The actual value of the secret. */ -export interface NodeHealthReportCreatedEvent extends NodeEvent { - nodeInstanceId: number; - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface SecretValueProperties { + value?: string; } /** * @class - * Initializes a new instance of the NodeHealthReportExpiredEvent class. + * Initializes a new instance of the SecretValueResourceDescription class. * @constructor - * Node Health Report Expired event. + * This type describes a value of a secret resource. The name of this resource + * is the version identifier corresponding to this secret value. * - * @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. + * @member {string} name Version identifier of the secret value. + * @member {string} [value] The actual value of the secret. */ -export interface NodeHealthReportExpiredEvent extends NodeEvent { - nodeInstanceId: number; - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface SecretValueResourceDescription { + name: string; + value?: string; } /** * @class - * Initializes a new instance of the NodeOpenedSuccessEvent class. + * Initializes a new instance of the PagedSecretValueResourceDescriptionList class. * @constructor - * Node Opened Success event. + * The list of values of a secret resource, paged if the number of results + * exceeds the limits of a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * the previous page. * - * @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} [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] One page of the list. */ -export interface NodeOpenedSuccessEvent extends NodeEvent { - nodeInstance: number; - nodeId: string; - upgradeDomain: string; - faultDomain: string; - ipAddressOrFQDN: string; - hostname: string; - isSeedNode: boolean; - nodeVersion: string; +export interface PagedSecretValueResourceDescriptionList { + continuationToken?: string; + items?: SecretValueResourceDescription[]; } /** * @class - * Initializes a new instance of the NodeOpenFailedEvent class. + * Initializes a new instance of the VolumeProviderParametersAzureFile class. * @constructor - * Node Open Failed event. + * This type describes a volume provided by an Azure Files file share. * - * @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. + * @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 NodeOpenFailedEvent extends NodeEvent { - nodeInstance: number; - nodeId: string; - upgradeDomain: string; - faultDomain: string; - ipAddressOrFQDN: string; - hostname: string; - isSeedNode: boolean; - nodeVersion: string; - error: string; +export interface VolumeProviderParametersAzureFile { + accountName: string; + accountKey?: string; + shareName: string; } /** * @class - * Initializes a new instance of the NodeOpeningEvent class. + * Initializes a new instance of the VolumeReference class. * @constructor - * Node Opening event. + * Describes a reference to a volume resource. * - * @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} name Name of the volume being referenced. + * @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 NodeOpeningEvent extends NodeEvent { - nodeInstance: number; - nodeId: string; - upgradeDomain: string; - faultDomain: string; - ipAddressOrFQDN: string; - hostname: string; - isSeedNode: boolean; - nodeVersion: string; +export interface VolumeReference { + name: string; + readOnly?: boolean; + destinationPath: string; } /** * @class - * Initializes a new instance of the NodeRemovedEvent class. + * Initializes a new instance of the ApplicationScopedVolumeCreationParameters class. * @constructor - * Node Removed event. + * Describes parameters for creating application-scoped volumes. * - * @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. + * @member {string} [description] User readable description of the volume. + * @member {string} kind Polymorphic Discriminator */ -export interface NodeRemovedEvent extends NodeEvent { - nodeId: string; - nodeInstance: number; - nodeType: string; - fabricVersion: string; - ipAddressOrFQDN: string; - nodeCapacities: string; +export interface ApplicationScopedVolumeCreationParameters { + description?: string; + kind: string; } /** * @class - * Initializes a new instance of the NodeUpEvent class. + * Initializes a new instance of the ApplicationScopedVolume class. * @constructor - * Node Up event. + * Describes a volume whose lifetime is scoped to the application's lifetime. * - * @member {number} nodeInstance Id of Node instance. - * @member {date} lastNodeDownAt Time when Node was last down. + * @member {object} creationParameters Describes parameters for creating + * application-scoped volumes. + * @member {string} [creationParameters.description] User readable description + * of the volume. + * @member {string} [creationParameters.kind] Polymorphic Discriminator */ -export interface NodeUpEvent extends NodeEvent { - nodeInstance: number; - lastNodeDownAt: Date; +export interface ApplicationScopedVolume extends VolumeReference { + creationParameters: ApplicationScopedVolumeCreationParameters; } /** * @class - * Initializes a new instance of the PartitionHealthReportCreatedEvent class. + * Initializes a new instance of the ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk class. * @constructor - * Partition Health Report Created event. + * Describes parameters for creating application-scoped volumes provided by + * Service Fabric Volume Disks * - * @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. + * @member {string} sizeDisk Volume size. Possible values include: 'Small', + * 'Medium', 'Large' */ -export interface PartitionHealthReportCreatedEvent extends PartitionEvent { - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk extends ApplicationScopedVolumeCreationParameters { + sizeDisk: string; } /** * @class - * Initializes a new instance of the PartitionHealthReportExpiredEvent class. + * Initializes a new instance of the VolumeResourceDescription class. * @constructor - * Partition Health Report Expired event. + * This type describes a volume resource. * - * @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. + * @member {string} name Name of the Volume resource. + * @member {string} [description] User readable description of the volume. + * @member {string} [status] Status of the volume. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status 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. */ -export interface PartitionHealthReportExpiredEvent extends PartitionEvent { - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface VolumeResourceDescription { + name: string; + description?: string; + readonly status?: string; + readonly statusDetails?: string; + azureFileParameters?: VolumeProviderParametersAzureFile; } /** * @class - * Initializes a new instance of the PartitionReconfigurationCompletedEvent class. + * Initializes a new instance of the PagedVolumeResourceDescriptionList class. * @constructor - * Partition Reconfiguration Completed event. + * The list of volume resources. 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} 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. + * @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] One page of the list. */ -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; +export interface PagedVolumeResourceDescriptionList { + continuationToken?: string; + items?: VolumeResourceDescription[]; } /** * @class - * Initializes a new instance of the PartitionPrimaryMoveAnalysisEvent class. + * Initializes a new instance of the NetworkResourcePropertiesBase class. * @constructor - * Partition Primary Move Analysis event. + * This type describes the properties of a network resource, including its + * kind. * - * @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. + * @member {string} kind Polymorphic Discriminator */ -export interface PartitionPrimaryMoveAnalysisEvent extends PartitionAnalysisEvent { - whenMoveCompleted: Date; - previousNode: string; - currentNode: string; - moveReason: string; - relevantTraces: string; +export interface NetworkResourcePropertiesBase { + kind: string; } /** * @class - * Initializes a new instance of the ServiceCreatedEvent class. + * Initializes a new instance of the NetworkResourceProperties class. * @constructor - * Service Created event. + * Describes properties of a network resource. * - * @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. + * @member {string} [description] User readable description of the network. + * @member {string} [status] Status of the network. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the network. */ -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; +export interface NetworkResourceProperties extends NetworkResourcePropertiesBase { + description?: string; + readonly status?: string; + readonly statusDetails?: string; } /** * @class - * Initializes a new instance of the ServiceDeletedEvent class. + * Initializes a new instance of the LocalNetworkResourceProperties class. * @constructor - * Service Deleted event. + * Information about a Service Fabric container network local to a single + * Service Fabric cluster. * - * @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 {string} [networkAddressPrefix] Address space for the local + * container network. */ -export interface ServiceDeletedEvent extends ServiceEvent { - serviceTypeName: string; - applicationName: string; - applicationTypeName: string; - serviceInstance: number; - isStateful: boolean; - partitionCount: number; - targetReplicaSetSize: number; - minReplicaSetSize: number; - servicePackageVersion: string; +export interface LocalNetworkResourceProperties extends NetworkResourceProperties { + networkAddressPrefix?: string; } /** * @class - * Initializes a new instance of the ServiceHealthReportCreatedEvent class. + * Initializes a new instance of the EndpointRef class. * @constructor - * Service Health Report Created event. + * Describes a reference to a service endpoint. * - * @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. + * @member {string} [name] Name of the endpoint. */ -export interface ServiceHealthReportCreatedEvent extends ServiceEvent { - instanceId: number; - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface EndpointRef { + name?: string; } /** * @class - * Initializes a new instance of the ServiceHealthReportExpiredEvent class. + * Initializes a new instance of the NetworkRef class. * @constructor - * Service Health Report Expired event. + * Describes a network reference in a service. * - * @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. + * @member {string} [name] Name of the network + * @member {array} [endpointRefs] A list of endpoints that are exposed on this + * network. */ -export interface ServiceHealthReportExpiredEvent extends ServiceEvent { - instanceId: number; - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface NetworkRef { + name?: string; + endpointRefs?: EndpointRef[]; } /** * @class - * Initializes a new instance of the DeployedServiceHealthReportCreatedEvent class. + * Initializes a new instance of the NetworkResourceDescription class. * @constructor - * Deployed Service Health Report Created event. + * This type describes a network resource. * - * @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. + * @member {string} name Name of the Network resource. + * @member {object} properties Describes properties of a network resource. + * @member {string} [properties.description] User readable description of the + * network. + * @member {string} [properties.status] Status of the network. Possible values + * include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [properties.statusDetails] Gives additional information + * about the current status of the network. */ -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; +export interface NetworkResourceDescription { + name: string; + properties: NetworkResourceProperties; } /** * @class - * Initializes a new instance of the DeployedServiceHealthReportExpiredEvent class. + * Initializes a new instance of the PagedNetworkResourceDescriptionList class. * @constructor - * Deployed Service Health Report Expired event. + * The list of network resources. 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} 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. + * @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] One page of the list. */ -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; +export interface PagedNetworkResourceDescriptionList { + continuationToken?: string; + items?: NetworkResourceDescription[]; } /** * @class - * Initializes a new instance of the StatefulReplicaHealthReportCreatedEvent class. + * Initializes a new instance of the GatewayDestination class. * @constructor - * Stateful Replica Health Report Created event. + * Describes destination endpoint for routing traffic. * - * @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. + * @member {string} applicationName Name of the service fabric Mesh + * application. + * @member {string} serviceName service that contains the endpoint. + * @member {string} endpointName name of the endpoint in the service. */ -export interface StatefulReplicaHealthReportCreatedEvent extends ReplicaEvent { - replicaInstanceId: number; - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface GatewayDestination { + applicationName: string; + serviceName: string; + endpointName: string; } /** * @class - * Initializes a new instance of the StatefulReplicaHealthReportExpiredEvent class. + * Initializes a new instance of the TcpConfig class. * @constructor - * Stateful Replica Health Report Expired event. + * Describes the tcp configuration for external connectivity for this network. * - * @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. + * @member {string} name tcp gateway config name. + * @member {number} port Specifies the port at which the service endpoint below + * needs to be exposed. + * @member {object} destination Describes destination endpoint for routing + * traffic. + * @member {string} [destination.applicationName] Name of the service fabric + * Mesh application. + * @member {string} [destination.serviceName] service that contains the + * endpoint. + * @member {string} [destination.endpointName] name of the endpoint in the + * service. */ -export interface StatefulReplicaHealthReportExpiredEvent extends ReplicaEvent { - replicaInstanceId: number; - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface TcpConfig { + name: string; + port: number; + destination: GatewayDestination; } /** * @class - * Initializes a new instance of the StatelessReplicaHealthReportCreatedEvent class. + * Initializes a new instance of the HttpRouteMatchPath class. * @constructor - * Stateless Replica Health Report Created event. + * Path to match for routing. * - * @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. + * @member {string} value Uri path to match for request. + * @member {string} [rewrite] replacement string for matched part of the Uri. */ -export interface StatelessReplicaHealthReportCreatedEvent extends ReplicaEvent { - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface HttpRouteMatchPath { + value: string; + rewrite?: string; } /** * @class - * Initializes a new instance of the StatelessReplicaHealthReportExpiredEvent class. + * Initializes a new instance of the HttpRouteMatchHeader class. * @constructor - * Stateless Replica Health Report Expired event. + * Describes header information for http route matching. * - * @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. + * @member {string} name Name of header to match in request. + * @member {string} [value] Value of header to match in request. + * @member {string} [type] how to match header value. Possible values include: + * 'exact' */ -export interface StatelessReplicaHealthReportExpiredEvent extends ReplicaEvent { - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface HttpRouteMatchHeader { + name: string; + value?: string; + type?: string; } /** * @class - * Initializes a new instance of the ClusterHealthReportCreatedEvent class. + * Initializes a new instance of the HttpRouteMatchRule class. * @constructor - * Cluster Health Report Created event. + * Describes a rule for http route matching. * - * @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. + * @member {object} path Path to match for routing. + * @member {string} [path.value] Uri path to match for request. + * @member {string} [path.rewrite] replacement string for matched part of the + * Uri. + * @member {array} [headers] headers and their values to match in request. */ -export interface ClusterHealthReportCreatedEvent extends ClusterEvent { - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface HttpRouteMatchRule { + path: HttpRouteMatchPath; + headers?: HttpRouteMatchHeader[]; } /** * @class - * Initializes a new instance of the ClusterHealthReportExpiredEvent class. + * Initializes a new instance of the HttpRouteConfig class. * @constructor - * Cluster Health Report Expired event. + * Describes the hostname properties for http routing. * - * @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. + * @member {string} name http route name. + * @member {object} match Describes a rule for http route matching. + * @member {object} [match.path] Path to match for routing. + * @member {string} [match.path.value] Uri path to match for request. + * @member {string} [match.path.rewrite] replacement string for matched part of + * the Uri. + * @member {array} [match.headers] headers and their values to match in + * request. + * @member {object} destination Describes destination endpoint for routing + * traffic. + * @member {string} [destination.applicationName] Name of the service fabric + * Mesh application. + * @member {string} [destination.serviceName] service that contains the + * endpoint. + * @member {string} [destination.endpointName] name of the endpoint in the + * service. */ -export interface ClusterHealthReportExpiredEvent extends ClusterEvent { - sourceId: string; - property: string; - healthState: string; - timeToLiveMs: number; - sequenceNumber: number; - description: string; - removeWhenExpired: boolean; - sourceUtcTimestamp: Date; +export interface HttpRouteConfig { + name: string; + match: HttpRouteMatchRule; + destination: GatewayDestination; } /** * @class - * Initializes a new instance of the ClusterUpgradeCompleteEvent class. + * Initializes a new instance of the HttpHostConfig class. * @constructor - * Cluster Upgrade Complete event. + * Describes the hostname properties for http routing. * - * @member {string} targetClusterVersion Target Cluster version. - * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade - * in milli-seconds. + * @member {string} name http hostname config name. + * @member {array} routes Route information to use for routing. Routes are + * processed in the order they are specified. Specify routes that are more + * specific before routes that can hamdle general cases. */ -export interface ClusterUpgradeCompleteEvent extends ClusterEvent { - targetClusterVersion: string; - overallUpgradeElapsedTimeInMs: number; +export interface HttpHostConfig { + name: string; + routes: HttpRouteConfig[]; } /** * @class - * Initializes a new instance of the ClusterUpgradeDomainCompleteEvent class. + * Initializes a new instance of the HttpConfig class. * @constructor - * Cluster Upgrade Domain Complete event. + * Describes the http configuration for external connectivity for this network. * - * @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. + * @member {string} name http gateway config name. + * @member {number} port Specifies the port at which the service endpoint below + * needs to be exposed. + * @member {array} hosts description for routing. */ -export interface ClusterUpgradeDomainCompleteEvent extends ClusterEvent { - targetClusterVersion: string; - upgradeState: string; - upgradeDomains: string; - upgradeDomainElapsedTimeInMs: number; +export interface HttpConfig { + name: string; + port: number; + hosts: HttpHostConfig[]; } /** * @class - * Initializes a new instance of the ClusterUpgradeRollbackCompleteEvent class. + * Initializes a new instance of the GatewayResourceDescription class. * @constructor - * Cluster Upgrade Rollback Complete event. + * This type describes a gateway resource. * - * @member {string} targetClusterVersion Target Cluster version. - * @member {string} failureReason Describes failure. - * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade - * in milli-seconds. + * @member {string} name Name of the Gateway resource. + * @member {string} [description] User readable description of the gateway. + * @member {object} sourceNetwork Network the gateway should listen on for + * requests. + * @member {string} [sourceNetwork.name] Name of the network + * @member {array} [sourceNetwork.endpointRefs] A list of endpoints that are + * exposed on this network. + * @member {object} destinationNetwork Network that the Application is using. + * @member {string} [destinationNetwork.name] Name of the network + * @member {array} [destinationNetwork.endpointRefs] A list of endpoints that + * are exposed on this network. + * @member {array} [tcp] Configuration for tcp connectivity for this gateway. + * @member {array} [http] Configuration for http connectivity for this gateway. + * @member {string} [status] Status of the resource. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the gateway. + * @member {string} [ipAddress] IP address of the gateway. This is populated in + * the response and is ignored for incoming requests. */ -export interface ClusterUpgradeRollbackCompleteEvent extends ClusterEvent { - targetClusterVersion: string; - failureReason: string; - overallUpgradeElapsedTimeInMs: number; +export interface GatewayResourceDescription { + name: string; + description?: string; + sourceNetwork: NetworkRef; + destinationNetwork: NetworkRef; + tcp?: TcpConfig[]; + http?: HttpConfig[]; + readonly status?: string; + readonly statusDetails?: string; + readonly ipAddress?: string; } /** * @class - * Initializes a new instance of the ClusterUpgradeRollbackStartEvent class. + * Initializes a new instance of the PagedGatewayResourceDescriptionList class. * @constructor - * Cluster Upgrade Rollback Start event. + * The list of gateway resources. 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} targetClusterVersion Target Cluster version. - * @member {string} failureReason Describes failure. - * @member {number} overallUpgradeElapsedTimeInMs Overall duration of upgrade - * in milli-seconds. + * @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] One page of the list. */ -export interface ClusterUpgradeRollbackStartEvent extends ClusterEvent { - targetClusterVersion: string; - failureReason: string; - overallUpgradeElapsedTimeInMs: number; +export interface PagedGatewayResourceDescriptionList { + continuationToken?: string; + items?: GatewayResourceDescription[]; } /** * @class - * Initializes a new instance of the ClusterUpgradeStartEvent class. + * Initializes a new instance of the ImageRegistryCredential class. * @constructor - * Cluster Upgrade Start event. + * Image registry credential. * - * @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. + * @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. The + * password is required for create or update operations, however it is not + * returned in the get or list operations. */ -export interface ClusterUpgradeStartEvent extends ClusterEvent { - currentClusterVersion: string; - targetClusterVersion: string; - upgradeType: string; - rollingUpgradeMode: string; - failureAction: string; +export interface ImageRegistryCredential { + server: string; + username: string; + password?: string; } /** * @class - * Initializes a new instance of the ChaosStoppedEvent class. + * Initializes a new instance of the EnvironmentVariable class. * @constructor - * Chaos Stopped event. + * Describes an environment variable for the container. * - * @member {string} reason Describes reason. + * @member {string} [name] The name of the environment variable. + * @member {string} [value] The value of the environment variable. */ -export interface ChaosStoppedEvent extends ClusterEvent { - reason: string; +export interface EnvironmentVariable { + name?: string; + value?: string; } /** * @class - * Initializes a new instance of the ChaosStartedEvent class. + * Initializes a new instance of the Setting class. * @constructor - * Chaos Started event. + * Describes a setting for the 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 {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. + * @member {string} [name] The name of the setting. + * @member {string} [value] The value of the setting. */ -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; +export interface Setting { + name?: string; + value?: string; } /** * @class - * Initializes a new instance of the ChaosRestartNodeFaultCompletedEvent class. + * Initializes a new instance of the ContainerLabel class. * @constructor - * Chaos Restart Node Fault Completed event. + * Describes a container label. * - * @member {number} nodeInstanceId Id of Node instance. - * @member {uuid} faultGroupId Id of fault group. - * @member {uuid} faultId Id of fault. + * @member {string} name The name of the container label. + * @member {string} value The value of the container label. */ -export interface ChaosRestartNodeFaultCompletedEvent extends NodeEvent { - nodeInstanceId: number; - faultGroupId: string; - faultId: string; +export interface ContainerLabel { + name: string; + value: string; } /** * @class - * Initializes a new instance of the ChaosRestartCodePackageFaultScheduledEvent class. + * Initializes a new instance of the EndpointProperties class. * @constructor - * Chaos Restart Code Package Fault Scheduled event. + * Describes a container endpoint. * - * @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. + * @member {string} name The name of the endpoint. + * @member {number} [port] Port used by the container. */ -export interface ChaosRestartCodePackageFaultScheduledEvent extends ApplicationEvent { - faultGroupId: string; - faultId: string; - nodeName: string; - serviceManifestName: string; - codePackageName: string; - servicePackageActivationId: string; +export interface EndpointProperties { + name: string; + port?: number; } /** * @class - * Initializes a new instance of the ChaosRestartCodePackageFaultCompletedEvent class. + * Initializes a new instance of the ResourceRequests class. * @constructor - * Chaos Restart Code Package Fault Completed event. + * 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 {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. + * @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 ChaosRestartCodePackageFaultCompletedEvent extends ApplicationEvent { - faultGroupId: string; - faultId: string; - nodeName: string; - serviceManifestName: string; - codePackageName: string; - servicePackageActivationId: string; +export interface ResourceRequests { + memoryInGB: number; + cpu: number; } /** * @class - * Initializes a new instance of the ChaosRemoveReplicaFaultScheduledEvent class. + * Initializes a new instance of the ResourceLimits class. * @constructor - * Chaos Remove Replica Fault Scheduled event. + * 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. * - * @member {uuid} faultGroupId Id of fault group. - * @member {uuid} faultId Id of fault. - * @member {string} serviceUri Service name. + * @member {number} [memoryInGB] The memory limit in GB. + * @member {number} [cpu] CPU limits in cores. At present, only full cores are + * supported. */ -export interface ChaosRemoveReplicaFaultScheduledEvent extends ReplicaEvent { - faultGroupId: string; - faultId: string; - serviceUri: string; +export interface ResourceLimits { + memoryInGB?: number; + cpu?: number; } /** * @class - * Initializes a new instance of the ChaosRemoveReplicaFaultCompletedEvent class. + * Initializes a new instance of the ResourceRequirements class. * @constructor - * Chaos Remove Replica Fault Completed event. + * This type describes the resource requirements for a container or a service. * - * @member {uuid} faultGroupId Id of fault group. - * @member {uuid} faultId Id of fault. - * @member {string} serviceUri Service name. + * @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 ChaosRemoveReplicaFaultCompletedEvent extends ReplicaEvent { - faultGroupId: string; - faultId: string; - serviceUri: string; +export interface ResourceRequirements { + requests: ResourceRequests; + limits?: ResourceLimits; } /** * @class - * Initializes a new instance of the ChaosMoveSecondaryFaultScheduledEvent class. + * Initializes a new instance of the DiagnosticsRef class. * @constructor - * Chaos Move Secondary Fault Scheduled event. + * Reference to sinks in DiagnosticsDescription. * - * @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. + * @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 ChaosMoveSecondaryFaultScheduledEvent extends PartitionEvent { - faultGroupId: string; - faultId: string; - serviceName: string; - sourceNode: string; - destinationNode: string; - forcedMove: boolean; +export interface DiagnosticsRef { + enabled?: boolean; + sinkRefs?: string[]; } /** * @class - * Initializes a new instance of the ChaosMovePrimaryFaultScheduledEvent class. + * Initializes a new instance of the ReliableCollectionsRef class. * @constructor - * Chaos Move Primary Fault Scheduled event. + * Specifying this parameter adds support for reliable collections * - * @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. + * @member {string} name Name of ReliableCollection resource. Right now it's + * not used and you can use any string. + * @member {boolean} [doNotPersistState] False (the default) if + * ReliableCollections state is persisted to disk as usual. True if you do not + * want to persist state, in which case replication is still enabled and you + * can use ReliableCollections as distributed cache. */ -export interface ChaosMovePrimaryFaultScheduledEvent extends PartitionEvent { - faultGroupId: string; - faultId: string; - serviceName: string; - nodeTo: string; - forcedMove: boolean; +export interface ReliableCollectionsRef { + name: string; + doNotPersistState?: boolean; } /** * @class - * Initializes a new instance of the ChaosRestartReplicaFaultScheduledEvent class. + * Initializes a new instance of the ContainerState class. * @constructor - * Chaos Restart Replica Fault Scheduled event. + * The container state. * - * @member {uuid} faultGroupId Id of fault group. - * @member {uuid} faultId Id of fault. - * @member {string} serviceUri Service name. + * @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 ChaosRestartReplicaFaultScheduledEvent extends ReplicaEvent { - faultGroupId: string; - faultId: string; - serviceUri: string; +export interface ContainerState { + state?: string; + startTime?: Date; + exitCode?: string; + finishTime?: Date; + detailStatus?: string; } /** * @class - * Initializes a new instance of the ChaosRestartNodeFaultScheduledEvent class. + * Initializes a new instance of the ContainerEvent class. * @constructor - * Chaos Restart Node Fault Scheduled event. + * A container event. * - * @member {number} nodeInstanceId Id of Node instance. - * @member {uuid} faultGroupId Id of fault group. - * @member {uuid} faultId Id of fault. + * @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 ChaosRestartNodeFaultScheduledEvent extends NodeEvent { - nodeInstanceId: number; - faultGroupId: string; - faultId: string; +export interface ContainerEvent { + name?: string; + count?: number; + firstTimestamp?: string; + lastTimestamp?: string; + message?: string; + type?: string; } /** * @class - * Initializes a new instance of the ServiceResourceDescription class. + * Initializes a new instance of the ContainerInstanceView class. * @constructor - * Describes a service fabric service resource. + * Runtime information of a container instance. * - * @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. + * @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 ServiceResourceDescription { - osType: string; - codePackages: ContainerCodePackageProperties[]; - networkRefs?: NetworkRef[]; - diagnostics?: DiagnosticsRef; - description?: string; - replicaCount?: number; - healthState?: string; - readonly status?: string; - name: string; +export interface ContainerInstanceView { + restartCount?: number; + currentState?: ContainerState; + previousState?: ContainerState; + events?: ContainerEvent[]; } /** * @class - * Initializes a new instance of the DiagnosticsSinkProperties class. + * Initializes a new instance of the ContainerCodePackageProperties class. * @constructor - * Properties of a DiagnosticsSink. + * Describes a container and its runtime properties. * - * @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 + * @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. The password is required for create or update operations, + * however it is not returned in the get or list operations. + * @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 The resources required by this container. + * @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] Volumes to be attached to the container. The + * lifetime of these volumes is independent of the application's lifetime. + * @member {array} [volumes] Volumes to be attached to the container. The + * lifetime of these volumes is scoped to the application's lifetime. + * @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 {array} [reliableCollectionsRefs] A list of ReliableCollection + * resources used by this particular code package. Please refer to + * ReliablecollectionsRef for more details. + * @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. */ -export interface DiagnosticsSinkProperties { - name?: string; - description?: string; - kind: string; +export interface ContainerCodePackageProperties { + name: string; + image: string; + imageRegistryCredential?: ImageRegistryCredential; + entrypoint?: string; + commands?: string[]; + environmentVariables?: EnvironmentVariable[]; + settings?: Setting[]; + labels?: ContainerLabel[]; + endpoints?: EndpointProperties[]; + resources: ResourceRequirements; + volumeRefs?: VolumeReference[]; + volumes?: ApplicationScopedVolume[]; + diagnostics?: DiagnosticsRef; + reliableCollectionsRefs?: ReliableCollectionsRef[]; + readonly instanceView?: ContainerInstanceView; } /** * @class - * Initializes a new instance of the DiagnosticsDescription class. + * Initializes a new instance of the AutoScalingTrigger class. * @constructor - * Describes the diagnostics options available + * Describes the trigger for performing auto scaling operation. * - * @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. + * @member {string} kind Polymorphic Discriminator */ -export interface DiagnosticsDescription { - sinks?: DiagnosticsSinkProperties[]; - enabled?: boolean; - defaultSinkRefs?: string[]; +export interface AutoScalingTrigger { + kind: string; } /** * @class - * Initializes a new instance of the ApplicationResourceDescription class. + * Initializes a new instance of the AutoScalingMechanism class. * @constructor - * Describes a service fabric application resource. + * Describes the mechanism for performing auto scaling operation. Derived + * classes will describe the actual mechanism. * - * @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. + * @member {string} kind Polymorphic Discriminator */ -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; +export interface AutoScalingMechanism { + kind: string; } /** * @class - * Initializes a new instance of the PagedServiceResourceDescriptionList class. + * Initializes a new instance of the AutoScalingPolicy 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. + * Describes the auto scaling policy * - * @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. + * @member {string} name The name of the auto scaling policy. + * @member {object} trigger Determines when auto scaling operation will be + * invoked. + * @member {string} [trigger.kind] Polymorphic Discriminator + * @member {object} mechanism The mechanism that is used to scale when auto + * scaling operation is invoked. + * @member {string} [mechanism.kind] Polymorphic Discriminator */ -export interface PagedServiceResourceDescriptionList { - continuationToken?: string; - items?: ServiceResourceDescription[]; +export interface AutoScalingPolicy { + name: string; + trigger: AutoScalingTrigger; + mechanism: AutoScalingMechanism; } /** * @class - * Initializes a new instance of the ServiceReplicaProperties class. + * Initializes a new instance of the ServiceResourceDescription class. * @constructor - * Describes the properties of a service replica. + * This type describes a service resource. * - * @member {string} osType The Operating system type required by the code in + * @member {string} name Name of the Service resource. + * @member {string} osType The operation system 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 @@ -13045,431 +13819,341 @@ export interface PagedServiceResourceDescriptionList { * 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 {array} [autoScalingPolicies] Auto scaling policies + * @member {string} [status] Status of the service. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the service. + * @member {string} [healthState] Describes the health state of an application + * resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * @member {string} [unhealthyEvaluation] When the service's health state is + * not 'Ok', this additional details from service fabric Health Manager for the + * user to know why the service is marked unhealthy. */ -export interface ServiceReplicaProperties { +export interface ServiceResourceDescription { + name: string; 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. - * - * @member {string} replicaName Name of the replica. - */ -export interface ServiceResourceReplicaDescription extends ServiceReplicaProperties { - replicaName: string; -} - -/** - * @class - * Initializes a new instance of the PagedServiceResourceReplicaDescriptionList 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 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} [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 VolumeResourceDescription { description?: string; - azureFileParameters?: VolumeProviderParametersAzureFile; - name: string; -} - -/** - * @class - * Initializes a new instance of the ImageRegistryCredential class. - * @constructor - * Image registry credential. - * - * @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; + replicaCount?: number; + autoScalingPolicies?: AutoScalingPolicy[]; + readonly status?: string; + readonly statusDetails?: string; + readonly healthState?: string; + readonly unhealthyEvaluation?: string; } /** * @class - * Initializes a new instance of the EnvironmentVariable class. + * Initializes a new instance of the DiagnosticsSinkProperties class. * @constructor - * Describes an environment variable for the container. + * Properties of a DiagnosticsSink. * - * @member {string} [name] The name of the environment variable. - * @member {string} [value] The value of the environment variable. + * @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 EnvironmentVariable { +export interface DiagnosticsSinkProperties { name?: string; - value?: string; + description?: string; + kind: string; } /** * @class - * Initializes a new instance of the Setting class. + * Initializes a new instance of the DiagnosticsDescription class. * @constructor - * Describes a setting for the container. + * Describes the diagnostics options available * - * @member {string} [name] The name of the setting. - * @member {string} [value] The value of the setting. + * @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 Setting { - name?: string; - value?: string; +export interface DiagnosticsDescription { + sinks?: DiagnosticsSinkProperties[]; + enabled?: boolean; + defaultSinkRefs?: string[]; } /** * @class - * Initializes a new instance of the ContainerLabel class. + * Initializes a new instance of the AzureInternalMonitoringPipelineSinkDescription class. * @constructor - * Describes a container label. + * Diagnostics settings for Geneva. * - * @member {string} name The name of the container label. - * @member {string} value The value of the container label. + * @member {string} [accountName] Azure Internal monitoring pipeline account. + * @member {string} [namespace] Azure Internal monitoring pipeline account + * namespace. + * @member {string} [maConfigUrl] Azure Internal monitoring agent + * configuration. + * @member {object} [fluentdConfigUrl] Azure Internal monitoring agent fluentd + * configuration. + * @member {string} [autoKeyConfigUrl] Azure Internal monitoring pipeline + * autokey associated with the certificate. */ -export interface ContainerLabel { - name: string; - value: string; +export interface AzureInternalMonitoringPipelineSinkDescription extends DiagnosticsSinkProperties { + accountName?: string; + namespace?: string; + maConfigUrl?: string; + fluentdConfigUrl?: any; + autoKeyConfigUrl?: string; } /** * @class - * Initializes a new instance of the EndpointProperties class. + * Initializes a new instance of the AddRemoveReplicaScalingMechanism class. * @constructor - * Describes a container endpoint. + * Describes the horizontal auto scaling mechanism that adds or removes + * replicas (containers or container groups). * - * @member {string} name The name of the endpoint. - * @member {number} [port] Port used by the container. + * @member {number} minCount Minimum number of containers (scale down won't be + * performed below this number). + * @member {number} maxCount Maximum number of containers (scale up won't be + * performed above this number). + * @member {number} scaleIncrement Each time auto scaling is performed, this + * number of containers will be added or removed. */ -export interface EndpointProperties { - name: string; - port?: number; +export interface AddRemoveReplicaScalingMechanism extends AutoScalingMechanism { + minCount: number; + maxCount: number; + scaleIncrement: number; } /** * @class - * Initializes a new instance of the ResourceRequests class. + * Initializes a new instance of the AutoScalingMetric 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. + * Describes the metric that is used for triggering auto scaling operation. + * Derived classes will describe resources or metrics. * - * @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. + * @member {string} kind Polymorphic Discriminator */ -export interface ResourceRequests { - memoryInGB: number; - cpu: number; +export interface AutoScalingMetric { + kind: string; } /** * @class - * Initializes a new instance of the ResourceLimits class. + * Initializes a new instance of the AutoScalingResourceMetric class. * @constructor - * 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. + * Describes the resource that is used for triggering auto scaling. * - * @member {number} [memoryInGB] The memory limit in GB. - * @member {number} [cpu] CPU limits in cores. At present, only full cores are - * supported. + * @member {string} name Name of the resource. Possible values include: 'cpu', + * 'memoryInGB' */ -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 AutoScalingResourceMetric extends AutoScalingMetric { + name: string; +} + +/** + * @class + * Initializes a new instance of the ServiceProperties class. + * @constructor + * Describes properties of a service resource. + * + * @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 {array} [autoScalingPolicies] Auto scaling policies + * @member {string} [status] Status of the service. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the service. + * @member {string} [healthState] Describes the health state of an application + * resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown' + * @member {string} [unhealthyEvaluation] When the service's health state is + * not 'Ok', this additional details from service fabric Health Manager for the + * user to know why the service is marked unhealthy. */ -export interface ResourceRequirements { - requests: ResourceRequests; - limits?: ResourceLimits; +export interface ServiceProperties { + description?: string; + replicaCount?: number; + autoScalingPolicies?: AutoScalingPolicy[]; + readonly status?: string; + readonly statusDetails?: string; + readonly healthState?: string; + readonly unhealthyEvaluation?: string; } /** * @class - * Initializes a new instance of the ContainerVolume class. + * Initializes a new instance of the ServiceReplicaProperties class. * @constructor - * Describes how a volume is attached to a container. + * Describes the properties of a service replica. * - * @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. + * @member {string} osType The operation system 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 ContainerVolume { - name: string; - readOnly?: boolean; - destinationPath: string; +export interface ServiceReplicaProperties { + osType: string; + codePackages: ContainerCodePackageProperties[]; + networkRefs?: NetworkRef[]; + diagnostics?: DiagnosticsRef; } /** * @class - * Initializes a new instance of the ContainerState class. + * Initializes a new instance of the ServiceReplicaDescription class. * @constructor - * The container state. + * Describes a replica of a service resource. * - * @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. + * @member {string} replicaName Name of the replica. */ -export interface ContainerState { - state?: string; - startTime?: Date; - exitCode?: string; - finishTime?: Date; - detailStatus?: string; +export interface ServiceReplicaDescription extends ServiceReplicaProperties { + replicaName: string; } /** * @class - * Initializes a new instance of the ContainerEvent class. + * Initializes a new instance of the AverageLoadScalingTrigger class. * @constructor - * A container event. + * Describes the average load trigger used for auto scaling. * - * @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. + * @member {object} metric Description of the metric that is used for scaling. + * @member {string} [metric.kind] Polymorphic Discriminator + * @member {number} lowerLoadThreshold Lower load threshold (if average load is + * below this threshold, service will scale down). + * @member {number} upperLoadThreshold Upper load threshold (if average load is + * above this threshold, service will scale up). + * @member {number} scaleIntervalInSeconds Scale interval that indicates how + * often will this trigger be checked. */ -export interface ContainerEvent { - name?: string; - count?: number; - firstTimestamp?: string; - lastTimestamp?: string; - message?: string; - type?: string; +export interface AverageLoadScalingTrigger extends AutoScalingTrigger { + metric: AutoScalingMetric; + lowerLoadThreshold: number; + upperLoadThreshold: number; + scaleIntervalInSeconds: number; } /** * @class - * Initializes a new instance of the ContainerInstanceView class. + * Initializes a new instance of the PagedServiceResourceDescriptionList class. * @constructor - * Runtime information of a container instance. + * The list of service resources. 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 {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. + * @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] One page of the list. */ -export interface ContainerInstanceView { - restartCount?: number; - currentState?: ContainerState; - previousState?: ContainerState; - events?: ContainerEvent[]; +export interface PagedServiceResourceDescriptionList { + continuationToken?: string; + items?: ServiceResourceDescription[]; } /** * @class - * Initializes a new instance of the DiagnosticsRef class. + * Initializes a new instance of the PagedServiceReplicaDescriptionList class. * @constructor - * Reference to sinks in DiagnosticsDescription. + * The list of service resource replicas 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 {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. + * @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 replica description. */ -export interface DiagnosticsRef { - enabled?: boolean; - sinkRefs?: string[]; +export interface PagedServiceReplicaDescriptionList { + continuationToken?: string; + items?: ServiceReplicaDescription[]; } /** * @class - * Initializes a new instance of the ContainerCodePackageProperties class. + * Initializes a new instance of the ApplicationResourceDescription class. * @constructor - * Describes a container and its runtime properties. + * This type describes a application resource. * - * @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 {string} name Name of the Application resource. + * @member {string} [description] User readable description of the application. + * @member {array} [services] Describes the services in the application. This + * property is used to create or modify services of the application. On get + * only the name of the service is returned. The service description can be + * obtained by querying for the service resource. + * @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.sinkRefs] List of sinks to be used if enabled. - * References the list of sinks in DiagnosticsDescription. + * @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} [debugParams] Internal - used by Visual Studio to setup the + * debugging session on the local development environment. + * @member {array} [serviceNames] Names of the services in the application. + * @member {string} [status] Status of the application. Possible values + * include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of 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. */ -export interface ContainerCodePackageProperties { +export interface ApplicationResourceDescription { 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; + description?: string; + services?: ServiceResourceDescription[]; + diagnostics?: DiagnosticsDescription; + debugParams?: string; + readonly serviceNames?: string[]; + readonly status?: string; + readonly statusDetails?: string; + readonly healthState?: string; + readonly unhealthyEvaluation?: string; } /** * @class - * Initializes a new instance of the NetworkRef class. + * Initializes a new instance of the PagedApplicationResourceDescriptionList class. * @constructor - * Describes a network reference in a service. + * The list of application resources. 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} [name] Name of the network. + * @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] One page of the list. */ -export interface NetworkRef { - name?: string; +export interface PagedApplicationResourceDescriptionList { + continuationToken?: string; + items?: ApplicationResourceDescription[]; } diff --git a/lib/services/serviceFabric/lib/models/index.js b/lib/services/serviceFabric/lib/models/index.js index ca17e2f246..98eba0c762 100644 --- a/lib/services/serviceFabric/lib/models/index.js +++ b/lib/services/serviceFabric/lib/models/index.js @@ -14,6 +14,9 @@ 'use strict'; +exports.FabricErrorError = require('./fabricErrorError'); +exports.FabricError = require('./fabricError'); +exports.ContainerLogs = require('./containerLogs'); exports.AadMetadata = require('./aadMetadata'); exports.AadMetadataObject = require('./aadMetadataObject'); exports.AnalysisEventMetadata = require('./analysisEventMetadata'); @@ -86,6 +89,7 @@ exports.ClusterHealthPolicy = require('./clusterHealthPolicy'); exports.ClusterHealthChunkQueryDescription = require('./clusterHealthChunkQueryDescription'); exports.ClusterHealthPolicies = require('./clusterHealthPolicies'); exports.ClusterManifest = require('./clusterManifest'); +exports.ClusterVersion = require('./clusterVersion'); exports.ContainerApiRequestBody = require('./containerApiRequestBody'); exports.ContainerApiResult = require('./containerApiResult'); exports.ContainerApiResponse = require('./containerApiResponse'); @@ -110,12 +114,9 @@ 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'); -exports.FabricErrorError = require('./fabricErrorError'); -exports.FabricError = require('./fabricError'); exports.ClusterConfigurationUpgradeStatusInfo = require('./clusterConfigurationUpgradeStatusInfo'); exports.PartitionInformation = require('./partitionInformation'); exports.Int64RangePartitionInformation = require('./int64RangePartitionInformation'); @@ -322,8 +323,11 @@ exports.SuccessfulPropertyBatchInfo = require('./successfulPropertyBatchInfo'); exports.FailedPropertyBatchInfo = require('./failedPropertyBatchInfo'); exports.BackupScheduleDescription = require('./backupScheduleDescription'); exports.BackupStorageDescription = require('./backupStorageDescription'); +exports.RetentionPolicyDescription = require('./retentionPolicyDescription'); exports.BackupPolicyDescription = require('./backupPolicyDescription'); exports.PagedBackupPolicyDescriptionList = require('./pagedBackupPolicyDescriptionList'); +exports.BasicRetentionPolicyDescription = require('./basicRetentionPolicyDescription'); +exports.DisableBackupDescription = require('./disableBackupDescription'); exports.BackupConfigurationInfo = require('./backupConfigurationInfo'); exports.ApplicationBackupConfigurationInfo = require('./applicationBackupConfigurationInfo'); exports.ServiceBackupConfigurationInfo = require('./serviceBackupConfigurationInfo'); @@ -362,81 +366,97 @@ 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.ApplicationNewHealthReportEvent = require('./applicationNewHealthReportEvent'); 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.ApplicationUpgradeCompletedEvent = require('./applicationUpgradeCompletedEvent'); +exports.ApplicationUpgradeDomainCompletedEvent = require('./applicationUpgradeDomainCompletedEvent'); +exports.ApplicationUpgradeRollbackCompletedEvent = require('./applicationUpgradeRollbackCompletedEvent'); +exports.ApplicationUpgradeRollbackStartedEvent = require('./applicationUpgradeRollbackStartedEvent'); +exports.ApplicationUpgradeStartedEvent = require('./applicationUpgradeStartedEvent'); +exports.DeployedApplicationNewHealthReportEvent = require('./deployedApplicationNewHealthReportEvent'); exports.DeployedApplicationHealthReportExpiredEvent = require('./deployedApplicationHealthReportExpiredEvent'); -exports.ProcessDeactivatedEvent = require('./processDeactivatedEvent'); -exports.ContainerDeactivatedEvent = require('./containerDeactivatedEvent'); +exports.ApplicationProcessExitedEvent = require('./applicationProcessExitedEvent'); +exports.ApplicationContainerInstanceExitedEvent = require('./applicationContainerInstanceExitedEvent'); 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.NodeAddedToClusterEvent = require('./nodeAddedToClusterEvent'); +exports.NodeClosedEvent = require('./nodeClosedEvent'); +exports.NodeDeactivateCompletedEvent = require('./nodeDeactivateCompletedEvent'); +exports.NodeDeactivateStartedEvent = require('./nodeDeactivateStartedEvent'); exports.NodeDownEvent = require('./nodeDownEvent'); -exports.NodeHealthReportCreatedEvent = require('./nodeHealthReportCreatedEvent'); +exports.NodeNewHealthReportEvent = require('./nodeNewHealthReportEvent'); exports.NodeHealthReportExpiredEvent = require('./nodeHealthReportExpiredEvent'); -exports.NodeOpenedSuccessEvent = require('./nodeOpenedSuccessEvent'); +exports.NodeOpenSucceededEvent = require('./nodeOpenSucceededEvent'); exports.NodeOpenFailedEvent = require('./nodeOpenFailedEvent'); -exports.NodeOpeningEvent = require('./nodeOpeningEvent'); -exports.NodeRemovedEvent = require('./nodeRemovedEvent'); +exports.NodeRemovedFromClusterEvent = require('./nodeRemovedFromClusterEvent'); exports.NodeUpEvent = require('./nodeUpEvent'); -exports.PartitionHealthReportCreatedEvent = require('./partitionHealthReportCreatedEvent'); +exports.PartitionNewHealthReportEvent = require('./partitionNewHealthReportEvent'); exports.PartitionHealthReportExpiredEvent = require('./partitionHealthReportExpiredEvent'); -exports.PartitionReconfigurationCompletedEvent = require('./partitionReconfigurationCompletedEvent'); +exports.PartitionReconfiguredEvent = require('./partitionReconfiguredEvent'); exports.PartitionPrimaryMoveAnalysisEvent = require('./partitionPrimaryMoveAnalysisEvent'); exports.ServiceCreatedEvent = require('./serviceCreatedEvent'); exports.ServiceDeletedEvent = require('./serviceDeletedEvent'); -exports.ServiceHealthReportCreatedEvent = require('./serviceHealthReportCreatedEvent'); +exports.ServiceNewHealthReportEvent = require('./serviceNewHealthReportEvent'); exports.ServiceHealthReportExpiredEvent = require('./serviceHealthReportExpiredEvent'); -exports.DeployedServiceHealthReportCreatedEvent = require('./deployedServiceHealthReportCreatedEvent'); -exports.DeployedServiceHealthReportExpiredEvent = require('./deployedServiceHealthReportExpiredEvent'); -exports.StatefulReplicaHealthReportCreatedEvent = require('./statefulReplicaHealthReportCreatedEvent'); +exports.DeployedServicePackageNewHealthReportEvent = require('./deployedServicePackageNewHealthReportEvent'); +exports.DeployedServicePackageHealthReportExpiredEvent = require('./deployedServicePackageHealthReportExpiredEvent'); +exports.StatefulReplicaNewHealthReportEvent = require('./statefulReplicaNewHealthReportEvent'); exports.StatefulReplicaHealthReportExpiredEvent = require('./statefulReplicaHealthReportExpiredEvent'); -exports.StatelessReplicaHealthReportCreatedEvent = require('./statelessReplicaHealthReportCreatedEvent'); +exports.StatelessReplicaNewHealthReportEvent = require('./statelessReplicaNewHealthReportEvent'); exports.StatelessReplicaHealthReportExpiredEvent = require('./statelessReplicaHealthReportExpiredEvent'); -exports.ClusterHealthReportCreatedEvent = require('./clusterHealthReportCreatedEvent'); +exports.ClusterNewHealthReportEvent = require('./clusterNewHealthReportEvent'); 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.ClusterUpgradeCompletedEvent = require('./clusterUpgradeCompletedEvent'); +exports.ClusterUpgradeDomainCompletedEvent = require('./clusterUpgradeDomainCompletedEvent'); +exports.ClusterUpgradeRollbackCompletedEvent = require('./clusterUpgradeRollbackCompletedEvent'); +exports.ClusterUpgradeRollbackStartedEvent = require('./clusterUpgradeRollbackStartedEvent'); +exports.ClusterUpgradeStartedEvent = require('./clusterUpgradeStartedEvent'); 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.ChaosCodePackageRestartScheduledEvent = require('./chaosCodePackageRestartScheduledEvent'); +exports.ChaosReplicaRemovalScheduledEvent = require('./chaosReplicaRemovalScheduledEvent'); +exports.ChaosPartitionSecondaryMoveScheduledEvent = require('./chaosPartitionSecondaryMoveScheduledEvent'); +exports.ChaosPartitionPrimaryMoveScheduledEvent = require('./chaosPartitionPrimaryMoveScheduledEvent'); +exports.ChaosReplicaRestartScheduledEvent = require('./chaosReplicaRestartScheduledEvent'); +exports.ChaosNodeRestartScheduledEvent = require('./chaosNodeRestartScheduledEvent'); +exports.SecretResourcePropertiesBase = require('./secretResourcePropertiesBase'); +exports.SecretResourceProperties = require('./secretResourceProperties'); +exports.InlinedValueSecretResourceProperties = require('./inlinedValueSecretResourceProperties'); +exports.SecretResourceDescription = require('./secretResourceDescription'); +exports.PagedSecretResourceDescriptionList = require('./pagedSecretResourceDescriptionList'); +exports.SecretValue = require('./secretValue'); +exports.SecretValueProperties = require('./secretValueProperties'); +exports.SecretValueResourceDescription = require('./secretValueResourceDescription'); +exports.PagedSecretValueResourceDescriptionList = require('./pagedSecretValueResourceDescriptionList'); exports.VolumeProviderParametersAzureFile = require('./volumeProviderParametersAzureFile'); +exports.VolumeReference = require('./volumeReference'); +exports.ApplicationScopedVolumeCreationParameters = require('./applicationScopedVolumeCreationParameters'); +exports.ApplicationScopedVolume = require('./applicationScopedVolume'); +exports.ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk = require('./applicationScopedVolumeCreationParametersServiceFabricVolumeDisk'); exports.VolumeResourceDescription = require('./volumeResourceDescription'); +exports.PagedVolumeResourceDescriptionList = require('./pagedVolumeResourceDescriptionList'); +exports.NetworkResourcePropertiesBase = require('./networkResourcePropertiesBase'); +exports.NetworkResourceProperties = require('./networkResourceProperties'); +exports.LocalNetworkResourceProperties = require('./localNetworkResourceProperties'); +exports.EndpointRef = require('./endpointRef'); +exports.NetworkRef = require('./networkRef'); +exports.NetworkResourceDescription = require('./networkResourceDescription'); +exports.PagedNetworkResourceDescriptionList = require('./pagedNetworkResourceDescriptionList'); +exports.GatewayDestination = require('./gatewayDestination'); +exports.TcpConfig = require('./tcpConfig'); +exports.HttpRouteMatchPath = require('./httpRouteMatchPath'); +exports.HttpRouteMatchHeader = require('./httpRouteMatchHeader'); +exports.HttpRouteMatchRule = require('./httpRouteMatchRule'); +exports.HttpRouteConfig = require('./httpRouteConfig'); +exports.HttpHostConfig = require('./httpHostConfig'); +exports.HttpConfig = require('./httpConfig'); +exports.GatewayResourceDescription = require('./gatewayResourceDescription'); +exports.PagedGatewayResourceDescriptionList = require('./pagedGatewayResourceDescriptionList'); exports.ImageRegistryCredential = require('./imageRegistryCredential'); exports.EnvironmentVariable = require('./environmentVariable'); exports.Setting = require('./setting'); @@ -445,13 +465,30 @@ exports.EndpointProperties = require('./endpointProperties'); exports.ResourceRequests = require('./resourceRequests'); exports.ResourceLimits = require('./resourceLimits'); exports.ResourceRequirements = require('./resourceRequirements'); -exports.ContainerVolume = require('./containerVolume'); +exports.DiagnosticsRef = require('./diagnosticsRef'); +exports.ReliableCollectionsRef = require('./reliableCollectionsRef'); 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.AutoScalingTrigger = require('./autoScalingTrigger'); +exports.AutoScalingMechanism = require('./autoScalingMechanism'); +exports.AutoScalingPolicy = require('./autoScalingPolicy'); +exports.ServiceResourceDescription = require('./serviceResourceDescription'); +exports.DiagnosticsSinkProperties = require('./diagnosticsSinkProperties'); +exports.DiagnosticsDescription = require('./diagnosticsDescription'); +exports.AzureInternalMonitoringPipelineSinkDescription = require('./azureInternalMonitoringPipelineSinkDescription'); +exports.AddRemoveReplicaScalingMechanism = require('./addRemoveReplicaScalingMechanism'); +exports.AutoScalingMetric = require('./autoScalingMetric'); +exports.AutoScalingResourceMetric = require('./autoScalingResourceMetric'); +exports.ServiceProperties = require('./serviceProperties'); +exports.ServiceReplicaProperties = require('./serviceReplicaProperties'); +exports.ServiceReplicaDescription = require('./serviceReplicaDescription'); +exports.AverageLoadScalingTrigger = require('./averageLoadScalingTrigger'); +exports.PagedServiceResourceDescriptionList = require('./pagedServiceResourceDescriptionList'); +exports.PagedServiceReplicaDescriptionList = require('./pagedServiceReplicaDescriptionList'); +exports.ApplicationResourceDescription = require('./applicationResourceDescription'); +exports.PagedApplicationResourceDescriptionList = require('./pagedApplicationResourceDescriptionList'); exports.discriminators = { 'FabricEvent.ApplicationEvent' : exports.ApplicationEvent, 'HealthEvaluation' : exports.HealthEvaluation, @@ -573,6 +610,8 @@ exports.discriminators = { 'PropertyBatchInfo.Failed' : exports.FailedPropertyBatchInfo, 'BackupScheduleDescription' : exports.BackupScheduleDescription, 'BackupStorageDescription' : exports.BackupStorageDescription, + 'RetentionPolicyDescription' : exports.RetentionPolicyDescription, + 'RetentionPolicyDescription.Basic' : exports.BasicRetentionPolicyDescription, 'BackupConfigurationInfo.Application' : exports.ApplicationBackupConfigurationInfo, 'BackupConfigurationInfo.Service' : exports.ServiceBackupConfigurationInfo, 'BackupConfigurationInfo' : exports.BackupConfigurationInfo, @@ -595,63 +634,72 @@ exports.discriminators = { 'ScalingMechanismDescription.AddRemoveIncrementalNamedPartition' : exports.AddRemoveIncrementalNamedPartitionScalingMechanism, 'FabricEvent.ApplicationCreated' : exports.ApplicationCreatedEvent, 'FabricEvent.ApplicationDeleted' : exports.ApplicationDeletedEvent, - 'FabricEvent.ApplicationHealthReportCreated' : exports.ApplicationHealthReportCreatedEvent, + 'FabricEvent.ApplicationNewHealthReport' : exports.ApplicationNewHealthReportEvent, '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.ApplicationUpgradeCompleted' : exports.ApplicationUpgradeCompletedEvent, + 'FabricEvent.ApplicationUpgradeDomainCompleted' : exports.ApplicationUpgradeDomainCompletedEvent, + 'FabricEvent.ApplicationUpgradeRollbackCompleted' : exports.ApplicationUpgradeRollbackCompletedEvent, + 'FabricEvent.ApplicationUpgradeRollbackStarted' : exports.ApplicationUpgradeRollbackStartedEvent, + 'FabricEvent.ApplicationUpgradeStarted' : exports.ApplicationUpgradeStartedEvent, + 'FabricEvent.DeployedApplicationNewHealthReport' : exports.DeployedApplicationNewHealthReportEvent, 'FabricEvent.DeployedApplicationHealthReportExpired' : exports.DeployedApplicationHealthReportExpiredEvent, - 'FabricEvent.ProcessDeactivated' : exports.ProcessDeactivatedEvent, - 'FabricEvent.ContainerDeactivated' : exports.ContainerDeactivatedEvent, + 'FabricEvent.ApplicationProcessExited' : exports.ApplicationProcessExitedEvent, + 'FabricEvent.ApplicationContainerInstanceExited' : exports.ApplicationContainerInstanceExitedEvent, '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.NodeAddedToCluster' : exports.NodeAddedToClusterEvent, + 'FabricEvent.NodeClosed' : exports.NodeClosedEvent, + 'FabricEvent.NodeDeactivateCompleted' : exports.NodeDeactivateCompletedEvent, + 'FabricEvent.NodeDeactivateStarted' : exports.NodeDeactivateStartedEvent, 'FabricEvent.NodeDown' : exports.NodeDownEvent, - 'FabricEvent.NodeHealthReportCreated' : exports.NodeHealthReportCreatedEvent, + 'FabricEvent.NodeNewHealthReport' : exports.NodeNewHealthReportEvent, 'FabricEvent.NodeHealthReportExpired' : exports.NodeHealthReportExpiredEvent, - 'FabricEvent.NodeOpenedSuccess' : exports.NodeOpenedSuccessEvent, + 'FabricEvent.NodeOpenSucceeded' : exports.NodeOpenSucceededEvent, 'FabricEvent.NodeOpenFailed' : exports.NodeOpenFailedEvent, - 'FabricEvent.NodeOpening' : exports.NodeOpeningEvent, - 'FabricEvent.NodeRemoved' : exports.NodeRemovedEvent, + 'FabricEvent.NodeRemovedFromCluster' : exports.NodeRemovedFromClusterEvent, 'FabricEvent.NodeUp' : exports.NodeUpEvent, - 'FabricEvent.PartitionHealthReportCreated' : exports.PartitionHealthReportCreatedEvent, + 'FabricEvent.PartitionNewHealthReport' : exports.PartitionNewHealthReportEvent, 'FabricEvent.PartitionHealthReportExpired' : exports.PartitionHealthReportExpiredEvent, - 'FabricEvent.PartitionReconfigurationCompleted' : exports.PartitionReconfigurationCompletedEvent, + 'FabricEvent.PartitionReconfigured' : exports.PartitionReconfiguredEvent, 'FabricEvent.PartitionPrimaryMoveAnalysis' : exports.PartitionPrimaryMoveAnalysisEvent, 'FabricEvent.ServiceCreated' : exports.ServiceCreatedEvent, 'FabricEvent.ServiceDeleted' : exports.ServiceDeletedEvent, - 'FabricEvent.ServiceHealthReportCreated' : exports.ServiceHealthReportCreatedEvent, + 'FabricEvent.ServiceNewHealthReport' : exports.ServiceNewHealthReportEvent, 'FabricEvent.ServiceHealthReportExpired' : exports.ServiceHealthReportExpiredEvent, - 'FabricEvent.DeployedServiceHealthReportCreated' : exports.DeployedServiceHealthReportCreatedEvent, - 'FabricEvent.DeployedServiceHealthReportExpired' : exports.DeployedServiceHealthReportExpiredEvent, - 'FabricEvent.StatefulReplicaHealthReportCreated' : exports.StatefulReplicaHealthReportCreatedEvent, + 'FabricEvent.DeployedServicePackageNewHealthReport' : exports.DeployedServicePackageNewHealthReportEvent, + 'FabricEvent.DeployedServicePackageHealthReportExpired' : exports.DeployedServicePackageHealthReportExpiredEvent, + 'FabricEvent.StatefulReplicaNewHealthReport' : exports.StatefulReplicaNewHealthReportEvent, 'FabricEvent.StatefulReplicaHealthReportExpired' : exports.StatefulReplicaHealthReportExpiredEvent, - 'FabricEvent.StatelessReplicaHealthReportCreated' : exports.StatelessReplicaHealthReportCreatedEvent, + 'FabricEvent.StatelessReplicaNewHealthReport' : exports.StatelessReplicaNewHealthReportEvent, 'FabricEvent.StatelessReplicaHealthReportExpired' : exports.StatelessReplicaHealthReportExpiredEvent, - 'FabricEvent.ClusterHealthReportCreated' : exports.ClusterHealthReportCreatedEvent, + 'FabricEvent.ClusterNewHealthReport' : exports.ClusterNewHealthReportEvent, '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.ClusterUpgradeCompleted' : exports.ClusterUpgradeCompletedEvent, + 'FabricEvent.ClusterUpgradeDomainCompleted' : exports.ClusterUpgradeDomainCompletedEvent, + 'FabricEvent.ClusterUpgradeRollbackCompleted' : exports.ClusterUpgradeRollbackCompletedEvent, + 'FabricEvent.ClusterUpgradeRollbackStarted' : exports.ClusterUpgradeRollbackStartedEvent, + 'FabricEvent.ClusterUpgradeStarted' : exports.ClusterUpgradeStartedEvent, '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 + 'FabricEvent.ChaosCodePackageRestartScheduled' : exports.ChaosCodePackageRestartScheduledEvent, + 'FabricEvent.ChaosReplicaRemovalScheduled' : exports.ChaosReplicaRemovalScheduledEvent, + 'FabricEvent.ChaosPartitionSecondaryMoveScheduled' : exports.ChaosPartitionSecondaryMoveScheduledEvent, + 'FabricEvent.ChaosPartitionPrimaryMoveScheduled' : exports.ChaosPartitionPrimaryMoveScheduledEvent, + 'FabricEvent.ChaosReplicaRestartScheduled' : exports.ChaosReplicaRestartScheduledEvent, + 'FabricEvent.ChaosNodeRestartScheduled' : exports.ChaosNodeRestartScheduledEvent, + 'SecretResourcePropertiesBase.SecretResourceProperties' : exports.SecretResourceProperties, + 'SecretResourcePropertiesBase.inlinedValue' : exports.InlinedValueSecretResourceProperties, + 'SecretResourcePropertiesBase' : exports.SecretResourcePropertiesBase, + 'ApplicationScopedVolumeCreationParameters' : exports.ApplicationScopedVolumeCreationParameters, + 'ApplicationScopedVolumeCreationParameters.ServiceFabricVolumeDisk' : exports.ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk, + 'NetworkResourcePropertiesBase.NetworkResourceProperties' : exports.NetworkResourceProperties, + 'NetworkResourcePropertiesBase.Local' : exports.LocalNetworkResourceProperties, + 'NetworkResourcePropertiesBase' : exports.NetworkResourcePropertiesBase, + 'AutoScalingTrigger' : exports.AutoScalingTrigger, + 'AutoScalingMechanism' : exports.AutoScalingMechanism, + 'DiagnosticsSinkProperties' : exports.DiagnosticsSinkProperties, + 'DiagnosticsSinkProperties.AzureInternalMonitoringPipeline' : exports.AzureInternalMonitoringPipelineSinkDescription, + 'AutoScalingMechanism.AddRemoveReplica' : exports.AddRemoveReplicaScalingMechanism, + 'AutoScalingMetric' : exports.AutoScalingMetric, + 'AutoScalingMetric.Resource' : exports.AutoScalingResourceMetric, + 'AutoScalingTrigger.AverageLoad' : exports.AverageLoadScalingTrigger }; diff --git a/lib/services/serviceFabric/lib/models/inlinedValueSecretResourceProperties.js b/lib/services/serviceFabric/lib/models/inlinedValueSecretResourceProperties.js new file mode 100644 index 0000000000..544fe27057 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/inlinedValueSecretResourceProperties.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes the properties of a secret resource whose value is provided + * explicitly as plaintext. The secret resource may have multiple values, each + * being uniquely versioned. The secret value of each version is stored + * encrypted, and delivered as plaintext into the context of applications + * referencing it. + * + * @extends models['SecretResourceProperties'] + */ +class InlinedValueSecretResourceProperties extends models['SecretResourceProperties'] { + /** + * Create a InlinedValueSecretResourceProperties. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InlinedValueSecretResourceProperties + * + * @returns {object} metadata of InlinedValueSecretResourceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'inlinedValue', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'SecretResourcePropertiesBase', + className: 'InlinedValueSecretResourceProperties', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'statusDetails', + type: { + name: 'String' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InlinedValueSecretResourceProperties; diff --git a/lib/services/serviceFabric/lib/models/loadMetricReport.js b/lib/services/serviceFabric/lib/models/loadMetricReport.js index e11fb7bd31..41f71a1858 100644 --- a/lib/services/serviceFabric/lib/models/loadMetricReport.js +++ b/lib/services/serviceFabric/lib/models/loadMetricReport.js @@ -21,7 +21,10 @@ class LoadMetricReport { * @member {date} [lastReportedUtc] Gets the UTC time when the load was * reported. * @member {string} [name] The name of the load metric. - * @member {string} [value] The value of the load metric. + * @member {string} [value] The value of the load metric. In future releases + * of Service Fabric this parameter will be deprecated in favor of + * CurrentValue. + * @member {string} [currentValue] The value of the load metric. */ constructor() { } @@ -60,6 +63,13 @@ class LoadMetricReport { type: { name: 'String' } + }, + currentValue: { + required: false, + serializedName: 'CurrentValue', + type: { + name: 'String' + } } } } diff --git a/lib/services/serviceFabric/lib/models/loadMetricReportInfo.js b/lib/services/serviceFabric/lib/models/loadMetricReportInfo.js index b210cfe207..878b16fa27 100644 --- a/lib/services/serviceFabric/lib/models/loadMetricReportInfo.js +++ b/lib/services/serviceFabric/lib/models/loadMetricReportInfo.js @@ -18,7 +18,11 @@ class LoadMetricReportInfo { /** * Create a LoadMetricReportInfo. * @member {string} [name] The name of the metric. - * @member {number} [value] The value of the load for the metric.. + * @member {number} [value] The value of the load for the metric. In future + * releases of Service Fabric this parameter will be deprecated in favor of + * CurrentValue. + * @member {string} [currentValue] The double value of the load for the + * metric. * @member {date} [lastReportedUtc] The UTC time when the load is reported. */ constructor() { @@ -52,6 +56,13 @@ class LoadMetricReportInfo { name: 'Number' } }, + currentValue: { + required: false, + serializedName: 'CurrentValue', + type: { + name: 'String' + } + }, lastReportedUtc: { required: false, serializedName: 'LastReportedUtc', diff --git a/lib/services/serviceFabric/lib/models/localNetworkResourceProperties.js b/lib/services/serviceFabric/lib/models/localNetworkResourceProperties.js new file mode 100644 index 0000000000..2a1b343193 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/localNetworkResourceProperties.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'); + +/** + * Information about a Service Fabric container network local to a single + * Service Fabric cluster. + * + * @extends models['NetworkResourceProperties'] + */ +class LocalNetworkResourceProperties extends models['NetworkResourceProperties'] { + /** + * Create a LocalNetworkResourceProperties. + * @member {string} [networkAddressPrefix] Address space for the local + * container network. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LocalNetworkResourceProperties + * + * @returns {object} metadata of LocalNetworkResourceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Local', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'NetworkResourcePropertiesBase', + className: 'LocalNetworkResourceProperties', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'statusDetails', + type: { + name: 'String' + } + }, + networkAddressPrefix: { + required: false, + serializedName: 'networkAddressPrefix', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LocalNetworkResourceProperties; diff --git a/lib/services/serviceFabric/lib/models/networkRef.js b/lib/services/serviceFabric/lib/models/networkRef.js index 3294cee7c4..b99f00f3de 100644 --- a/lib/services/serviceFabric/lib/models/networkRef.js +++ b/lib/services/serviceFabric/lib/models/networkRef.js @@ -17,7 +17,9 @@ class NetworkRef { /** * Create a NetworkRef. - * @member {string} [name] Name of the network. + * @member {string} [name] Name of the network + * @member {array} [endpointRefs] A list of endpoints that are exposed on + * this network. */ constructor() { } @@ -42,6 +44,21 @@ class NetworkRef { type: { name: 'String' } + }, + endpointRefs: { + required: false, + serializedName: 'endpointRefs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EndpointRefElementType', + type: { + name: 'Composite', + className: 'EndpointRef' + } + } + } } } } diff --git a/lib/services/serviceFabric/lib/models/networkResourceDescription.js b/lib/services/serviceFabric/lib/models/networkResourceDescription.js new file mode 100644 index 0000000000..797e3b3646 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/networkResourceDescription.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'; + +/** + * This type describes a network resource. + * + */ +class NetworkResourceDescription { + /** + * Create a NetworkResourceDescription. + * @member {string} name Name of the Network resource. + * @member {object} properties Describes properties of a network resource. + * @member {string} [properties.description] User readable description of the + * network. + * @member {string} [properties.status] Status of the network. Possible + * values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', + * 'Failed' + * @member {string} [properties.statusDetails] Gives additional information + * about the current status of the network. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkResourceDescription + * + * @returns {object} metadata of NetworkResourceDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkResourceDescription', + type: { + name: 'Composite', + className: 'NetworkResourceDescription', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'NetworkResourcePropertiesBase', + className: 'NetworkResourceProperties' + } + } + } + } + }; + } +} + +module.exports = NetworkResourceDescription; diff --git a/lib/services/serviceFabric/lib/models/networkResourceProperties.js b/lib/services/serviceFabric/lib/models/networkResourceProperties.js new file mode 100644 index 0000000000..14898688f2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/networkResourceProperties.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'); + +/** + * Describes properties of a network resource. + * + * @extends models['NetworkResourcePropertiesBase'] + */ +class NetworkResourceProperties extends models['NetworkResourcePropertiesBase'] { + /** + * Create a NetworkResourceProperties. + * @member {string} [description] User readable description of the network. + * @member {string} [status] Status of the network. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the network. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkResourceProperties + * + * @returns {object} metadata of NetworkResourceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkResourceProperties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'NetworkResourcePropertiesBase', + className: 'NetworkResourceProperties', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'statusDetails', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkResourceProperties; diff --git a/lib/services/serviceFabric/lib/models/networkResourcePropertiesBase.js b/lib/services/serviceFabric/lib/models/networkResourcePropertiesBase.js new file mode 100644 index 0000000000..77caf7c8ab --- /dev/null +++ b/lib/services/serviceFabric/lib/models/networkResourcePropertiesBase.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'; + +/** + * This type describes the properties of a network resource, including its + * kind. + * + */ +class NetworkResourcePropertiesBase { + /** + * Create a NetworkResourcePropertiesBase. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of NetworkResourcePropertiesBase + * + * @returns {object} metadata of NetworkResourcePropertiesBase + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkResourcePropertiesBase', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'NetworkResourcePropertiesBase', + className: 'NetworkResourcePropertiesBase', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkResourcePropertiesBase; diff --git a/lib/services/serviceFabric/lib/models/nodeAbortedEvent.js b/lib/services/serviceFabric/lib/models/nodeAbortedEvent.js index e5a665f204..413645745e 100644 --- a/lib/services/serviceFabric/lib/models/nodeAbortedEvent.js +++ b/lib/services/serviceFabric/lib/models/nodeAbortedEvent.js @@ -59,6 +59,13 @@ class NodeAbortedEvent extends models['NodeEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/nodeAddedToClusterEvent.js b/lib/services/serviceFabric/lib/models/nodeAddedToClusterEvent.js new file mode 100644 index 0000000000..051424863b --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeAddedToClusterEvent.js @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 NodeAddedToClusterEvent extends models['NodeEvent'] { + /** + * Create a NodeAddedToClusterEvent. + * @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 NodeAddedToClusterEvent + * + * @returns {object} metadata of NodeAddedToClusterEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeAddedToCluster', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeAddedToClusterEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = NodeAddedToClusterEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeClosedEvent.js b/lib/services/serviceFabric/lib/models/nodeClosedEvent.js new file mode 100644 index 0000000000..daff4401d6 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeClosedEvent.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'); + +/** + * Node Closed event. + * + * @extends models['NodeEvent'] + */ +class NodeClosedEvent extends models['NodeEvent'] { + /** + * Create a NodeClosedEvent. + * @member {string} nodeId Id of Node. + * @member {number} nodeInstance Id of Node instance. + * @member {string} error Describes error. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeClosedEvent + * + * @returns {object} metadata of NodeClosedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeClosed', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeClosedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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' + } + }, + error: { + required: true, + serializedName: 'Error', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NodeClosedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeDeactivateCompletedEvent.js b/lib/services/serviceFabric/lib/models/nodeDeactivateCompletedEvent.js new file mode 100644 index 0000000000..d5433338a8 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeDeactivateCompletedEvent.js @@ -0,0 +1,128 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 Completed event. + * + * @extends models['NodeEvent'] + */ +class NodeDeactivateCompletedEvent extends models['NodeEvent'] { + /** + * Create a NodeDeactivateCompletedEvent. + * @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 NodeDeactivateCompletedEvent + * + * @returns {object} metadata of NodeDeactivateCompletedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeDeactivateCompleted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeDeactivateCompletedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = NodeDeactivateCompletedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeDeactivateStartedEvent.js b/lib/services/serviceFabric/lib/models/nodeDeactivateStartedEvent.js new file mode 100644 index 0000000000..a1c6b4a2bb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeDeactivateStartedEvent.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'); + +/** + * Node Deactivate Started event. + * + * @extends models['NodeEvent'] + */ +class NodeDeactivateStartedEvent extends models['NodeEvent'] { + /** + * Create a NodeDeactivateStartedEvent. + * @member {number} nodeInstance Id of Node instance. + * @member {string} batchId Batch Id. + * @member {string} deactivateIntent Describes deactivate intent. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NodeDeactivateStartedEvent + * + * @returns {object} metadata of NodeDeactivateStartedEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeDeactivateStarted', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeDeactivateStartedEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = NodeDeactivateStartedEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeDownEvent.js b/lib/services/serviceFabric/lib/models/nodeDownEvent.js index d91bde47f3..05b2a04e32 100644 --- a/lib/services/serviceFabric/lib/models/nodeDownEvent.js +++ b/lib/services/serviceFabric/lib/models/nodeDownEvent.js @@ -53,6 +53,13 @@ class NodeDownEvent extends models['NodeEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/nodeEvent.js b/lib/services/serviceFabric/lib/models/nodeEvent.js index 9fa73fdbaf..c01efee4cb 100644 --- a/lib/services/serviceFabric/lib/models/nodeEvent.js +++ b/lib/services/serviceFabric/lib/models/nodeEvent.js @@ -52,6 +52,13 @@ class NodeEvent extends models['FabricEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/nodeHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/nodeHealthReportExpiredEvent.js index 5357baab58..19c248cd99 100644 --- a/lib/services/serviceFabric/lib/models/nodeHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/nodeHealthReportExpiredEvent.js @@ -60,6 +60,13 @@ class NodeHealthReportExpiredEvent extends models['NodeEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/nodeNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/nodeNewHealthReportEvent.js new file mode 100644 index 0000000000..7a6625cd5a --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeNewHealthReportEvent.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'); + +/** + * Node Health Report Created event. + * + * @extends models['NodeEvent'] + */ +class NodeNewHealthReportEvent extends models['NodeEvent'] { + /** + * Create a NodeNewHealthReportEvent. + * @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 NodeNewHealthReportEvent + * + * @returns {object} metadata of NodeNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = NodeNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeOpenFailedEvent.js b/lib/services/serviceFabric/lib/models/nodeOpenFailedEvent.js index 147f21f661..7dcae0fe63 100644 --- a/lib/services/serviceFabric/lib/models/nodeOpenFailedEvent.js +++ b/lib/services/serviceFabric/lib/models/nodeOpenFailedEvent.js @@ -60,6 +60,13 @@ class NodeOpenFailedEvent extends models['NodeEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/nodeOpenSucceededEvent.js b/lib/services/serviceFabric/lib/models/nodeOpenSucceededEvent.js new file mode 100644 index 0000000000..94dfa34b54 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeOpenSucceededEvent.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'); + +/** + * Node Opened Succeeded event. + * + * @extends models['NodeEvent'] + */ +class NodeOpenSucceededEvent extends models['NodeEvent'] { + /** + * Create a NodeOpenSucceededEvent. + * @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 NodeOpenSucceededEvent + * + * @returns {object} metadata of NodeOpenSucceededEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeOpenSucceeded', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeOpenSucceededEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = NodeOpenSucceededEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeRemovedFromClusterEvent.js b/lib/services/serviceFabric/lib/models/nodeRemovedFromClusterEvent.js new file mode 100644 index 0000000000..bf9c1345fc --- /dev/null +++ b/lib/services/serviceFabric/lib/models/nodeRemovedFromClusterEvent.js @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 NodeRemovedFromClusterEvent extends models['NodeEvent'] { + /** + * Create a NodeRemovedFromClusterEvent. + * @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 NodeRemovedFromClusterEvent + * + * @returns {object} metadata of NodeRemovedFromClusterEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'NodeRemovedFromCluster', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'NodeRemovedFromClusterEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = NodeRemovedFromClusterEvent; diff --git a/lib/services/serviceFabric/lib/models/nodeUpEvent.js b/lib/services/serviceFabric/lib/models/nodeUpEvent.js index cfb4eceb32..1b4ec84caa 100644 --- a/lib/services/serviceFabric/lib/models/nodeUpEvent.js +++ b/lib/services/serviceFabric/lib/models/nodeUpEvent.js @@ -53,6 +53,13 @@ class NodeUpEvent extends models['NodeEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/pagedApplicationResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedApplicationResourceDescriptionList.js new file mode 100644 index 0000000000..82f8489b9f --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedApplicationResourceDescriptionList.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 application resources. 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 PagedApplicationResourceDescriptionList { + /** + * Create a PagedApplicationResourceDescriptionList. + * @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] One page of the list. + */ + constructor() { + } + + /** + * Defines the metadata of PagedApplicationResourceDescriptionList + * + * @returns {object} metadata of PagedApplicationResourceDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedApplicationResourceDescriptionList', + type: { + name: 'Composite', + className: 'PagedApplicationResourceDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'ApplicationResourceDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedApplicationResourceDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedGatewayResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedGatewayResourceDescriptionList.js new file mode 100644 index 0000000000..8c0588282c --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedGatewayResourceDescriptionList.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 gateway resources. 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 PagedGatewayResourceDescriptionList { + /** + * Create a PagedGatewayResourceDescriptionList. + * @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] One page of the list. + */ + constructor() { + } + + /** + * Defines the metadata of PagedGatewayResourceDescriptionList + * + * @returns {object} metadata of PagedGatewayResourceDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedGatewayResourceDescriptionList', + type: { + name: 'Composite', + className: 'PagedGatewayResourceDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GatewayResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'GatewayResourceDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedGatewayResourceDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedNetworkResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedNetworkResourceDescriptionList.js new file mode 100644 index 0000000000..f767a282fb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedNetworkResourceDescriptionList.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 network resources. 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 PagedNetworkResourceDescriptionList { + /** + * Create a PagedNetworkResourceDescriptionList. + * @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] One page of the list. + */ + constructor() { + } + + /** + * Defines the metadata of PagedNetworkResourceDescriptionList + * + * @returns {object} metadata of PagedNetworkResourceDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedNetworkResourceDescriptionList', + type: { + name: 'Composite', + className: 'PagedNetworkResourceDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'NetworkResourceDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedNetworkResourceDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedSecretResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedSecretResourceDescriptionList.js new file mode 100644 index 0000000000..a4032bbbfb --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedSecretResourceDescriptionList.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 secret resources. 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 PagedSecretResourceDescriptionList { + /** + * Create a PagedSecretResourceDescriptionList. + * @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] One page of the list. + */ + constructor() { + } + + /** + * Defines the metadata of PagedSecretResourceDescriptionList + * + * @returns {object} metadata of PagedSecretResourceDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedSecretResourceDescriptionList', + type: { + name: 'Composite', + className: 'PagedSecretResourceDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecretResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'SecretResourceDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedSecretResourceDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedSecretValueResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedSecretValueResourceDescriptionList.js new file mode 100644 index 0000000000..6d2d3838ae --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedSecretValueResourceDescriptionList.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 values of a secret resource, paged if the number of results + * exceeds the limits of a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * the previous page. + * + */ +class PagedSecretValueResourceDescriptionList { + /** + * Create a PagedSecretValueResourceDescriptionList. + * @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] One page of the list. + */ + constructor() { + } + + /** + * Defines the metadata of PagedSecretValueResourceDescriptionList + * + * @returns {object} metadata of PagedSecretValueResourceDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedSecretValueResourceDescriptionList', + type: { + name: 'Composite', + className: 'PagedSecretValueResourceDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecretValueResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'SecretValueResourceDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedSecretValueResourceDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedServiceReplicaDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedServiceReplicaDescriptionList.js new file mode 100644 index 0000000000..aca0aea6ba --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedServiceReplicaDescriptionList.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 resource replicas 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 PagedServiceReplicaDescriptionList { + /** + * Create a PagedServiceReplicaDescriptionList. + * @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 replica description. + */ + constructor() { + } + + /** + * Defines the metadata of PagedServiceReplicaDescriptionList + * + * @returns {object} metadata of PagedServiceReplicaDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedServiceReplicaDescriptionList', + type: { + name: 'Composite', + className: 'PagedServiceReplicaDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceReplicaDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceReplicaDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedServiceReplicaDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/pagedServiceResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedServiceResourceDescriptionList.js index b708d9bb53..e62f196a99 100644 --- a/lib/services/serviceFabric/lib/models/pagedServiceResourceDescriptionList.js +++ b/lib/services/serviceFabric/lib/models/pagedServiceResourceDescriptionList.js @@ -11,10 +11,9 @@ '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. + * The list of service resources. 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 { @@ -26,7 +25,7 @@ class PagedServiceResourceDescriptionList { * 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. + * @member {array} [items] One page of the list. */ constructor() { } diff --git a/lib/services/serviceFabric/lib/models/pagedVolumeResourceDescriptionList.js b/lib/services/serviceFabric/lib/models/pagedVolumeResourceDescriptionList.js new file mode 100644 index 0000000000..dcdb01e2f8 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/pagedVolumeResourceDescriptionList.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 volume resources. 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 PagedVolumeResourceDescriptionList { + /** + * Create a PagedVolumeResourceDescriptionList. + * @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] One page of the list. + */ + constructor() { + } + + /** + * Defines the metadata of PagedVolumeResourceDescriptionList + * + * @returns {object} metadata of PagedVolumeResourceDescriptionList + * + */ + mapper() { + return { + required: false, + serializedName: 'PagedVolumeResourceDescriptionList', + type: { + name: 'Composite', + className: 'PagedVolumeResourceDescriptionList', + modelProperties: { + continuationToken: { + required: false, + serializedName: 'ContinuationToken', + type: { + name: 'String' + } + }, + items: { + required: false, + serializedName: 'Items', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VolumeResourceDescriptionElementType', + type: { + name: 'Composite', + className: 'VolumeResourceDescription' + } + } + } + } + } + } + }; + } +} + +module.exports = PagedVolumeResourceDescriptionList; diff --git a/lib/services/serviceFabric/lib/models/partitionAnalysisEvent.js b/lib/services/serviceFabric/lib/models/partitionAnalysisEvent.js index 0df9eff7df..d93d6f919a 100644 --- a/lib/services/serviceFabric/lib/models/partitionAnalysisEvent.js +++ b/lib/services/serviceFabric/lib/models/partitionAnalysisEvent.js @@ -54,6 +54,13 @@ class PartitionAnalysisEvent extends models['PartitionEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/partitionBackupConfigurationInfo.js b/lib/services/serviceFabric/lib/models/partitionBackupConfigurationInfo.js index cbda0dac55..ea574adcd4 100644 --- a/lib/services/serviceFabric/lib/models/partitionBackupConfigurationInfo.js +++ b/lib/services/serviceFabric/lib/models/partitionBackupConfigurationInfo.js @@ -23,11 +23,7 @@ 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. + * @member {uuid} [partitionId] The partition ID indentifying the partition. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/partitionBackupEntity.js b/lib/services/serviceFabric/lib/models/partitionBackupEntity.js index 2533083c48..9dc0c890af 100644 --- a/lib/services/serviceFabric/lib/models/partitionBackupEntity.js +++ b/lib/services/serviceFabric/lib/models/partitionBackupEntity.js @@ -22,11 +22,7 @@ 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. + * @member {uuid} [partitionId] The partition ID indentifying the partition. */ constructor() { super(); diff --git a/lib/services/serviceFabric/lib/models/partitionEvent.js b/lib/services/serviceFabric/lib/models/partitionEvent.js index ba4a05c79b..9379035516 100644 --- a/lib/services/serviceFabric/lib/models/partitionEvent.js +++ b/lib/services/serviceFabric/lib/models/partitionEvent.js @@ -56,6 +56,13 @@ class PartitionEvent extends models['FabricEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/partitionHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/partitionHealthReportExpiredEvent.js index d1f8842de6..df2e903472 100644 --- a/lib/services/serviceFabric/lib/models/partitionHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/partitionHealthReportExpiredEvent.js @@ -59,6 +59,13 @@ class PartitionHealthReportExpiredEvent extends models['PartitionEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/partitionNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/partitionNewHealthReportEvent.js new file mode 100644 index 0000000000..6b16a5b6b2 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionNewHealthReportEvent.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'); + +/** + * Partition Health Report Created event. + * + * @extends models['PartitionEvent'] + */ +class PartitionNewHealthReportEvent extends models['PartitionEvent'] { + /** + * Create a PartitionNewHealthReportEvent. + * @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 PartitionNewHealthReportEvent + * + * @returns {object} metadata of PartitionNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = PartitionNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/partitionPrimaryMoveAnalysisEvent.js b/lib/services/serviceFabric/lib/models/partitionPrimaryMoveAnalysisEvent.js index 6677b99a8a..6a3a4a4f03 100644 --- a/lib/services/serviceFabric/lib/models/partitionPrimaryMoveAnalysisEvent.js +++ b/lib/services/serviceFabric/lib/models/partitionPrimaryMoveAnalysisEvent.js @@ -56,6 +56,13 @@ class PartitionPrimaryMoveAnalysisEvent extends models['PartitionAnalysisEvent'] name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/partitionReconfiguredEvent.js b/lib/services/serviceFabric/lib/models/partitionReconfiguredEvent.js new file mode 100644 index 0000000000..b2bb752e70 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/partitionReconfiguredEvent.js @@ -0,0 +1,200 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 event. + * + * @extends models['PartitionEvent'] + */ +class PartitionReconfiguredEvent extends models['PartitionEvent'] { + /** + * Create a PartitionReconfiguredEvent. + * @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 PartitionReconfiguredEvent + * + * @returns {object} metadata of PartitionReconfiguredEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'PartitionReconfigured', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'PartitionReconfiguredEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = PartitionReconfiguredEvent; diff --git a/lib/services/serviceFabric/lib/models/reliableCollectionsRef.js b/lib/services/serviceFabric/lib/models/reliableCollectionsRef.js new file mode 100644 index 0000000000..6f2dbfb239 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/reliableCollectionsRef.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Specifying this parameter adds support for reliable collections + * + */ +class ReliableCollectionsRef { + /** + * Create a ReliableCollectionsRef. + * @member {string} name Name of ReliableCollection resource. Right now it's + * not used and you can use any string. + * @member {boolean} [doNotPersistState] False (the default) if + * ReliableCollections state is persisted to disk as usual. True if you do + * not want to persist state, in which case replication is still enabled and + * you can use ReliableCollections as distributed cache. + */ + constructor() { + } + + /** + * Defines the metadata of ReliableCollectionsRef + * + * @returns {object} metadata of ReliableCollectionsRef + * + */ + mapper() { + return { + required: false, + serializedName: 'ReliableCollectionsRef', + type: { + name: 'Composite', + className: 'ReliableCollectionsRef', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + doNotPersistState: { + required: false, + serializedName: 'doNotPersistState', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ReliableCollectionsRef; diff --git a/lib/services/serviceFabric/lib/models/replicaEvent.js b/lib/services/serviceFabric/lib/models/replicaEvent.js index 5dddbddf1f..3e20ebd6c0 100644 --- a/lib/services/serviceFabric/lib/models/replicaEvent.js +++ b/lib/services/serviceFabric/lib/models/replicaEvent.js @@ -63,6 +63,13 @@ class ReplicaEvent extends models['FabricEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/restoreProgressInfo.js b/lib/services/serviceFabric/lib/models/restoreProgressInfo.js index 743a88c9a7..45ef422360 100644 --- a/lib/services/serviceFabric/lib/models/restoreProgressInfo.js +++ b/lib/services/serviceFabric/lib/models/restoreProgressInfo.js @@ -24,11 +24,11 @@ class RestoreProgressInfo { * failed. * @member {object} [restoredEpoch] Describes the epoch at which the * partition is restored. - * @member {string} [restoredEpoch.configurationNumber] The current + * @member {string} [restoredEpoch.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. - * @member {string} [restoredEpoch.dataLossNumber] The current dataloss + * @member {string} [restoredEpoch.dataLossVersion] 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. @@ -85,6 +85,7 @@ class RestoreProgressInfo { * - "FABRIC_E_BACKUP_NOT_ENABLED" * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * - "FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR" * * - Possible values of the error code for HTTP status code 409 (Conflict) * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" @@ -196,7 +197,7 @@ class RestoreProgressInfo { * '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' + * 'SerializationError', 'FABRIC_E_IMAGEBUILDER_RESERVED_DIRECTORY_ERROR' * @member {string} [failureError.message] Error message. */ constructor() { @@ -235,7 +236,7 @@ class RestoreProgressInfo { serializedName: 'RestoredEpoch', type: { name: 'Composite', - className: 'BackupEpoch' + className: 'Epoch' } }, restoredLsn: { diff --git a/lib/services/serviceFabric/lib/models/retentionPolicyDescription.js b/lib/services/serviceFabric/lib/models/retentionPolicyDescription.js new file mode 100644 index 0000000000..4b07347997 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/retentionPolicyDescription.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 retention policy configured. + * + */ +class RetentionPolicyDescription { + /** + * Create a RetentionPolicyDescription. + * @member {string} retentionPolicyType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of RetentionPolicyDescription + * + * @returns {object} metadata of RetentionPolicyDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'RetentionPolicyDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'RetentionPolicyType', + clientName: 'retentionPolicyType' + }, + uberParent: 'RetentionPolicyDescription', + className: 'RetentionPolicyDescription', + modelProperties: { + retentionPolicyType: { + required: true, + serializedName: 'RetentionPolicyType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RetentionPolicyDescription; diff --git a/lib/services/serviceFabric/lib/models/secretResourceDescription.js b/lib/services/serviceFabric/lib/models/secretResourceDescription.js new file mode 100644 index 0000000000..af9b81f940 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/secretResourceDescription.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'; + +/** + * This type describes a secret resource. + * + */ +class SecretResourceDescription { + /** + * Create a SecretResourceDescription. + * @member {object} properties Describes the properties of a secret resource. + * @member {string} [properties.description] User readable description of the + * secret. + * @member {string} [properties.status] Status of the resource. Possible + * values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', + * 'Failed' + * @member {string} [properties.statusDetails] Gives additional information + * about the current status of the secret. + * @member {string} [properties.contentType] The type of the content stored + * in the secret value. The value of this property is opaque to Service + * Fabric. Once set, the value of this property cannot be changed. + * @member {string} name Name of the Secret resource. + */ + constructor() { + } + + /** + * Defines the metadata of SecretResourceDescription + * + * @returns {object} metadata of SecretResourceDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretResourceDescription', + type: { + name: 'Composite', + className: 'SecretResourceDescription', + modelProperties: { + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'SecretResourcePropertiesBase', + className: 'SecretResourceProperties' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretResourceDescription; diff --git a/lib/services/serviceFabric/lib/models/secretResourceProperties.js b/lib/services/serviceFabric/lib/models/secretResourceProperties.js new file mode 100644 index 0000000000..2fddbb1bbc --- /dev/null +++ b/lib/services/serviceFabric/lib/models/secretResourceProperties.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'); + +/** + * Describes the properties of a secret resource. + * + * @extends models['SecretResourcePropertiesBase'] + */ +class SecretResourceProperties extends models['SecretResourcePropertiesBase'] { + /** + * Create a SecretResourceProperties. + * @member {string} [description] User readable description of the secret. + * @member {string} [status] Status of the resource. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the secret. + * @member {string} [contentType] The type of the content stored in the + * secret value. The value of this property is opaque to Service Fabric. Once + * set, the value of this property cannot be changed. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SecretResourceProperties + * + * @returns {object} metadata of SecretResourceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretResourceProperties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'SecretResourcePropertiesBase', + className: 'SecretResourceProperties', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'statusDetails', + type: { + name: 'String' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretResourceProperties; diff --git a/lib/services/serviceFabric/lib/models/secretResourcePropertiesBase.js b/lib/services/serviceFabric/lib/models/secretResourcePropertiesBase.js new file mode 100644 index 0000000000..94232170d1 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/secretResourcePropertiesBase.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'; + +/** + * This type describes the properties of a secret resource, including its kind. + * + */ +class SecretResourcePropertiesBase { + /** + * Create a SecretResourcePropertiesBase. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of SecretResourcePropertiesBase + * + * @returns {object} metadata of SecretResourcePropertiesBase + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretResourcePropertiesBase', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'SecretResourcePropertiesBase', + className: 'SecretResourcePropertiesBase', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretResourcePropertiesBase; diff --git a/lib/services/serviceFabric/lib/models/secretValue.js b/lib/services/serviceFabric/lib/models/secretValue.js new file mode 100644 index 0000000000..f9f33de524 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/secretValue.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'; + +/** + * This type represents the unencrypted value of the secret. + * + */ +class SecretValue { + /** + * Create a SecretValue. + * @member {string} [value] The actual value of the secret. + */ + constructor() { + } + + /** + * Defines the metadata of SecretValue + * + * @returns {object} metadata of SecretValue + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretValue', + type: { + name: 'Composite', + className: 'SecretValue', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretValue; diff --git a/lib/services/serviceFabric/lib/models/secretValueProperties.js b/lib/services/serviceFabric/lib/models/secretValueProperties.js new file mode 100644 index 0000000000..4949e1b599 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/secretValueProperties.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'; + +/** + * This type describes properties of secret value resource. + * + */ +class SecretValueProperties { + /** + * Create a SecretValueProperties. + * @member {string} [value] The actual value of the secret. + */ + constructor() { + } + + /** + * Defines the metadata of SecretValueProperties + * + * @returns {object} metadata of SecretValueProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretValueProperties', + type: { + name: 'Composite', + className: 'SecretValueProperties', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretValueProperties; diff --git a/lib/services/serviceFabric/lib/models/secretValueResourceDescription.js b/lib/services/serviceFabric/lib/models/secretValueResourceDescription.js new file mode 100644 index 0000000000..baa7142447 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/secretValueResourceDescription.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 value of a secret resource. The name of this resource + * is the version identifier corresponding to this secret value. + * + */ +class SecretValueResourceDescription { + /** + * Create a SecretValueResourceDescription. + * @member {string} name Version identifier of the secret value. + * @member {string} [value] The actual value of the secret. + */ + constructor() { + } + + /** + * Defines the metadata of SecretValueResourceDescription + * + * @returns {object} metadata of SecretValueResourceDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'SecretValueResourceDescription', + type: { + name: 'Composite', + className: 'SecretValueResourceDescription', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'properties.value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SecretValueResourceDescription; diff --git a/lib/services/serviceFabric/lib/models/serviceCreatedEvent.js b/lib/services/serviceFabric/lib/models/serviceCreatedEvent.js index 9732914087..17eb3824a1 100644 --- a/lib/services/serviceFabric/lib/models/serviceCreatedEvent.js +++ b/lib/services/serviceFabric/lib/models/serviceCreatedEvent.js @@ -65,6 +65,13 @@ class ServiceCreatedEvent extends models['ServiceEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/serviceDeletedEvent.js b/lib/services/serviceFabric/lib/models/serviceDeletedEvent.js index 2905650e7a..69581bfe4c 100644 --- a/lib/services/serviceFabric/lib/models/serviceDeletedEvent.js +++ b/lib/services/serviceFabric/lib/models/serviceDeletedEvent.js @@ -60,6 +60,13 @@ class ServiceDeletedEvent extends models['ServiceEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/serviceEvent.js b/lib/services/serviceFabric/lib/models/serviceEvent.js index fb1a8d87c6..8e3a97bcef 100644 --- a/lib/services/serviceFabric/lib/models/serviceEvent.js +++ b/lib/services/serviceFabric/lib/models/serviceEvent.js @@ -58,6 +58,13 @@ class ServiceEvent extends models['FabricEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/serviceHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/serviceHealthReportExpiredEvent.js index 469953a18a..da57e57d52 100644 --- a/lib/services/serviceFabric/lib/models/serviceHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/serviceHealthReportExpiredEvent.js @@ -60,6 +60,13 @@ class ServiceHealthReportExpiredEvent extends models['ServiceEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/serviceNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/serviceNewHealthReportEvent.js new file mode 100644 index 0000000000..5b5b6c9696 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceNewHealthReportEvent.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'); + +/** + * Service Health Report Created event. + * + * @extends models['ServiceEvent'] + */ +class ServiceNewHealthReportEvent extends models['ServiceEvent'] { + /** + * Create a ServiceNewHealthReportEvent. + * @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 ServiceNewHealthReportEvent + * + * @returns {object} metadata of ServiceNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'ServiceNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = ServiceNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/serviceProperties.js b/lib/services/serviceFabric/lib/models/serviceProperties.js new file mode 100644 index 0000000000..aa5162600d --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceProperties.js @@ -0,0 +1,119 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 properties of a service resource. + * + */ +class ServiceProperties { + /** + * Create a ServiceProperties. + * @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 {array} [autoScalingPolicies] Auto scaling policies + * @member {string} [status] Status of the service. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the service. + * @member {string} [healthState] Describes the health state of an + * application resource. Possible values include: 'Invalid', 'Ok', 'Warning', + * 'Error', 'Unknown' + * @member {string} [unhealthyEvaluation] When the service's health state is + * not 'Ok', this additional details from service fabric Health Manager for + * the user to know why the service is marked unhealthy. + */ + constructor() { + } + + /** + * Defines the metadata of ServiceProperties + * + * @returns {object} metadata of ServiceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceProperties', + type: { + name: 'Composite', + className: 'ServiceProperties', + modelProperties: { + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + replicaCount: { + required: false, + serializedName: 'replicaCount', + type: { + name: 'Number' + } + }, + autoScalingPolicies: { + required: false, + serializedName: 'autoScalingPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AutoScalingPolicyElementType', + type: { + name: 'Composite', + className: 'AutoScalingPolicy' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'statusDetails', + type: { + name: 'String' + } + }, + healthState: { + required: false, + readOnly: true, + serializedName: 'healthState', + type: { + name: 'String' + } + }, + unhealthyEvaluation: { + required: false, + readOnly: true, + serializedName: 'unhealthyEvaluation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceProperties; diff --git a/lib/services/serviceFabric/lib/models/serviceReplicaDescription.js b/lib/services/serviceFabric/lib/models/serviceReplicaDescription.js new file mode 100644 index 0000000000..1156262906 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/serviceReplicaDescription.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 ServiceReplicaDescription extends models['ServiceReplicaProperties'] { + /** + * Create a ServiceReplicaDescription. + * @member {string} replicaName Name of the replica. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceReplicaDescription + * + * @returns {object} metadata of ServiceReplicaDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceReplicaDescription', + type: { + name: 'Composite', + className: 'ServiceReplicaDescription', + 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 = ServiceReplicaDescription; diff --git a/lib/services/serviceFabric/lib/models/serviceReplicaProperties.js b/lib/services/serviceFabric/lib/models/serviceReplicaProperties.js index 95eee1521a..746faab5e5 100644 --- a/lib/services/serviceFabric/lib/models/serviceReplicaProperties.js +++ b/lib/services/serviceFabric/lib/models/serviceReplicaProperties.js @@ -17,7 +17,7 @@ class ServiceReplicaProperties { /** * Create a ServiceReplicaProperties. - * @member {string} osType The Operating system type required by the code in + * @member {string} osType The operation system 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 diff --git a/lib/services/serviceFabric/lib/models/serviceResourceDescription.js b/lib/services/serviceFabric/lib/models/serviceResourceDescription.js index c27548f4a6..6ba64667f1 100644 --- a/lib/services/serviceFabric/lib/models/serviceResourceDescription.js +++ b/lib/services/serviceFabric/lib/models/serviceResourceDescription.js @@ -11,13 +11,14 @@ 'use strict'; /** - * Describes a service fabric service resource. + * This type describes a service resource. * */ class ServiceResourceDescription { /** * Create a ServiceResourceDescription. - * @member {string} osType The Operating system type required by the code in + * @member {string} name Name of the Service resource. + * @member {string} osType The operation system 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 @@ -34,13 +35,17 @@ class ServiceResourceDescription { * @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. + * @member {array} [autoScalingPolicies] Auto scaling policies + * @member {string} [status] Status of the service. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status of the service. + * @member {string} [healthState] Describes the health state of an + * application resource. Possible values include: 'Invalid', 'Ok', 'Warning', + * 'Error', 'Unknown' + * @member {string} [unhealthyEvaluation] When the service's health state is + * not 'Ok', this additional details from service fabric Health Manager for + * the user to know why the service is marked unhealthy. */ constructor() { } @@ -59,6 +64,13 @@ class ServiceResourceDescription { name: 'Composite', className: 'ServiceResourceDescription', modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, osType: { required: true, serializedName: 'properties.osType', @@ -118,11 +130,19 @@ class ServiceResourceDescription { name: 'Number' } }, - healthState: { + autoScalingPolicies: { required: false, - serializedName: 'properties.healthState', + serializedName: 'properties.autoScalingPolicies', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'AutoScalingPolicyElementType', + type: { + name: 'Composite', + className: 'AutoScalingPolicy' + } + } } }, status: { @@ -133,9 +153,26 @@ class ServiceResourceDescription { name: 'String' } }, - name: { - required: true, - serializedName: 'name', + statusDetails: { + required: false, + readOnly: true, + serializedName: 'properties.statusDetails', + type: { + name: 'String' + } + }, + healthState: { + required: false, + readOnly: true, + serializedName: 'properties.healthState', + type: { + name: 'String' + } + }, + unhealthyEvaluation: { + required: false, + readOnly: true, + serializedName: 'properties.unhealthyEvaluation', type: { name: 'String' } diff --git a/lib/services/serviceFabric/lib/models/setting.js b/lib/services/serviceFabric/lib/models/setting.js index 08c2599bd0..234443be5c 100644 --- a/lib/services/serviceFabric/lib/models/setting.js +++ b/lib/services/serviceFabric/lib/models/setting.js @@ -11,7 +11,9 @@ 'use strict'; /** - * Describes a setting for the container. + * Describes a setting for the 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". * */ class Setting { diff --git a/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportExpiredEvent.js index 924b50773b..0719325c1e 100644 --- a/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/statefulReplicaHealthReportExpiredEvent.js @@ -60,6 +60,13 @@ class StatefulReplicaHealthReportExpiredEvent extends models['ReplicaEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/statefulReplicaNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/statefulReplicaNewHealthReportEvent.js new file mode 100644 index 0000000000..5d9d968009 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/statefulReplicaNewHealthReportEvent.js @@ -0,0 +1,175 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 StatefulReplicaNewHealthReportEvent extends models['ReplicaEvent'] { + /** + * Create a StatefulReplicaNewHealthReportEvent. + * @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 StatefulReplicaNewHealthReportEvent + * + * @returns {object} metadata of StatefulReplicaNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'StatefulReplicaNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'StatefulReplicaNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = StatefulReplicaNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js b/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js index 90938bc300..e80d882ca9 100644 --- a/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js +++ b/lib/services/serviceFabric/lib/models/statefulServicePartitionInfo.js @@ -28,20 +28,19 @@ 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] 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 + * @member {object} [primaryEpoch] 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} [primaryEpoch.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. - * @member {string} [currentConfigurationEpoch.dataLossVersion] 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} [primaryEpoch.dataLossVersion] 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() { super(); @@ -122,9 +121,9 @@ class StatefulServicePartitionInfo extends models['ServicePartitionInfo'] { name: 'TimeSpan' } }, - currentConfigurationEpoch: { + primaryEpoch: { required: false, - serializedName: 'CurrentConfigurationEpoch', + serializedName: 'PrimaryEpoch', type: { name: 'Composite', className: 'Epoch' diff --git a/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportExpiredEvent.js b/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportExpiredEvent.js index 6b9232a954..49b9220eb1 100644 --- a/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportExpiredEvent.js +++ b/lib/services/serviceFabric/lib/models/statelessReplicaHealthReportExpiredEvent.js @@ -59,6 +59,13 @@ class StatelessReplicaHealthReportExpiredEvent extends models['ReplicaEvent'] { name: 'String' } }, + category: { + required: false, + serializedName: 'Category', + type: { + name: 'String' + } + }, timeStamp: { required: true, serializedName: 'TimeStamp', diff --git a/lib/services/serviceFabric/lib/models/statelessReplicaNewHealthReportEvent.js b/lib/services/serviceFabric/lib/models/statelessReplicaNewHealthReportEvent.js new file mode 100644 index 0000000000..cfa01e92d1 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/statelessReplicaNewHealthReportEvent.js @@ -0,0 +1,167 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 StatelessReplicaNewHealthReportEvent extends models['ReplicaEvent'] { + /** + * Create a StatelessReplicaNewHealthReportEvent. + * @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 StatelessReplicaNewHealthReportEvent + * + * @returns {object} metadata of StatelessReplicaNewHealthReportEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'StatelessReplicaNewHealthReport', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Kind', + clientName: 'kind' + }, + uberParent: 'FabricEvent', + className: 'StatelessReplicaNewHealthReportEvent', + modelProperties: { + eventInstanceId: { + required: true, + serializedName: 'EventInstanceId', + type: { + name: 'String' + } + }, + category: { + required: false, + serializedName: 'Category', + 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 = StatelessReplicaNewHealthReportEvent; diff --git a/lib/services/serviceFabric/lib/models/tcpConfig.js b/lib/services/serviceFabric/lib/models/tcpConfig.js new file mode 100644 index 0000000000..78868cec39 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/tcpConfig.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'; + +/** + * Describes the tcp configuration for external connectivity for this network. + * + */ +class TcpConfig { + /** + * Create a TcpConfig. + * @member {string} name tcp gateway config name. + * @member {number} port Specifies the port at which the service endpoint + * below needs to be exposed. + * @member {object} destination Describes destination endpoint for routing + * traffic. + * @member {string} [destination.applicationName] Name of the service fabric + * Mesh application. + * @member {string} [destination.serviceName] service that contains the + * endpoint. + * @member {string} [destination.endpointName] name of the endpoint in the + * service. + */ + constructor() { + } + + /** + * Defines the metadata of TcpConfig + * + * @returns {object} metadata of TcpConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'TcpConfig', + type: { + name: 'Composite', + className: 'TcpConfig', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + port: { + required: true, + serializedName: 'port', + type: { + name: 'Number' + } + }, + destination: { + required: true, + serializedName: 'destination', + type: { + name: 'Composite', + className: 'GatewayDestination' + } + } + } + } + }; + } +} + +module.exports = TcpConfig; diff --git a/lib/services/serviceFabric/lib/models/volumeReference.js b/lib/services/serviceFabric/lib/models/volumeReference.js new file mode 100644 index 0000000000..735365ba28 --- /dev/null +++ b/lib/services/serviceFabric/lib/models/volumeReference.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 a reference to a volume resource. + * + */ +class VolumeReference { + /** + * Create a VolumeReference. + * @member {string} name Name of the volume being referenced. + * @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 VolumeReference + * + * @returns {object} metadata of VolumeReference + * + */ + mapper() { + return { + required: false, + serializedName: 'VolumeReference', + type: { + name: 'Composite', + className: 'VolumeReference', + 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 = VolumeReference; diff --git a/lib/services/serviceFabric/lib/models/volumeResourceDescription.js b/lib/services/serviceFabric/lib/models/volumeResourceDescription.js index cfa9343838..91ea223658 100644 --- a/lib/services/serviceFabric/lib/models/volumeResourceDescription.js +++ b/lib/services/serviceFabric/lib/models/volumeResourceDescription.js @@ -11,13 +11,18 @@ 'use strict'; /** - * Describes a service fabric volume resource. + * This type describes a volume resource. * */ class VolumeResourceDescription { /** * Create a VolumeResourceDescription. + * @member {string} name Name of the Volume resource. * @member {string} [description] User readable description of the volume. + * @member {string} [status] Status of the volume. Possible values include: + * 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' + * @member {string} [statusDetails] Gives additional information about the + * current status 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 @@ -26,7 +31,6 @@ class VolumeResourceDescription { * 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() { } @@ -45,6 +49,13 @@ class VolumeResourceDescription { name: 'Composite', className: 'VolumeResourceDescription', modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, description: { required: false, serializedName: 'properties.description', @@ -52,6 +63,22 @@ class VolumeResourceDescription { name: 'String' } }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + readOnly: true, + serializedName: 'properties.statusDetails', + type: { + name: 'String' + } + }, provider: { required: true, isConstant: true, @@ -68,13 +95,6 @@ class VolumeResourceDescription { name: 'Composite', className: 'VolumeProviderParametersAzureFile' } - }, - name: { - required: true, - serializedName: 'name', - type: { - name: 'String' - } } } } diff --git a/lib/services/serviceFabric/lib/operations/index.d.ts b/lib/services/serviceFabric/lib/operations/index.d.ts new file mode 100644 index 0000000000..34b0527310 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/index.d.ts @@ -0,0 +1,2240 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * MeshSecret + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshSecret { + + + /** + * @summary Creates or updates a Secret resource. + * + * Creates a Secret resource with the specified name, description and + * properties. If Secret resource with the same name exists, then it is updated + * with the specified description and properties. Once created, the kind and + * contentType of a secret resource cannot be updated. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} secretResourceDescription Description for creating a secret + * resource. + * + * @param {object} secretResourceDescription.properties Describes the + * properties of a secret resource. + * + * @param {string} [secretResourceDescription.properties.description] User + * readable description of the secret. + * + * @param {string} [secretResourceDescription.properties.contentType] The type + * of the content stored in the secret value. The value of this property is + * opaque to Service Fabric. Once set, the value of this property cannot be + * changed. + * + * @param {string} secretResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {string} secretResourceDescription.name Name of the Secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(secretResourceName: string, secretResourceDescription: models.SecretResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Secret resource. + * + * Creates a Secret resource with the specified name, description and + * properties. If Secret resource with the same name exists, then it is updated + * with the specified description and properties. Once created, the kind and + * contentType of a secret resource cannot be updated. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} secretResourceDescription Description for creating a secret + * resource. + * + * @param {object} secretResourceDescription.properties Describes the + * properties of a secret resource. + * + * @param {string} [secretResourceDescription.properties.description] User + * readable description of the secret. + * + * @param {string} [secretResourceDescription.properties.contentType] The type + * of the content stored in the secret value. The value of this property is + * opaque to Service Fabric. Once set, the value of this property cannot be + * changed. + * + * @param {string} secretResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {string} secretResourceDescription.name Name of the Secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretResourceDescription} - 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. + * + * {SecretResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link SecretResourceDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(secretResourceName: string, secretResourceDescription: models.SecretResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(secretResourceName: string, secretResourceDescription: models.SecretResourceDescription, callback: ServiceCallback): void; + createOrUpdate(secretResourceName: string, secretResourceDescription: models.SecretResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Secret resource with the given name. + * + * Gets the information about the Secret resource with the given name. The + * information include the description and other properties of the Secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(secretResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Secret resource with the given name. + * + * Gets the information about the Secret resource with the given name. The + * information include the description and other properties of the Secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecretResourceDescription} - 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. + * + * {SecretResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link SecretResourceDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(secretResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(secretResourceName: string, callback: ServiceCallback): void; + get(secretResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the Secret resource. + * + * Deletes the specified Secret resource and all of its named values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(secretResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the Secret resource. + * + * Deletes the specified Secret resource and all of its named values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(secretResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(secretResourceName: string, callback: ServiceCallback): void; + deleteMethod(secretResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists all the secret resources. + * + * Gets the information about all secret resources in a given resource group. + * The information include the description and other properties of the Secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists all the secret resources. + * + * Gets the information about all secret resources in a given resource group. + * The information include the description and other properties of the Secret. + * + * @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 {PagedSecretResourceDescriptionList} - 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. + * + * {PagedSecretResourceDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedSecretResourceDescriptionList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshSecretValue + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshSecretValue { + + + /** + * @summary Adds the specified value as a new version of the specified secret + * resource. + * + * Creates a new value of the specified secret resource. The name of the value + * is typically the version identifier. Once created the value cannot be + * changed. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} secretValueResourceDescription Description for creating a + * value of a secret resource. + * + * @param {string} secretValueResourceDescription.name Version identifier of + * the secret value. + * + * @param {string} [secretValueResourceDescription.value] The actual value of + * the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + addValueWithHttpOperationResponse(secretResourceName: string, secretValueResourceName: string, secretValueResourceDescription: models.SecretValueResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds the specified value as a new version of the specified secret + * resource. + * + * Creates a new value of the specified secret resource. The name of the value + * is typically the version identifier. Once created the value cannot be + * changed. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} secretValueResourceDescription Description for creating a + * value of a secret resource. + * + * @param {string} secretValueResourceDescription.name Version identifier of + * the secret value. + * + * @param {string} [secretValueResourceDescription.value] The actual value of + * the secret. + * + * @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 {SecretValueResourceDescription} - 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. + * + * {SecretValueResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link SecretValueResourceDescription} 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. + */ + addValue(secretResourceName: string, secretValueResourceName: string, secretValueResourceDescription: models.SecretValueResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + addValue(secretResourceName: string, secretValueResourceName: string, secretValueResourceDescription: models.SecretValueResourceDescription, callback: ServiceCallback): void; + addValue(secretResourceName: string, secretValueResourceName: string, secretValueResourceDescription: models.SecretValueResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the specified secret value resource. + * + * Get the information about the specified named secret value resources. The + * information does not include the actual value of the secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the 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. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(secretResourceName: string, secretValueResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the specified secret value resource. + * + * Get the information about the specified named secret value resources. The + * information does not include the actual value of the secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @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 {SecretValueResourceDescription} - 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. + * + * {SecretValueResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link SecretValueResourceDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(secretResourceName: string, secretValueResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(secretResourceName: string, secretValueResourceName: string, callback: ServiceCallback): void; + get(secretResourceName: string, secretValueResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the specified value of the named secret resource. + * + * Deletes the secret value resource identified by the name. The name of the + * resource is typically the version associated with that value. Deletion will + * fail if the specified value is in use. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the 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. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(secretResourceName: string, secretValueResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the specified value of the named secret resource. + * + * Deletes the secret value resource identified by the name. The name of the + * resource is typically the version associated with that value. Deletion will + * fail if the specified value is in use. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(secretResourceName: string, secretValueResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(secretResourceName: string, secretValueResourceName: string, callback: ServiceCallback): void; + deleteMethod(secretResourceName: string, secretValueResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List names of all values of the the specified secret resource. + * + * Gets information about all secret value resources of the specified secret + * resource. The information includes the names of the secret value resources, + * but not the actual values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(secretResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List names of all values of the the specified secret resource. + * + * Gets information about all secret value resources of the specified secret + * resource. The information includes the names of the secret value resources, + * but not the actual values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PagedSecretValueResourceDescriptionList} - 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. + * + * {PagedSecretValueResourceDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedSecretValueResourceDescriptionList} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(secretResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(secretResourceName: string, callback: ServiceCallback): void; + list(secretResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists the specified value of the secret resource. + * + * Lists the decrypted value of the specified named value of the secret + * resource. This is a privileged operation. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the 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. + * + * @reject {Error|ServiceError} - The error object. + */ + showWithHttpOperationResponse(secretResourceName: string, secretValueResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists the specified value of the secret resource. + * + * Lists the decrypted value of the specified named value of the secret + * resource. This is a privileged operation. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @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 {SecretValue} - 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. + * + * {SecretValue} [result] - The deserialized result object if an error did not occur. + * See {@link SecretValue} 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. + */ + show(secretResourceName: string, secretValueResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + show(secretResourceName: string, secretValueResourceName: string, callback: ServiceCallback): void; + show(secretResourceName: string, secretValueResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshVolume + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshVolume { + + + /** + * @summary Creates or updates a Volume resource. + * + * Creates a Volume resource with the specified name, description and + * properties. If Volume resource with the same name exists, then it is updated + * with the specified description and properties. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} volumeResourceDescription Description for creating a Volume + * resource. + * + * @param {string} volumeResourceDescription.name Name of the 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Volume resource. + * + * Creates a Volume resource with the specified name, description and + * properties. If Volume resource with the same name exists, then it is updated + * with the specified description and properties. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} volumeResourceDescription Description for creating a Volume + * resource. + * + * @param {string} volumeResourceDescription.name Name of the 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 {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 {VolumeResourceDescription} - 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. + * + * {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. + */ + createOrUpdate(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, callback: ServiceCallback): void; + createOrUpdate(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Volume resource with the given name. + * + * Gets the information about the Volume resource with the given name. The + * information include the description and other properties of the Volume. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Volume resource with the given name. + * + * Gets the information about the Volume resource with the given name. The + * information include the description and other properties of the Volume. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @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 {VolumeResourceDescription} - 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. + * + * {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. + */ + get(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(volumeResourceName: string, callback: ServiceCallback): void; + get(volumeResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the Volume resource. + * + * Deletes the Volume resource identified by the name. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the Volume resource. + * + * Deletes the Volume resource identified by the name. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(volumeResourceName: string, callback: ServiceCallback): void; + deleteMethod(volumeResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists all the volume resources. + * + * Gets the information about all volume resources in a given resource group. + * The information include the description and other properties of the Volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists all the volume resources. + * + * Gets the information about all volume resources in a given resource group. + * The information include the description and other properties of the Volume. + * + * @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 {PagedVolumeResourceDescriptionList} - 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. + * + * {PagedVolumeResourceDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedVolumeResourceDescriptionList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshNetwork + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshNetwork { + + + /** + * @summary Creates or updates a Network resource. + * + * Creates a Network resource with the specified name, description and + * properties. If Network resource with the same name exists, then it is + * updated with the specified description and properties. Network resource + * provides connectivity between application services. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} networkResourceDescription Description for creating a + * Network resource. + * + * @param {string} networkResourceDescription.name Name of the Network + * resource. + * + * @param {object} networkResourceDescription.properties Describes properties + * of a network resource. + * + * @param {string} [networkResourceDescription.properties.description] User + * readable description of the network. + * + * @param {string} networkResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(networkResourceName: string, networkResourceDescription: models.NetworkResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Network resource. + * + * Creates a Network resource with the specified name, description and + * properties. If Network resource with the same name exists, then it is + * updated with the specified description and properties. Network resource + * provides connectivity between application services. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} networkResourceDescription Description for creating a + * Network resource. + * + * @param {string} networkResourceDescription.name Name of the Network + * resource. + * + * @param {object} networkResourceDescription.properties Describes properties + * of a network resource. + * + * @param {string} [networkResourceDescription.properties.description] User + * readable description of the network. + * + * @param {string} networkResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @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 {NetworkResourceDescription} - 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. + * + * {NetworkResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkResourceDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(networkResourceName: string, networkResourceDescription: models.NetworkResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(networkResourceName: string, networkResourceDescription: models.NetworkResourceDescription, callback: ServiceCallback): void; + createOrUpdate(networkResourceName: string, networkResourceDescription: models.NetworkResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Network resource with the given name. + * + * Gets the information about the Network resource with the given name. The + * information include the description and other properties of the Network. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(networkResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Network resource with the given name. + * + * Gets the information about the Network resource with the given name. The + * information include the description and other properties of the Network. + * + * @param {string} networkResourceName The identity of the network. + * + * @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 {NetworkResourceDescription} - 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. + * + * {NetworkResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkResourceDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(networkResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(networkResourceName: string, callback: ServiceCallback): void; + get(networkResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the Network resource. + * + * Deletes the Network resource identified by the name. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(networkResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the Network resource. + * + * Deletes the Network resource identified by the name. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(networkResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(networkResourceName: string, callback: ServiceCallback): void; + deleteMethod(networkResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists all the network resources. + * + * Gets the information about all network resources in a given resource group. + * The information include the description and other properties of the Network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists all the network resources. + * + * Gets the information about all network resources in a given resource group. + * The information include the description and other properties of the Network. + * + * @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 {PagedNetworkResourceDescriptionList} - 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. + * + * {PagedNetworkResourceDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedNetworkResourceDescriptionList} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshApplication + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshApplication { + + + /** + * @summary Creates or updates a Application resource. + * + * Creates a Application resource with the specified name, description and + * properties. If Application resource with the same name exists, then it is + * updated with the specified description and properties. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} applicationResourceDescription Description for creating a + * Application resource. + * + * @param {string} applicationResourceDescription.name Name of the Application + * resource. + * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. + * + * @param {array} [applicationResourceDescription.services] Describes the + * services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is + * returned. The service description can be obtained by querying for the + * service resource. + * + * @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.debugParams] Internal - used + * by Visual Studio to setup the debugging session on the local development + * environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Application resource. + * + * Creates a Application resource with the specified name, description and + * properties. If Application resource with the same name exists, then it is + * updated with the specified description and properties. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} applicationResourceDescription Description for creating a + * Application resource. + * + * @param {string} applicationResourceDescription.name Name of the Application + * resource. + * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. + * + * @param {array} [applicationResourceDescription.services] Describes the + * services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is + * returned. The service description can be obtained by querying for the + * service resource. + * + * @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.debugParams] Internal - used + * by Visual Studio to setup the debugging session on the local development + * environment. + * + * @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 {ApplicationResourceDescription} - 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. + * + * {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. + */ + createOrUpdate(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, callback: ServiceCallback): void; + createOrUpdate(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Application resource with the given name. + * + * Gets the information about the Application resource with the given name. The + * information include the description and other properties of the Application. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Application resource with the given name. + * + * Gets the information about the Application resource with the given name. The + * information include the description and other properties of the Application. + * + * @param {string} applicationResourceName The identity of the application. + * + * @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 {ApplicationResourceDescription} - 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. + * + * {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. + */ + get(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(applicationResourceName: string, callback: ServiceCallback): void; + get(applicationResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the Application resource. + * + * Deletes the Application resource identified by the name. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the Application resource. + * + * Deletes the Application resource identified by the name. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(applicationResourceName: string, callback: ServiceCallback): void; + deleteMethod(applicationResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists all the application resources. + * + * Gets the information about all application resources in a given resource + * group. The information include the description and other properties of the + * Application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists all the application resources. + * + * Gets the information about all application resources in a given resource + * group. The information include the description and other properties of the + * Application. + * + * @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 {PagedApplicationResourceDescriptionList} - 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. + * + * {PagedApplicationResourceDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedApplicationResourceDescriptionList} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshService + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshService { + + + /** + * @summary Gets the Service resource with the given name. + * + * Gets the information about the Service resource with the given name. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Service resource with the given name. + * + * Gets the information about the Service resource with the given name. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @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 {ServiceResourceDescription} - 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. + * + * {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. + */ + get(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(applicationResourceName: string, serviceResourceName: string, callback: ServiceCallback): void; + get(applicationResourceName: string, serviceResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists all the service resources. + * + * Gets the information about all services of an application resource. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists all the service resources. + * + * Gets the information about all services of an application resource. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @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. + */ + list(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(applicationResourceName: string, callback: ServiceCallback): void; + list(applicationResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshCodePackage + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshCodePackage { + + + /** + * @summary Gets the logs from the container. + * + * Gets the logs for the container of the specified code package of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {string} codePackageName The name of code package of the service. + * + * @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 {object} [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. + */ + getContainerLogsWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, replicaName: string, codePackageName: string, options?: { tail? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the logs from the container. + * + * Gets the logs for the container of the specified code package of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {string} codePackageName The name of code package of the service. + * + * @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 {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. + */ + getContainerLogs(applicationResourceName: string, serviceResourceName: string, replicaName: string, codePackageName: string, options?: { tail? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getContainerLogs(applicationResourceName: string, serviceResourceName: string, replicaName: string, codePackageName: string, callback: ServiceCallback): void; + getContainerLogs(applicationResourceName: string, serviceResourceName: string, replicaName: string, codePackageName: string, options: { tail? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshServiceReplica + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshServiceReplica { + + + /** + * @summary Gets the given replica of the service of an application. + * + * Gets the information about the service replica with the given name. The + * information include the description and other properties of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, replicaName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the given replica of the service of an application. + * + * Gets the information about the service replica with the given name. The + * information include the description and other properties of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @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 {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 {ServiceReplicaDescription} - 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. + * + * {ServiceReplicaDescription} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceReplicaDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(applicationResourceName: string, serviceResourceName: string, replicaName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(applicationResourceName: string, serviceResourceName: string, replicaName: string, callback: ServiceCallback): void; + get(applicationResourceName: string, serviceResourceName: string, replicaName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists all the replicas of a service. + * + * Gets the information about all replicas of a service. The information + * include the description and other properties of the service replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists all the replicas of a service. + * + * Gets the information about all replicas of a service. The information + * include the description and other properties of the service replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @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 {PagedServiceReplicaDescriptionList} - 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. + * + * {PagedServiceReplicaDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedServiceReplicaDescriptionList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(applicationResourceName: string, serviceResourceName: string, callback: ServiceCallback): void; + list(applicationResourceName: string, serviceResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MeshGateway + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricClient. + */ +export interface MeshGateway { + + + /** + * @summary Creates or updates a Gateway resource. + * + * Creates a Gateway resource with the specified name, description and + * properties. If Gateway resource with the same name exists, then it is + * updated with the specified description and properties. Use Gateway resource + * to provide public connectivity to application services. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} gatewayResourceDescription Description for creating a + * Gateway resource. + * + * @param {string} gatewayResourceDescription.name Name of the Gateway + * resource. + * + * @param {string} [gatewayResourceDescription.description] User readable + * description of the gateway. + * + * @param {object} gatewayResourceDescription.sourceNetwork Network the gateway + * should listen on for requests. + * + * @param {object} gatewayResourceDescription.destinationNetwork Network that + * the Application is using. + * + * @param {string} [gatewayResourceDescription.destinationNetwork.name] Name of + * the network + * + * @param {array} [gatewayResourceDescription.destinationNetwork.endpointRefs] + * A list of endpoints that are exposed on this network. + * + * @param {array} [gatewayResourceDescription.tcp] Configuration for tcp + * connectivity for this gateway. + * + * @param {array} [gatewayResourceDescription.http] Configuration for http + * connectivity for this gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(gatewayResourceName: string, gatewayResourceDescription: models.GatewayResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Gateway resource. + * + * Creates a Gateway resource with the specified name, description and + * properties. If Gateway resource with the same name exists, then it is + * updated with the specified description and properties. Use Gateway resource + * to provide public connectivity to application services. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} gatewayResourceDescription Description for creating a + * Gateway resource. + * + * @param {string} gatewayResourceDescription.name Name of the Gateway + * resource. + * + * @param {string} [gatewayResourceDescription.description] User readable + * description of the gateway. + * + * @param {object} gatewayResourceDescription.sourceNetwork Network the gateway + * should listen on for requests. + * + * @param {object} gatewayResourceDescription.destinationNetwork Network that + * the Application is using. + * + * @param {string} [gatewayResourceDescription.destinationNetwork.name] Name of + * the network + * + * @param {array} [gatewayResourceDescription.destinationNetwork.endpointRefs] + * A list of endpoints that are exposed on this network. + * + * @param {array} [gatewayResourceDescription.tcp] Configuration for tcp + * connectivity for this gateway. + * + * @param {array} [gatewayResourceDescription.http] Configuration for http + * connectivity for this gateway. + * + * @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 {GatewayResourceDescription} - 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. + * + * {GatewayResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayResourceDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(gatewayResourceName: string, gatewayResourceDescription: models.GatewayResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(gatewayResourceName: string, gatewayResourceDescription: models.GatewayResourceDescription, callback: ServiceCallback): void; + createOrUpdate(gatewayResourceName: string, gatewayResourceDescription: models.GatewayResourceDescription, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Gateway resource with the given name. + * + * Gets the information about the Gateway resource with the given name. The + * information include the description and other properties of the Gateway. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(gatewayResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Gateway resource with the given name. + * + * Gets the information about the Gateway resource with the given name. The + * information include the description and other properties of the Gateway. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @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 {GatewayResourceDescription} - 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. + * + * {GatewayResourceDescription} [result] - The deserialized result object if an error did not occur. + * See {@link GatewayResourceDescription} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(gatewayResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(gatewayResourceName: string, callback: ServiceCallback): void; + get(gatewayResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the Gateway resource. + * + * Deletes the Gateway resource identified by the name. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(gatewayResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the Gateway resource. + * + * Deletes the Gateway resource identified by the name. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(gatewayResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(gatewayResourceName: string, callback: ServiceCallback): void; + deleteMethod(gatewayResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists all the gateway resources. + * + * Gets the information about all gateway resources in a given resource group. + * The information include the description and other properties of the Gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists all the gateway resources. + * + * Gets the information about all gateway resources in a given resource group. + * The information include the description and other properties of the Gateway. + * + * @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 {PagedGatewayResourceDescriptionList} - 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. + * + * {PagedGatewayResourceDescriptionList} [result] - The deserialized result object if an error did not occur. + * See {@link PagedGatewayResourceDescriptionList} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/serviceFabric/lib/operations/index.js b/lib/services/serviceFabric/lib/operations/index.js new file mode 100644 index 0000000000..e4cae9ab49 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/index.js @@ -0,0 +1,25 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.MeshSecret = require('./meshSecret'); +exports.MeshSecretValue = require('./meshSecretValue'); +exports.MeshVolume = require('./meshVolume'); +exports.MeshNetwork = require('./meshNetwork'); +exports.MeshApplication = require('./meshApplication'); +exports.MeshService = require('./meshService'); +exports.MeshCodePackage = require('./meshCodePackage'); +exports.MeshServiceReplica = require('./meshServiceReplica'); +exports.MeshGateway = require('./meshGateway'); diff --git a/lib/services/serviceFabric/lib/operations/meshApplication.js b/lib/services/serviceFabric/lib/operations/meshApplication.js new file mode 100644 index 0000000000..e43372e531 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshApplication.js @@ -0,0 +1,1001 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Creates or updates a Application resource. + * + * Creates a Application resource with the specified name, description and + * properties. If Application resource with the same name exists, then it is + * updated with the specified description and properties. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} applicationResourceDescription Description for creating a + * Application resource. + * + * @param {string} applicationResourceDescription.name Name of the Application + * resource. + * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. + * + * @param {array} [applicationResourceDescription.services] Describes the + * services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is + * returned. The service description can be obtained by querying for the + * service resource. + * + * @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.debugParams] Internal - used + * by Visual Studio to setup the debugging session on the local development + * environment. + * + * @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 _createOrUpdate(applicationResourceName, applicationResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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 !== 200 && 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; + // 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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationResourceDescription']().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 the Application resource with the given name. + * + * Gets the information about the Application resource with the given name. The + * information include the description and other properties of the Application. + * + * @param {string} applicationResourceName The identity of the application. + * + * @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 _get(applicationResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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 Application resource. + * + * Deletes the Application resource identified by the name. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(applicationResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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 Lists all the application resources. + * + * Gets the information about all application resources in a given resource + * group. The information include the description and other properties of the + * Application. + * + * @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 PagedApplicationResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications'; + 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['PagedApplicationResourceDescriptionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MeshApplication. */ +class MeshApplication { + /** + * Create a MeshApplication. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._list = _list; + } + + /** + * @summary Creates or updates a Application resource. + * + * Creates a Application resource with the specified name, description and + * properties. If Application resource with the same name exists, then it is + * updated with the specified description and properties. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} applicationResourceDescription Description for creating a + * Application resource. + * + * @param {string} applicationResourceDescription.name Name of the Application + * resource. + * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. + * + * @param {array} [applicationResourceDescription.services] Describes the + * services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is + * returned. The service description can be obtained by querying for the + * service resource. + * + * @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.debugParams] Internal - used + * by Visual Studio to setup the debugging session on the local development + * environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(applicationResourceName, applicationResourceDescription, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(applicationResourceName, applicationResourceDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Application resource. + * + * Creates a Application resource with the specified name, description and + * properties. If Application resource with the same name exists, then it is + * updated with the specified description and properties. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} applicationResourceDescription Description for creating a + * Application resource. + * + * @param {string} applicationResourceDescription.name Name of the Application + * resource. + * + * @param {string} [applicationResourceDescription.description] User readable + * description of the application. + * + * @param {array} [applicationResourceDescription.services] Describes the + * services in the application. This property is used to create or modify + * services of the application. On get only the name of the service is + * returned. The service description can be obtained by querying for the + * service resource. + * + * @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.debugParams] Internal - used + * by Visual Studio to setup the debugging session on the local development + * environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationResourceDescription} - 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 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. + */ + createOrUpdate(applicationResourceName, applicationResourceDescription, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(applicationResourceName, applicationResourceDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(applicationResourceName, applicationResourceDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the Application resource with the given name. + * + * Gets the information about the Application resource with the given name. The + * information include the description and other properties of the Application. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(applicationResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(applicationResourceName, 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 Application resource with the given name. + * + * Gets the information about the Application resource with the given name. The + * information include the description and other properties of the Application. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationResourceDescription} - 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 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. + */ + get(applicationResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(applicationResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(applicationResourceName, options, optionalCallback); + } + } + + /** + * @summary Deletes the Application resource. + * + * Deletes the Application resource identified by the name. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(applicationResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(applicationResourceName, 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 the Application resource. + * + * Deletes the Application resource identified by the name. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(applicationResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(applicationResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(applicationResourceName, options, optionalCallback); + } + } + + /** + * @summary Lists all the application resources. + * + * Gets the information about all application resources in a given resource + * group. The information include the description and other properties of the + * Application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists all the application resources. + * + * Gets the information about all application resources in a given resource + * group. The information include the description and other properties of the + * Application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedApplicationResourceDescriptionList} - 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 PagedApplicationResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = MeshApplication; diff --git a/lib/services/serviceFabric/lib/operations/meshCodePackage.js b/lib/services/serviceFabric/lib/operations/meshCodePackage.js new file mode 100644 index 0000000000..9e6fa7a6c5 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshCodePackage.js @@ -0,0 +1,291 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets the logs from the container. + * + * Gets the logs for the container of the specified code package of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {string} codePackageName The name of code package of the service. + * + * @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 {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 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 _getContainerLogs(applicationResourceName, serviceResourceName, replicaName, codePackageName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let tail = (options && options.tail !== undefined) ? options.tail : undefined; + let apiVersion = '6.4-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.'); + } + 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.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas/{replicaName}/CodePackages/{codePackageName}/Logs'; + requestUrl = requestUrl.replace('{applicationResourceName}', applicationResourceName); + requestUrl = requestUrl.replace('{serviceResourceName}', serviceResourceName); + requestUrl = requestUrl.replace('{replicaName}', replicaName); + requestUrl = requestUrl.replace('{codePackageName}', encodeURIComponent(codePackageName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (tail !== null && tail !== undefined) { + queryParameters.push('Tail=' + encodeURIComponent(tail)); + } + 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['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); + }); +} + +/** Class representing a MeshCodePackage. */ +class MeshCodePackage { + /** + * Create a MeshCodePackage. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getContainerLogs = _getContainerLogs; + } + + /** + * @summary Gets the logs from the container. + * + * Gets the logs for the container of the specified code package of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {string} codePackageName The name of code package of the service. + * + * @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 {object} [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. + */ + getContainerLogsWithHttpOperationResponse(applicationResourceName, serviceResourceName, replicaName, codePackageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getContainerLogs(applicationResourceName, serviceResourceName, replicaName, 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 logs from the container. + * + * Gets the logs for the container of the specified code package of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {string} codePackageName The name of code package of the service. + * + * @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 {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 {ContainerLogs} - 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 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. + */ + getContainerLogs(applicationResourceName, serviceResourceName, replicaName, codePackageName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getContainerLogs(applicationResourceName, serviceResourceName, replicaName, codePackageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContainerLogs(applicationResourceName, serviceResourceName, replicaName, codePackageName, options, optionalCallback); + } + } + +} + +module.exports = MeshCodePackage; diff --git a/lib/services/serviceFabric/lib/operations/meshGateway.js b/lib/services/serviceFabric/lib/operations/meshGateway.js new file mode 100644 index 0000000000..25d7979e32 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshGateway.js @@ -0,0 +1,986 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Creates or updates a Gateway resource. + * + * Creates a Gateway resource with the specified name, description and + * properties. If Gateway resource with the same name exists, then it is + * updated with the specified description and properties. Use Gateway resource + * to provide public connectivity to application services. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} gatewayResourceDescription Description for creating a + * Gateway resource. + * + * @param {string} gatewayResourceDescription.name Name of the Gateway + * resource. + * + * @param {string} [gatewayResourceDescription.description] User readable + * description of the gateway. + * + * @param {object} gatewayResourceDescription.sourceNetwork Network the gateway + * should listen on for requests. + * + * @param {object} gatewayResourceDescription.destinationNetwork Network that + * the Application is using. + * + * @param {string} [gatewayResourceDescription.destinationNetwork.name] Name of + * the network + * + * @param {array} [gatewayResourceDescription.destinationNetwork.endpointRefs] + * A list of endpoints that are exposed on this network. + * + * @param {array} [gatewayResourceDescription.tcp] Configuration for tcp + * connectivity for this gateway. + * + * @param {array} [gatewayResourceDescription.http] Configuration for http + * connectivity for this gateway. + * + * @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 GatewayResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(gatewayResourceName, gatewayResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (gatewayResourceName === null || gatewayResourceName === undefined || typeof gatewayResourceName.valueOf() !== 'string') { + throw new Error('gatewayResourceName cannot be null or undefined and it must be of type string.'); + } + if (gatewayResourceDescription === null || gatewayResourceDescription === undefined) { + throw new Error('gatewayResourceDescription cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Gateways/{gatewayResourceName}'; + requestUrl = requestUrl.replace('{gatewayResourceName}', gatewayResourceName); + 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 (gatewayResourceDescription !== null && gatewayResourceDescription !== undefined) { + let requestModelMapper = new client.models['GatewayResourceDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, gatewayResourceDescription, 'gatewayResourceDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(gatewayResourceDescription, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && 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; + // 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['GatewayResourceDescription']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['GatewayResourceDescription']().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 the Gateway resource with the given name. + * + * Gets the information about the Gateway resource with the given name. The + * information include the description and other properties of the Gateway. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @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 GatewayResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(gatewayResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (gatewayResourceName === null || gatewayResourceName === undefined || typeof gatewayResourceName.valueOf() !== 'string') { + throw new Error('gatewayResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Gateways/{gatewayResourceName}'; + requestUrl = requestUrl.replace('{gatewayResourceName}', gatewayResourceName); + 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['GatewayResourceDescription']().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 Gateway resource. + * + * Deletes the Gateway resource identified by the name. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(gatewayResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (gatewayResourceName === null || gatewayResourceName === undefined || typeof gatewayResourceName.valueOf() !== 'string') { + throw new Error('gatewayResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Gateways/{gatewayResourceName}'; + requestUrl = requestUrl.replace('{gatewayResourceName}', gatewayResourceName); + 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 Lists all the gateway resources. + * + * Gets the information about all gateway resources in a given resource group. + * The information include the description and other properties of the Gateway. + * + * @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 PagedGatewayResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Gateways'; + 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['PagedGatewayResourceDescriptionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MeshGateway. */ +class MeshGateway { + /** + * Create a MeshGateway. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._list = _list; + } + + /** + * @summary Creates or updates a Gateway resource. + * + * Creates a Gateway resource with the specified name, description and + * properties. If Gateway resource with the same name exists, then it is + * updated with the specified description and properties. Use Gateway resource + * to provide public connectivity to application services. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} gatewayResourceDescription Description for creating a + * Gateway resource. + * + * @param {string} gatewayResourceDescription.name Name of the Gateway + * resource. + * + * @param {string} [gatewayResourceDescription.description] User readable + * description of the gateway. + * + * @param {object} gatewayResourceDescription.sourceNetwork Network the gateway + * should listen on for requests. + * + * @param {object} gatewayResourceDescription.destinationNetwork Network that + * the Application is using. + * + * @param {string} [gatewayResourceDescription.destinationNetwork.name] Name of + * the network + * + * @param {array} [gatewayResourceDescription.destinationNetwork.endpointRefs] + * A list of endpoints that are exposed on this network. + * + * @param {array} [gatewayResourceDescription.tcp] Configuration for tcp + * connectivity for this gateway. + * + * @param {array} [gatewayResourceDescription.http] Configuration for http + * connectivity for this gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(gatewayResourceName, gatewayResourceDescription, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(gatewayResourceName, gatewayResourceDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Gateway resource. + * + * Creates a Gateway resource with the specified name, description and + * properties. If Gateway resource with the same name exists, then it is + * updated with the specified description and properties. Use Gateway resource + * to provide public connectivity to application services. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} gatewayResourceDescription Description for creating a + * Gateway resource. + * + * @param {string} gatewayResourceDescription.name Name of the Gateway + * resource. + * + * @param {string} [gatewayResourceDescription.description] User readable + * description of the gateway. + * + * @param {object} gatewayResourceDescription.sourceNetwork Network the gateway + * should listen on for requests. + * + * @param {object} gatewayResourceDescription.destinationNetwork Network that + * the Application is using. + * + * @param {string} [gatewayResourceDescription.destinationNetwork.name] Name of + * the network + * + * @param {array} [gatewayResourceDescription.destinationNetwork.endpointRefs] + * A list of endpoints that are exposed on this network. + * + * @param {array} [gatewayResourceDescription.tcp] Configuration for tcp + * connectivity for this gateway. + * + * @param {array} [gatewayResourceDescription.http] Configuration for http + * connectivity for this gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {GatewayResourceDescription} - 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 GatewayResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(gatewayResourceName, gatewayResourceDescription, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(gatewayResourceName, gatewayResourceDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(gatewayResourceName, gatewayResourceDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the Gateway resource with the given name. + * + * Gets the information about the Gateway resource with the given name. The + * information include the description and other properties of the Gateway. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(gatewayResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(gatewayResourceName, 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 Gateway resource with the given name. + * + * Gets the information about the Gateway resource with the given name. The + * information include the description and other properties of the Gateway. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {GatewayResourceDescription} - 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 GatewayResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(gatewayResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(gatewayResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(gatewayResourceName, options, optionalCallback); + } + } + + /** + * @summary Deletes the Gateway resource. + * + * Deletes the Gateway resource identified by the name. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(gatewayResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(gatewayResourceName, 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 the Gateway resource. + * + * Deletes the Gateway resource identified by the name. + * + * @param {string} gatewayResourceName The identity of the gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(gatewayResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(gatewayResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(gatewayResourceName, options, optionalCallback); + } + } + + /** + * @summary Lists all the gateway resources. + * + * Gets the information about all gateway resources in a given resource group. + * The information include the description and other properties of the Gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists all the gateway resources. + * + * Gets the information about all gateway resources in a given resource group. + * The information include the description and other properties of the Gateway. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedGatewayResourceDescriptionList} - 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 PagedGatewayResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = MeshGateway; diff --git a/lib/services/serviceFabric/lib/operations/meshNetwork.js b/lib/services/serviceFabric/lib/operations/meshNetwork.js new file mode 100644 index 0000000000..ec0e366bf3 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshNetwork.js @@ -0,0 +1,950 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Creates or updates a Network resource. + * + * Creates a Network resource with the specified name, description and + * properties. If Network resource with the same name exists, then it is + * updated with the specified description and properties. Network resource + * provides connectivity between application services. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} networkResourceDescription Description for creating a + * Network resource. + * + * @param {string} networkResourceDescription.name Name of the Network + * resource. + * + * @param {object} networkResourceDescription.properties Describes properties + * of a network resource. + * + * @param {string} [networkResourceDescription.properties.description] User + * readable description of the network. + * + * @param {string} networkResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @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 NetworkResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(networkResourceName, networkResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (networkResourceName === null || networkResourceName === undefined || typeof networkResourceName.valueOf() !== 'string') { + throw new Error('networkResourceName cannot be null or undefined and it must be of type string.'); + } + if (networkResourceDescription === null || networkResourceDescription === undefined) { + throw new Error('networkResourceDescription cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Networks/{networkResourceName}'; + requestUrl = requestUrl.replace('{networkResourceName}', networkResourceName); + 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 (networkResourceDescription !== null && networkResourceDescription !== undefined) { + let requestModelMapper = new client.models['NetworkResourceDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, networkResourceDescription, 'networkResourceDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(networkResourceDescription, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && 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; + // 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['NetworkResourceDescription']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkResourceDescription']().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 the Network resource with the given name. + * + * Gets the information about the Network resource with the given name. The + * information include the description and other properties of the Network. + * + * @param {string} networkResourceName The identity of the network. + * + * @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 NetworkResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(networkResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (networkResourceName === null || networkResourceName === undefined || typeof networkResourceName.valueOf() !== 'string') { + throw new Error('networkResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Networks/{networkResourceName}'; + requestUrl = requestUrl.replace('{networkResourceName}', networkResourceName); + 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['NetworkResourceDescription']().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 Network resource. + * + * Deletes the Network resource identified by the name. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(networkResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (networkResourceName === null || networkResourceName === undefined || typeof networkResourceName.valueOf() !== 'string') { + throw new Error('networkResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Networks/{networkResourceName}'; + requestUrl = requestUrl.replace('{networkResourceName}', networkResourceName); + 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 Lists all the network resources. + * + * Gets the information about all network resources in a given resource group. + * The information include the description and other properties of the Network. + * + * @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 PagedNetworkResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Networks'; + 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['PagedNetworkResourceDescriptionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MeshNetwork. */ +class MeshNetwork { + /** + * Create a MeshNetwork. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._list = _list; + } + + /** + * @summary Creates or updates a Network resource. + * + * Creates a Network resource with the specified name, description and + * properties. If Network resource with the same name exists, then it is + * updated with the specified description and properties. Network resource + * provides connectivity between application services. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} networkResourceDescription Description for creating a + * Network resource. + * + * @param {string} networkResourceDescription.name Name of the Network + * resource. + * + * @param {object} networkResourceDescription.properties Describes properties + * of a network resource. + * + * @param {string} [networkResourceDescription.properties.description] User + * readable description of the network. + * + * @param {string} networkResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(networkResourceName, networkResourceDescription, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(networkResourceName, networkResourceDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Network resource. + * + * Creates a Network resource with the specified name, description and + * properties. If Network resource with the same name exists, then it is + * updated with the specified description and properties. Network resource + * provides connectivity between application services. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} networkResourceDescription Description for creating a + * Network resource. + * + * @param {string} networkResourceDescription.name Name of the Network + * resource. + * + * @param {object} networkResourceDescription.properties Describes properties + * of a network resource. + * + * @param {string} [networkResourceDescription.properties.description] User + * readable description of the network. + * + * @param {string} networkResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkResourceDescription} - 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 NetworkResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(networkResourceName, networkResourceDescription, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(networkResourceName, networkResourceDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(networkResourceName, networkResourceDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the Network resource with the given name. + * + * Gets the information about the Network resource with the given name. The + * information include the description and other properties of the Network. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(networkResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(networkResourceName, 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 Network resource with the given name. + * + * Gets the information about the Network resource with the given name. The + * information include the description and other properties of the Network. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkResourceDescription} - 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 NetworkResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(networkResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(networkResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(networkResourceName, options, optionalCallback); + } + } + + /** + * @summary Deletes the Network resource. + * + * Deletes the Network resource identified by the name. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(networkResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(networkResourceName, 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 the Network resource. + * + * Deletes the Network resource identified by the name. + * + * @param {string} networkResourceName The identity of the network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(networkResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(networkResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(networkResourceName, options, optionalCallback); + } + } + + /** + * @summary Lists all the network resources. + * + * Gets the information about all network resources in a given resource group. + * The information include the description and other properties of the Network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists all the network resources. + * + * Gets the information about all network resources in a given resource group. + * The information include the description and other properties of the Network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedNetworkResourceDescriptionList} - 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 PagedNetworkResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = MeshNetwork; diff --git a/lib/services/serviceFabric/lib/operations/meshSecret.js b/lib/services/serviceFabric/lib/operations/meshSecret.js new file mode 100644 index 0000000000..454df57215 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshSecret.js @@ -0,0 +1,962 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Creates or updates a Secret resource. + * + * Creates a Secret resource with the specified name, description and + * properties. If Secret resource with the same name exists, then it is updated + * with the specified description and properties. Once created, the kind and + * contentType of a secret resource cannot be updated. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} secretResourceDescription Description for creating a secret + * resource. + * + * @param {object} secretResourceDescription.properties Describes the + * properties of a secret resource. + * + * @param {string} [secretResourceDescription.properties.description] User + * readable description of the secret. + * + * @param {string} [secretResourceDescription.properties.contentType] The type + * of the content stored in the secret value. The value of this property is + * opaque to Service Fabric. Once set, the value of this property cannot be + * changed. + * + * @param {string} secretResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {string} secretResourceDescription.name Name of the Secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(secretResourceName, secretResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + if (secretResourceDescription === null || secretResourceDescription === undefined) { + throw new Error('secretResourceDescription cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + 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 (secretResourceDescription !== null && secretResourceDescription !== undefined) { + let requestModelMapper = new client.models['SecretResourceDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, secretResourceDescription, 'secretResourceDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(secretResourceDescription, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && 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; + // 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['SecretResourceDescription']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretResourceDescription']().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 the Secret resource with the given name. + * + * Gets the information about the Secret resource with the given name. The + * information include the description and other properties of the Secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(secretResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + 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['SecretResourceDescription']().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 Secret resource. + * + * Deletes the specified Secret resource and all of its named values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(secretResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + 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 Lists all the secret resources. + * + * Gets the information about all secret resources in a given resource group. + * The information include the description and other properties of the Secret. + * + * @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 PagedSecretResourceDescriptionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets'; + 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['PagedSecretResourceDescriptionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MeshSecret. */ +class MeshSecret { + /** + * Create a MeshSecret. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._list = _list; + } + + /** + * @summary Creates or updates a Secret resource. + * + * Creates a Secret resource with the specified name, description and + * properties. If Secret resource with the same name exists, then it is updated + * with the specified description and properties. Once created, the kind and + * contentType of a secret resource cannot be updated. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} secretResourceDescription Description for creating a secret + * resource. + * + * @param {object} secretResourceDescription.properties Describes the + * properties of a secret resource. + * + * @param {string} [secretResourceDescription.properties.description] User + * readable description of the secret. + * + * @param {string} [secretResourceDescription.properties.contentType] The type + * of the content stored in the secret value. The value of this property is + * opaque to Service Fabric. Once set, the value of this property cannot be + * changed. + * + * @param {string} secretResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {string} secretResourceDescription.name Name of the Secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(secretResourceName, secretResourceDescription, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(secretResourceName, secretResourceDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Secret resource. + * + * Creates a Secret resource with the specified name, description and + * properties. If Secret resource with the same name exists, then it is updated + * with the specified description and properties. Once created, the kind and + * contentType of a secret resource cannot be updated. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} secretResourceDescription Description for creating a secret + * resource. + * + * @param {object} secretResourceDescription.properties Describes the + * properties of a secret resource. + * + * @param {string} [secretResourceDescription.properties.description] User + * readable description of the secret. + * + * @param {string} [secretResourceDescription.properties.contentType] The type + * of the content stored in the secret value. The value of this property is + * opaque to Service Fabric. Once set, the value of this property cannot be + * changed. + * + * @param {string} secretResourceDescription.properties.kind Polymorphic + * Discriminator + * + * @param {string} secretResourceDescription.name Name of the Secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretResourceDescription} - 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 SecretResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(secretResourceName, secretResourceDescription, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(secretResourceName, secretResourceDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(secretResourceName, secretResourceDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the Secret resource with the given name. + * + * Gets the information about the Secret resource with the given name. The + * information include the description and other properties of the Secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(secretResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(secretResourceName, 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 Secret resource with the given name. + * + * Gets the information about the Secret resource with the given name. The + * information include the description and other properties of the Secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretResourceDescription} - 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 SecretResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(secretResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(secretResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(secretResourceName, options, optionalCallback); + } + } + + /** + * @summary Deletes the Secret resource. + * + * Deletes the specified Secret resource and all of its named values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(secretResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(secretResourceName, 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 the Secret resource. + * + * Deletes the specified Secret resource and all of its named values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(secretResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(secretResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(secretResourceName, options, optionalCallback); + } + } + + /** + * @summary Lists all the secret resources. + * + * Gets the information about all secret resources in a given resource group. + * The information include the description and other properties of the Secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists all the secret resources. + * + * Gets the information about all secret resources in a given resource group. + * The information include the description and other properties of the Secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedSecretResourceDescriptionList} - 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 PagedSecretResourceDescriptionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = MeshSecret; diff --git a/lib/services/serviceFabric/lib/operations/meshSecretValue.js b/lib/services/serviceFabric/lib/operations/meshSecretValue.js new file mode 100644 index 0000000000..6ed54cd8e6 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshSecretValue.js @@ -0,0 +1,1225 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Adds the specified value as a new version of the specified secret + * resource. + * + * Creates a new value of the specified secret resource. The name of the value + * is typically the version identifier. Once created the value cannot be + * changed. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} secretValueResourceDescription Description for creating a + * value of a secret resource. + * + * @param {string} secretValueResourceDescription.name Version identifier of + * the secret value. + * + * @param {string} [secretValueResourceDescription.value] The actual value of + * the secret. + * + * @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 SecretValueResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _addValue(secretResourceName, secretValueResourceName, secretValueResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + if (secretValueResourceName === null || secretValueResourceName === undefined || typeof secretValueResourceName.valueOf() !== 'string') { + throw new Error('secretValueResourceName cannot be null or undefined and it must be of type string.'); + } + if (secretValueResourceDescription === null || secretValueResourceDescription === undefined) { + throw new Error('secretValueResourceDescription cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + requestUrl = requestUrl.replace('{secretValueResourceName}', secretValueResourceName); + 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 (secretValueResourceDescription !== null && secretValueResourceDescription !== undefined) { + let requestModelMapper = new client.models['SecretValueResourceDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, secretValueResourceDescription, 'secretValueResourceDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(secretValueResourceDescription, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && 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; + // 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['SecretValueResourceDescription']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretValueResourceDescription']().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 the specified secret value resource. + * + * Get the information about the specified named secret value resources. The + * information does not include the actual value of the secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @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 SecretValueResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(secretResourceName, secretValueResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + if (secretValueResourceName === null || secretValueResourceName === undefined || typeof secretValueResourceName.valueOf() !== 'string') { + throw new Error('secretValueResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + requestUrl = requestUrl.replace('{secretValueResourceName}', secretValueResourceName); + 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['SecretValueResourceDescription']().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 value of the named secret resource. + * + * Deletes the secret value resource identified by the name. The name of the + * resource is typically the version associated with that value. Deletion will + * fail if the specified value is in use. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(secretResourceName, secretValueResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + if (secretValueResourceName === null || secretValueResourceName === undefined || typeof secretValueResourceName.valueOf() !== 'string') { + throw new Error('secretValueResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + requestUrl = requestUrl.replace('{secretValueResourceName}', secretValueResourceName); + 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 List names of all values of the the specified secret resource. + * + * Gets information about all secret value resources of the specified secret + * resource. The information includes the names of the secret value resources, + * but not the actual values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PagedSecretValueResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(secretResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}/values'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + 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['PagedSecretValueResourceDescriptionList']().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 Lists the specified value of the secret resource. + * + * Lists the decrypted value of the specified named value of the secret + * resource. This is a privileged operation. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @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 SecretValue} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _show(secretResourceName, secretValueResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + // Validate + try { + if (secretResourceName === null || secretResourceName === undefined || typeof secretResourceName.valueOf() !== 'string') { + throw new Error('secretResourceName cannot be null or undefined and it must be of type string.'); + } + if (secretValueResourceName === null || secretValueResourceName === undefined || typeof secretValueResourceName.valueOf() !== 'string') { + throw new Error('secretValueResourceName cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}/list_value'; + requestUrl = requestUrl.replace('{secretResourceName}', secretResourceName); + requestUrl = requestUrl.replace('{secretValueResourceName}', secretValueResourceName); + 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 = '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; + // 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['SecretValue']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MeshSecretValue. */ +class MeshSecretValue { + /** + * Create a MeshSecretValue. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._addValue = _addValue; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._list = _list; + this._show = _show; + } + + /** + * @summary Adds the specified value as a new version of the specified secret + * resource. + * + * Creates a new value of the specified secret resource. The name of the value + * is typically the version identifier. Once created the value cannot be + * changed. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} secretValueResourceDescription Description for creating a + * value of a secret resource. + * + * @param {string} secretValueResourceDescription.name Version identifier of + * the secret value. + * + * @param {string} [secretValueResourceDescription.value] The actual value of + * the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + addValueWithHttpOperationResponse(secretResourceName, secretValueResourceName, secretValueResourceDescription, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._addValue(secretResourceName, secretValueResourceName, secretValueResourceDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds the specified value as a new version of the specified secret + * resource. + * + * Creates a new value of the specified secret resource. The name of the value + * is typically the version identifier. Once created the value cannot be + * changed. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} secretValueResourceDescription Description for creating a + * value of a secret resource. + * + * @param {string} secretValueResourceDescription.name Version identifier of + * the secret value. + * + * @param {string} [secretValueResourceDescription.value] The actual value of + * the secret. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretValueResourceDescription} - 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 SecretValueResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + addValue(secretResourceName, secretValueResourceName, secretValueResourceDescription, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._addValue(secretResourceName, secretValueResourceName, secretValueResourceDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._addValue(secretResourceName, secretValueResourceName, secretValueResourceDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the specified secret value resource. + * + * Get the information about the specified named secret value resources. The + * information does not include the actual value of the secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the 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. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(secretResourceName, secretValueResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(secretResourceName, secretValueResourceName, 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 specified secret value resource. + * + * Get the information about the specified named secret value resources. The + * information does not include the actual value of the secret. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretValueResourceDescription} - 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 SecretValueResourceDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(secretResourceName, secretValueResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(secretResourceName, secretValueResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(secretResourceName, secretValueResourceName, options, optionalCallback); + } + } + + /** + * @summary Deletes the specified value of the named secret resource. + * + * Deletes the secret value resource identified by the name. The name of the + * resource is typically the version associated with that value. Deletion will + * fail if the specified value is in use. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the 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. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(secretResourceName, secretValueResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(secretResourceName, secretValueResourceName, 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 the specified value of the named secret resource. + * + * Deletes the secret value resource identified by the name. The name of the + * resource is typically the version associated with that value. Deletion will + * fail if the specified value is in use. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(secretResourceName, secretValueResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(secretResourceName, secretValueResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(secretResourceName, secretValueResourceName, options, optionalCallback); + } + } + + /** + * @summary List names of all values of the the specified secret resource. + * + * Gets information about all secret value resources of the specified secret + * resource. The information includes the names of the secret value resources, + * but not the actual values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(secretResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(secretResourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List names of all values of the the specified secret resource. + * + * Gets information about all secret value resources of the specified secret + * resource. The information includes the names of the secret value resources, + * but not the actual values. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedSecretValueResourceDescriptionList} - 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 PagedSecretValueResourceDescriptionList} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(secretResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(secretResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(secretResourceName, options, optionalCallback); + } + } + + /** + * @summary Lists the specified value of the secret resource. + * + * Lists the decrypted value of the specified named value of the secret + * resource. This is a privileged operation. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the 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. + * + * @reject {Error} - The error object. + */ + showWithHttpOperationResponse(secretResourceName, secretValueResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._show(secretResourceName, secretValueResourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists the specified value of the secret resource. + * + * Lists the decrypted value of the specified named value of the secret + * resource. This is a privileged operation. + * + * @param {string} secretResourceName The name of the secret resource. + * + * @param {string} secretValueResourceName The name of the secret resource + * value which is typically the version identifier for the value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SecretValue} - 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 SecretValue} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + show(secretResourceName, secretValueResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._show(secretResourceName, secretValueResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._show(secretResourceName, secretValueResourceName, options, optionalCallback); + } + } + +} + +module.exports = MeshSecretValue; diff --git a/lib/services/serviceFabric/lib/operations/meshService.js b/lib/services/serviceFabric/lib/operations/meshService.js new file mode 100644 index 0000000000..53e26058b7 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshService.js @@ -0,0 +1,476 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets the Service resource with the given name. + * + * Gets the information about the Service resource with the given name. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @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 _get(applicationResourceName, serviceResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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; + } + 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['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 Lists all the service resources. + * + * Gets the information about all services of an application resource. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @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 _list(applicationResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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; + } + 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['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); + }); +} + +/** Class representing a MeshService. */ +class MeshService { + /** + * Create a MeshService. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._list = _list; + } + + /** + * @summary Gets the Service resource with the given name. + * + * Gets the information about the Service resource with the given name. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(applicationResourceName, serviceResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(applicationResourceName, serviceResourceName, 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 Service resource with the given name. + * + * Gets the information about the Service resource with the given name. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceResourceDescription} - 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 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. + */ + get(applicationResourceName, serviceResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(applicationResourceName, serviceResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(applicationResourceName, serviceResourceName, options, optionalCallback); + } + } + + /** + * @summary Lists all the service resources. + * + * Gets the information about all services of an application resource. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(applicationResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(applicationResourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists all the service resources. + * + * Gets the information about all services of an application resource. The + * information include the description and other properties of the Service. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedServiceResourceDescriptionList} - 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 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. + */ + list(applicationResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(applicationResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(applicationResourceName, options, optionalCallback); + } + } + +} + +module.exports = MeshService; diff --git a/lib/services/serviceFabric/lib/operations/meshServiceReplica.js b/lib/services/serviceFabric/lib/operations/meshServiceReplica.js new file mode 100644 index 0000000000..b0b646efc8 --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshServiceReplica.js @@ -0,0 +1,499 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets the given replica of the service of an application. + * + * Gets the information about the service replica with the given name. The + * information include the description and other properties of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @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 ServiceReplicaDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(applicationResourceName, serviceResourceName, replicaName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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; + } + 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['ServiceReplicaDescription']().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 Lists all the replicas of a service. + * + * Gets the information about all replicas of a service. The information + * include the description and other properties of the service replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @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 PagedServiceReplicaDescriptionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(applicationResourceName, serviceResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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; + } + 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['PagedServiceReplicaDescriptionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MeshServiceReplica. */ +class MeshServiceReplica { + /** + * Create a MeshServiceReplica. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._list = _list; + } + + /** + * @summary Gets the given replica of the service of an application. + * + * Gets the information about the service replica with the given name. The + * information include the description and other properties of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {string} replicaName Service Fabric replica name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(applicationResourceName, serviceResourceName, replicaName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(applicationResourceName, serviceResourceName, replicaName, 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 given replica of the service of an application. + * + * Gets the information about the service replica with the given name. The + * information include the description and other properties of the service + * replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @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} [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 {ServiceReplicaDescription} - 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 ServiceReplicaDescription} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(applicationResourceName, serviceResourceName, replicaName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(applicationResourceName, serviceResourceName, replicaName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(applicationResourceName, serviceResourceName, replicaName, options, optionalCallback); + } + } + + /** + * @summary Lists all the replicas of a service. + * + * Gets the information about all replicas of a service. The information + * include the description and other properties of the service replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(applicationResourceName, serviceResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(applicationResourceName, serviceResourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists all the replicas of a service. + * + * Gets the information about all replicas of a service. The information + * include the description and other properties of the service replica. + * + * @param {string} applicationResourceName The identity of the application. + * + * @param {string} serviceResourceName The identity of the service. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedServiceReplicaDescriptionList} - 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 PagedServiceReplicaDescriptionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(applicationResourceName, serviceResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(applicationResourceName, serviceResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(applicationResourceName, serviceResourceName, options, optionalCallback); + } + } + +} + +module.exports = MeshServiceReplica; diff --git a/lib/services/serviceFabric/lib/operations/meshVolume.js b/lib/services/serviceFabric/lib/operations/meshVolume.js new file mode 100644 index 0000000000..f3b544bc9c --- /dev/null +++ b/lib/services/serviceFabric/lib/operations/meshVolume.js @@ -0,0 +1,966 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Creates or updates a Volume resource. + * + * Creates a Volume resource with the specified name, description and + * properties. If Volume resource with the same name exists, then it is updated + * with the specified description and properties. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} volumeResourceDescription Description for creating a Volume + * resource. + * + * @param {string} volumeResourceDescription.name Name of the 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 {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 _createOrUpdate(volumeResourceName, volumeResourceDescription, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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 !== 200 && 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; + // 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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VolumeResourceDescription']().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 the Volume resource with the given name. + * + * Gets the information about the Volume resource with the given name. The + * information include the description and other properties of the Volume. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @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 _get(volumeResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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 resource identified by the name. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(volumeResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-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.client.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); + }); +} + +/** + * @summary Lists all the volume resources. + * + * Gets the information about all volume resources in a given resource group. + * The information include the description and other properties of the Volume. + * + * @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 PagedVolumeResourceDescriptionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '6.4-preview'; + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'Resources/Volumes'; + 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['PagedVolumeResourceDescriptionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a MeshVolume. */ +class MeshVolume { + /** + * Create a MeshVolume. + * @param {ServiceFabricClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._list = _list; + } + + /** + * @summary Creates or updates a Volume resource. + * + * Creates a Volume resource with the specified name, description and + * properties. If Volume resource with the same name exists, then it is updated + * with the specified description and properties. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} volumeResourceDescription Description for creating a Volume + * resource. + * + * @param {string} volumeResourceDescription.name Name of the 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(volumeResourceName, volumeResourceDescription, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(volumeResourceName, volumeResourceDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Volume resource. + * + * Creates a Volume resource with the specified name, description and + * properties. If Volume resource with the same name exists, then it is updated + * with the specified description and properties. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} volumeResourceDescription Description for creating a Volume + * resource. + * + * @param {string} volumeResourceDescription.name Name of the 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VolumeResourceDescription} - 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 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. + */ + createOrUpdate(volumeResourceName, volumeResourceDescription, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(volumeResourceName, volumeResourceDescription, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(volumeResourceName, volumeResourceDescription, options, optionalCallback); + } + } + + /** + * @summary Gets the Volume resource with the given name. + * + * Gets the information about the Volume resource with the given name. The + * information include the description and other properties of the Volume. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(volumeResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(volumeResourceName, 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 Volume resource with the given name. + * + * Gets the information about the Volume resource with the given name. The + * information include the description and other properties of the Volume. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VolumeResourceDescription} - 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 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. + */ + get(volumeResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(volumeResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(volumeResourceName, options, optionalCallback); + } + } + + /** + * @summary Deletes the Volume resource. + * + * Deletes the Volume resource identified by the name. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(volumeResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(volumeResourceName, 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 the Volume resource. + * + * Deletes the Volume resource identified by the name. + * + * @param {string} volumeResourceName The identity of the volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(volumeResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(volumeResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(volumeResourceName, options, optionalCallback); + } + } + + /** + * @summary Lists all the volume resources. + * + * Gets the information about all volume resources in a given resource group. + * The information include the description and other properties of the Volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists all the volume resources. + * + * Gets the information about all volume resources in a given resource group. + * The information include the description and other properties of the Volume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PagedVolumeResourceDescriptionList} - 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 PagedVolumeResourceDescriptionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = MeshVolume; diff --git a/lib/services/serviceFabric/lib/serviceFabricClient.d.ts b/lib/services/serviceFabric/lib/serviceFabricClient.d.ts index e5c26523b6..e8cab3c2f3 100644 --- a/lib/services/serviceFabric/lib/serviceFabricClient.d.ts +++ b/lib/services/serviceFabric/lib/serviceFabricClient.d.ts @@ -10,6 +10,7 @@ import { ServiceClient, ServiceClientOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; import * as models from "./models"; +import * as operations from "./operations"; export default class ServiceFabricClient extends ServiceClient { /** @@ -31,6 +32,17 @@ export default class ServiceFabricClient extends ServiceClient { */ constructor(baseUri?: string, options?: ServiceClientOptions); + // Operation groups + meshSecret: operations.MeshSecret; + meshSecretValue: operations.MeshSecretValue; + meshVolume: operations.MeshVolume; + meshNetwork: operations.MeshNetwork; + meshApplication: operations.MeshApplication; + meshService: operations.MeshService; + meshCodePackage: operations.MeshCodePackage; + meshServiceReplica: operations.MeshServiceReplica; + meshGateway: operations.MeshGateway; + /** * @summary Get the Service Fabric cluster manifest. @@ -1299,7 +1311,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -1422,7 +1434,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -2167,9 +2179,9 @@ export default class ServiceFabricClient extends ServiceClient { /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Roll back the upgrade of a Service Fabric cluster. * - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param {object} [options] Optional Parameters. * @@ -2190,9 +2202,9 @@ export default class ServiceFabricClient extends ServiceClient { rollbackClusterUpgradeWithHttpOperationResponse(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Roll back the upgrade of a Service Fabric cluster. * - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param {object} [options] Optional Parameters. * @@ -2757,11 +2769,14 @@ export default class ServiceFabricClient extends ServiceClient { * standalone cluster configuration upgrade. * * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The - * cluster configuration. + * cluster configuration as a JSON string. For example, [this + * file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) + * contains JSON describing the [nodes and other properties of the + * cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest). * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length - * of time between attempts to perform a health checks if the application or + * of time between attempts to perform health checks if the application or * cluster is not healthy. * * @param {moment.duration} @@ -2771,7 +2786,8 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] - * The length of time that the application or cluster must remain healthy. + * The length of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The @@ -2840,11 +2856,14 @@ export default class ServiceFabricClient extends ServiceClient { * standalone cluster configuration upgrade. * * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The - * cluster configuration. + * cluster configuration as a JSON string. For example, [this + * file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) + * contains JSON describing the [nodes and other properties of the + * cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest). * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length - * of time between attempts to perform a health checks if the application or + * of time between attempts to perform health checks if the application or * cluster is not healthy. * * @param {moment.duration} @@ -2854,7 +2873,8 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] - * The length of time that the application or cluster must remain healthy. + * The length of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The @@ -3431,6 +3451,73 @@ export default class ServiceFabricClient extends ServiceClient { getAadMetadata(options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Get the current Service Fabric cluster version. + * + * If a cluster upgrade is happening, then this API will return the lowest + * (older) version of the current and target cluster runtime 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. + */ + getClusterVersionWithHttpOperationResponse(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the current Service Fabric cluster version. + * + * If a cluster upgrade is happening, then this API will return the lowest + * (older) version of the current and target cluster runtime 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 {ClusterVersion} - 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. + * + * {ClusterVersion} [result] - The deserialized result object if an error did not occur. + * See {@link ClusterVersion} 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. + */ + getClusterVersion(options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getClusterVersion(callback: ServiceCallback): void; + getClusterVersion(options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets the list of nodes in the Service Fabric cluster. * @@ -4074,7 +4161,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -4198,7 +4285,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -6959,7 +7046,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -7089,7 +7176,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -9117,7 +9204,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -9251,7 +9338,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -11066,7 +11153,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -11197,7 +11284,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -11287,6 +11374,11 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {string} [options.partitionKeyValue] Partition key. This is required * if the partition scheme for the service is Int64Range or Named. + * This is not the partition ID, but rather, either the integer key value, or + * the name of the partition ID. + * For example, if your service is using ranged partitions from 0 to 10, then + * they PartitionKeyValue would be an + * integer in that range. Query service description to see the range or name. * * @param {string} [options.previousRspVersion] The value in the Version field * of the response that was received previously. This is required if the user @@ -11339,6 +11431,11 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {string} [options.partitionKeyValue] Partition key. This is required * if the partition scheme for the service is Int64Range or Named. + * This is not the partition ID, but rather, either the integer key value, or + * the name of the partition ID. + * For example, if your service is using ranged partitions from 0 to 10, then + * they PartitionKeyValue would be an + * integer in that range. Query service description to see the range or name. * * @param {string} [options.previousRspVersion] The value in the Version field * of the response that was received previously. This is required if the user @@ -12238,7 +12335,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -12363,7 +12460,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -14615,7 +14712,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -14746,7 +14843,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -15982,7 +16079,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -16118,7 +16215,7 @@ export default class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -17651,6 +17748,76 @@ export default class ServiceFabricClient extends ServiceClient { startComposeDeploymentUpgrade(deploymentName: string, composeDeploymentUpgradeDescription: models.ComposeDeploymentUpgradeDescription, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Starts rolling back a compose deployment upgrade in the Service + * Fabric cluster. + * + * Rollback a service fabric compose deployment 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 timeout specifies the time duration that the + * client is willing to wait for the requested 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. + */ + startRollbackComposeDeploymentUpgradeWithHttpOperationResponse(deploymentName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Starts rolling back a compose deployment upgrade in the Service + * Fabric cluster. + * + * Rollback a service fabric compose deployment 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 timeout specifies the time duration that the + * client is willing to wait for the requested 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. + */ + startRollbackComposeDeploymentUpgrade(deploymentName: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + startRollbackComposeDeploymentUpgrade(deploymentName: string, callback: ServiceCallback): void; + startRollbackComposeDeploymentUpgrade(deploymentName: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get the status of Chaos. * @@ -18674,7 +18841,7 @@ export default class ServiceFabricClient extends ServiceClient { * @summary Deletes existing image store content. * * Deletes existing image store content being found within the given image - * store relative path. This can be used to delete uploaded application + * store relative path. This command can be used to delete uploaded application * packages once they are provisioned. * * @param {string} contentPath Relative path to file or folder in the image @@ -18702,7 +18869,7 @@ export default class ServiceFabricClient extends ServiceClient { * @summary Deletes existing image store content. * * Deletes existing image store content being found within the given image - * store relative path. This can be used to delete uploaded application + * store relative path. This command can be used to delete uploaded application * packages once they are provisioned. * * @param {string} contentPath Relative path to file or folder in the image @@ -20389,7 +20556,7 @@ export default class ServiceFabricClient extends ServiceClient { * @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. + * Gets the list of user-induced fault operations filtered by provided input. * * @param {number} typeFilter Used to filter on OperationType for user-induced * operations. @@ -20433,7 +20600,7 @@ export default class ServiceFabricClient extends ServiceClient { * @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. + * Gets the list of user-induced fault operations filtered by provided input. * * @param {number} typeFilter Used to filter on OperationType for user-induced * operations. @@ -20522,8 +20689,8 @@ export default class ServiceFabricClient extends ServiceClient { * @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 {boolean} force Indicates whether to gracefully roll back and clean + * up internal system state modified by executing the user-induced operation. * * @param {object} [options] Optional Parameters. * @@ -20574,8 +20741,8 @@ export default class ServiceFabricClient extends ServiceClient { * @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 {boolean} force Indicates whether to gracefully roll back and clean + * up internal system state modified by executing the user-induced operation. * * @param {object} [options] Optional Parameters. * @@ -20652,6 +20819,12 @@ export default class ServiceFabricClient extends ServiceClient { * @param {string} backupPolicyDescription.storage.storageKind Polymorphic * Discriminator * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * Polymorphic Discriminator + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the @@ -20709,6 +20882,12 @@ export default class ServiceFabricClient extends ServiceClient { * @param {string} backupPolicyDescription.storage.storageKind Polymorphic * Discriminator * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * Polymorphic Discriminator + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the @@ -21130,6 +21309,12 @@ export default class ServiceFabricClient extends ServiceClient { * @param {string} backupPolicyDescription.storage.storageKind Polymorphic * Discriminator * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * Polymorphic Discriminator + * * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. @@ -21188,6 +21373,12 @@ export default class ServiceFabricClient extends ServiceClient { * @param {string} backupPolicyDescription.storage.storageKind Polymorphic * Discriminator * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * Polymorphic Discriminator + * * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. @@ -21349,6 +21540,13 @@ export default class ServiceFabricClient extends ServiceClient { * client is willing to wait for the requested operation to complete. The * default value for this parameter is 60 seconds. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21358,7 +21556,7 @@ export default class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - disableApplicationBackupWithHttpOperationResponse(applicationId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + disableApplicationBackupWithHttpOperationResponse(applicationId: string, options?: { timeout? : number, disableBackupDescription? : models.DisableBackupDescription, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Disables periodic backup of Service Fabric application. @@ -21381,6 +21579,13 @@ export default class ServiceFabricClient extends ServiceClient { * client is willing to wait for the requested operation to complete. The * default value for this parameter is 60 seconds. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21405,9 +21610,9 @@ export default class ServiceFabricClient extends ServiceClient { * * {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, options?: { timeout? : number, disableBackupDescription? : models.DisableBackupDescription, customHeaders? : { [headerName: string]: string; } }): Promise; disableApplicationBackup(applicationId: string, callback: ServiceCallback): void; - disableApplicationBackup(applicationId: string, options: { timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + disableApplicationBackup(applicationId: string, options: { timeout? : number, disableBackupDescription? : models.DisableBackupDescription, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -21977,6 +22182,13 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -21991,7 +22203,7 @@ export default class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - disableServiceBackupWithHttpOperationResponse(serviceId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + disableServiceBackupWithHttpOperationResponse(serviceId: string, options?: { disableBackupDescription? : models.DisableBackupDescription, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Disables periodic backup of Service Fabric service which was @@ -22013,6 +22225,13 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -22042,9 +22261,9 @@ export default class ServiceFabricClient extends ServiceClient { * * {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, options?: { disableBackupDescription? : models.DisableBackupDescription, 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; + disableServiceBackup(serviceId: string, options: { disableBackupDescription? : models.DisableBackupDescription, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -22588,6 +22807,13 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -22602,7 +22828,7 @@ export default class ServiceFabricClient extends ServiceClient { * * @reject {Error|ServiceError} - The error object. */ - disablePartitionBackupWithHttpOperationResponse(partitionId: string, options?: { timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + disablePartitionBackupWithHttpOperationResponse(partitionId: string, options?: { disableBackupDescription? : models.DisableBackupDescription, timeout? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Disables periodic backup of Service Fabric partition which was @@ -22618,6 +22844,13 @@ export default class ServiceFabricClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -22647,9 +22880,9 @@ export default class ServiceFabricClient extends ServiceClient { * * {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, options?: { disableBackupDescription? : models.DisableBackupDescription, 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; + disablePartitionBackup(partitionId: string, options: { disableBackupDescription? : models.DisableBackupDescription, timeout? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -25622,748 +25855,6 @@ export default class ServiceFabricClient extends ServiceClient { 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createApplicationResourceWithHttpOperationResponse(applicationResourceName: string, applicationResourceDescription: models.ApplicationResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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. - */ - 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getApplicationResourceWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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 {ApplicationResourceDescription} - 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. - * - * {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. - */ - 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteApplicationResourceWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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. - * - * @reject {Error|ServiceError} - The error object. - */ - getServicesWithHttpOperationResponse(applicationResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [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. - */ - getServiceWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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 {ServiceResourceDescription} - 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. - * - * {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. - */ - 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 replicas of a given service in an application 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getReplicasWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets replicas of a given service in an application 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 {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 {PagedServiceResourceReplicaDescriptionList} - 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. - * - * {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. - */ - 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getReplicaWithHttpOperationResponse(applicationResourceName: string, serviceResourceName: string, replicaName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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 {ServiceResourceReplicaDescription} - 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. - * - * {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. - */ - 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createVolumeResourceWithHttpOperationResponse(volumeResourceName: string, volumeResourceDescription: models.VolumeResourceDescription, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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. - */ - 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getVolumeResourceWithHttpOperationResponse(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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 {VolumeResourceDescription} - 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. - * - * {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. - */ - 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteVolumeResourceWithHttpOperationResponse(volumeResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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. - */ - 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, models as ServiceFabricModels }; diff --git a/lib/services/serviceFabric/lib/serviceFabricClient.js b/lib/services/serviceFabric/lib/serviceFabricClient.js index 974ebf7cc3..cf54504851 100644 --- a/lib/services/serviceFabric/lib/serviceFabricClient.js +++ b/lib/services/serviceFabric/lib/serviceFabricClient.js @@ -19,6 +19,7 @@ const ServiceClient = msRest.ServiceClient; const WebResource = msRest.WebResource; const models = require('./models'); +const operations = require('./operations'); /** @@ -1348,7 +1349,7 @@ function _getClusterHealthChunkUsingPolicyAndAdvancedFilters(options, callback) * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -2916,9 +2917,9 @@ function _unprovisionCluster(unprovisionFabricDescription, options, callback) { } /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Roll back the upgrade of a Service Fabric cluster. * - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param {object} [options] Optional Parameters. * @@ -3529,11 +3530,14 @@ function _startClusterUpgrade(startClusterUpgradeDescription, options, callback) * standalone cluster configuration upgrade. * * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The - * cluster configuration. + * cluster configuration as a JSON string. For example, [this + * file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) + * contains JSON describing the [nodes and other properties of the + * cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest). * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length - * of time between attempts to perform a health checks if the application or + * of time between attempts to perform health checks if the application or * cluster is not healthy. * * @param {moment.duration} @@ -3543,7 +3547,8 @@ function _startClusterUpgrade(startClusterUpgradeDescription, options, callback) * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] - * The length of time that the application or cluster must remain healthy. + * The length of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. * * @param {moment.duration} * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The @@ -4191,6 +4196,150 @@ function _getAadMetadata(options, callback) { }); } +/** + * @summary Get the current Service Fabric cluster version. + * + * If a cluster upgrade is happening, then this API will return the lowest + * (older) version of the current and target cluster runtime 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 ClusterVersion} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getClusterVersion(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.4'; + // 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('/') ? '' : '/') + '$/GetClusterVersion'; + 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['ClusterVersion']().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 nodes in the Service Fabric cluster. * @@ -5064,7 +5213,7 @@ function _getNodeHealthUsingPolicy(nodeName, options, callback) { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -9246,7 +9395,7 @@ function _getApplicationHealthUsingPolicy(applicationId, options, callback) { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -11565,7 +11714,7 @@ function _getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, optio * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -13990,7 +14139,7 @@ function _getServiceHealthUsingPolicy(serviceId, options, callback) { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -14192,6 +14341,11 @@ function _reportServiceHealth(serviceId, healthInformation, options, callback) { * * @param {string} [options.partitionKeyValue] Partition key. This is required * if the partition scheme for the service is Int64Range or Named. + * This is not the partition ID, but rather, either the integer key value, or + * the name of the partition ID. + * For example, if your service is using ranged partitions from 0 to 10, then + * they PartitionKeyValue would be an + * integer in that range. Query service description to see the range or name. * * @param {string} [options.previousRspVersion] The value in the Version field * of the response that was received previously. This is required if the user @@ -14418,7 +14572,7 @@ function _getPartitionInfoList(serviceId, options, callback) { } let continuationToken = (options && options.continuationToken !== undefined) ? options.continuationToken : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.0'; + let apiVersion = '6.4'; // Validate try { if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { @@ -15467,7 +15621,7 @@ function _getPartitionHealthUsingPolicy(partitionId, options, callback) { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -18651,7 +18805,7 @@ function _getReplicaHealthUsingPolicy(partitionId, replicaId, options, callback) * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -20619,7 +20773,7 @@ function _getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, se * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -22883,6 +23037,138 @@ function _startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgrade }); } +/** + * @summary Starts rolling back a compose deployment upgrade in the Service + * Fabric cluster. + * + * Rollback a service fabric compose deployment 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 timeout specifies the time duration that the + * client is willing to wait for the requested 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 _startRollbackComposeDeploymentUpgrade(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.4-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}/$/RollbackUpgrade'; + 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 = '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 Get the status of Chaos. * @@ -24287,7 +24573,7 @@ function _getImageStoreContent(contentPath, options, callback) { * @summary Deletes existing image store content. * * Deletes existing image store content being found within the given image - * store relative path. This can be used to delete uploaded application + * store relative path. This command can be used to delete uploaded application * packages once they are provisioned. * * @param {string} contentPath Relative path to file or folder in the image @@ -27184,7 +27470,7 @@ function _getNodeTransitionProgress(nodeName, operationId, options, callback) { * @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. + * Gets the list of user-induced fault operations filtered by provided input. * * @param {number} typeFilter Used to filter on OperationType for user-induced * operations. @@ -27396,8 +27682,8 @@ function _getFaultOperationList(typeFilter, stateFilter, options, callback) { * @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 {boolean} force Indicates whether to gracefully roll back and clean + * up internal system state modified by executing the user-induced operation. * * @param {object} [options] Optional Parameters. * @@ -27566,6 +27852,12 @@ function _cancelOperation(operationId, force, options, callback) { * @param {string} backupPolicyDescription.storage.storageKind Polymorphic * Discriminator * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * Polymorphic Discriminator + * * @param {object} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the @@ -27599,7 +27891,7 @@ function _createBackupPolicy(backupPolicyDescription, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (backupPolicyDescription === null || backupPolicyDescription === undefined) { @@ -27746,7 +28038,7 @@ function _deleteBackupPolicy(backupPolicyName, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (backupPolicyName === null || backupPolicyName === undefined || typeof backupPolicyName.valueOf() !== 'string') { @@ -27895,7 +28187,7 @@ function _getBackupPolicyList(options, callback) { 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'; + let apiVersion = '6.4'; // Validate try { if (continuationToken !== null && continuationToken !== undefined && typeof continuationToken.valueOf() !== 'string') { @@ -28059,7 +28351,7 @@ function _getBackupPolicyByName(backupPolicyName, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (backupPolicyName === null || backupPolicyName === undefined || typeof backupPolicyName.valueOf() !== 'string') { @@ -28228,7 +28520,7 @@ function _getAllEntitiesBackedUpByPolicy(backupPolicyName, options, callback) { 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'; + let apiVersion = '6.4'; // Validate try { if (backupPolicyName === null || backupPolicyName === undefined || typeof backupPolicyName.valueOf() !== 'string') { @@ -28392,6 +28684,12 @@ function _getAllEntitiesBackedUpByPolicy(backupPolicyName, options, callback) { * @param {string} backupPolicyDescription.storage.storageKind Polymorphic * Discriminator * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * Polymorphic Discriminator + * * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. @@ -28427,7 +28725,7 @@ function _updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (backupPolicyDescription === null || backupPolicyDescription === undefined) { @@ -28592,7 +28890,7 @@ function _enableApplicationBackup(applicationId, enableBackupDescription, option throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { @@ -28721,6 +29019,13 @@ function _enableApplicationBackup(applicationId, enableBackupDescription, option * client is willing to wait for the requested operation to complete. The * default value for this parameter is 60 seconds. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -28747,7 +29052,8 @@ function _disableApplicationBackup(applicationId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let disableBackupDescription = (options && options.disableBackupDescription !== undefined) ? options.disableBackupDescription : undefined; + let apiVersion = '6.4'; // Validate try { if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { @@ -28797,7 +29103,21 @@ function _disableApplicationBackup(applicationId, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (disableBackupDescription !== null && disableBackupDescription !== undefined) { + let requestModelMapper = new client.models['DisableBackupDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, disableBackupDescription, 'disableBackupDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(disableBackupDescription, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28906,7 +29226,7 @@ function _getApplicationBackupConfigurationInfo(applicationId, options, callback 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'; + let apiVersion = '6.4'; // Validate try { if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { @@ -29118,7 +29438,7 @@ function _getApplicationBackupList(applicationId, options, callback) { 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'; + let apiVersion = '6.4'; // Validate try { if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { @@ -29314,7 +29634,7 @@ function _suspendApplicationBackup(applicationId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { @@ -29453,7 +29773,7 @@ function _resumeApplicationBackup(applicationId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') { @@ -29604,7 +29924,7 @@ function _enableServiceBackup(serviceId, enableBackupDescription, options, callb throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { @@ -29732,6 +30052,13 @@ function _enableServiceBackup(serviceId, enableBackupDescription, options, callb * * @param {object} [options] Optional Parameters. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -29762,8 +30089,9 @@ function _disableServiceBackup(serviceId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let disableBackupDescription = (options && options.disableBackupDescription !== undefined) ? options.disableBackupDescription : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { @@ -29813,7 +30141,21 @@ function _disableServiceBackup(serviceId, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (disableBackupDescription !== null && disableBackupDescription !== undefined) { + let requestModelMapper = new client.models['DisableBackupDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, disableBackupDescription, 'disableBackupDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(disableBackupDescription, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -29921,7 +30263,7 @@ function _getServiceBackupConfigurationInfo(serviceId, options, callback) { 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'; + let apiVersion = '6.4'; // Validate try { if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { @@ -30133,7 +30475,7 @@ function _getServiceBackupList(serviceId, options, callback) { 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'; + let apiVersion = '6.4'; // Validate try { if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { @@ -30328,7 +30670,7 @@ function _suspendServiceBackup(serviceId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { @@ -30467,7 +30809,7 @@ function _resumeServiceBackup(serviceId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (serviceId === null || serviceId === undefined || typeof serviceId.valueOf() !== 'string') { @@ -30610,7 +30952,7 @@ function _enablePartitionBackup(partitionId, enableBackupDescription, options, c throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -30732,6 +31074,13 @@ function _enablePartitionBackup(partitionId, enableBackupDescription, options, c * * @param {object} [options] Optional Parameters. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -30762,8 +31111,9 @@ function _disablePartitionBackup(partitionId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let disableBackupDescription = (options && options.disableBackupDescription !== undefined) ? options.disableBackupDescription : undefined; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -30813,7 +31163,21 @@ function _disablePartitionBackup(partitionId, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (disableBackupDescription !== null && disableBackupDescription !== undefined) { + let requestModelMapper = new client.models['DisableBackupDescription']().mapper(); + requestModel = client.serialize(requestModelMapper, disableBackupDescription, 'disableBackupDescription'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(disableBackupDescription, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -30897,7 +31261,7 @@ function _getPartitionBackupConfigurationInfo(partitionId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -31065,7 +31429,7 @@ function _getPartitionBackupList(partitionId, options, callback) { 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'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -31234,7 +31598,7 @@ function _suspendPartitionBackup(partitionId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -31367,7 +31731,7 @@ function _resumePartitionBackup(partitionId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -31530,7 +31894,7 @@ function _backupPartition(partitionId, options, callback) { 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'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -31683,7 +32047,7 @@ function _getPartitionBackupProgress(partitionId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -31866,7 +32230,7 @@ function _restorePartition(partitionId, restorePartitionDescription, options, ca } let restoreTimeout = (options && options.restoreTimeout !== undefined) ? options.restoreTimeout : 10; let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -32023,7 +32387,7 @@ function _getPartitionRestoreProgress(partitionId, options, callback) { throw new Error('callback cannot be null.'); } let timeout = (options && options.timeout !== undefined) ? options.timeout : 60; - let apiVersion = '6.2-preview'; + let apiVersion = '6.4'; // Validate try { if (partitionId === null || partitionId === undefined || typeof partitionId.valueOf() !== 'string' || !msRest.isValidUuid(partitionId)) { @@ -32225,7 +32589,7 @@ function _getBackupsFromBackupLocation(getBackupByStorageQueryDescription, optio 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'; + let apiVersion = '6.4'; // Validate try { if (timeout !== null && timeout !== undefined && typeof timeout !== 'number') { @@ -33845,6 +34209,214 @@ function _getClusterEventList(startTimeUtc, endTimeUtc, options, callback) { 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.4'; + // 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 { @@ -33882,7 +34454,7 @@ function _getClusterEventList(startTimeUtc, endTimeUtc, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Cluster/Events'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Containers/Events'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -33967,7 +34539,7 @@ function _getClusterEventList(startTimeUtc, endTimeUtc, options, callback) { name: 'Sequence', element: { required: false, - serializedName: 'ClusterEventElementType', + serializedName: 'ContainerInstanceEventElementType', type: { name: 'Composite', polymorphicDiscriminator: { @@ -33975,7 +34547,7 @@ function _getClusterEventList(startTimeUtc, endTimeUtc, options, callback) { clientName: 'kind' }, uberParent: 'FabricEvent', - className: 'ClusterEvent' + className: 'ContainerInstanceEvent' } } } @@ -33995,9 +34567,11 @@ function _getClusterEventList(startTimeUtc, endTimeUtc, options, callback) { } /** - * @summary Gets all Containers-related events. + * @summary Gets a Node-related events. * - * The response is list of ContainerInstanceEvent objects. + * 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. @@ -34039,7 +34613,7 @@ function _getClusterEventList(startTimeUtc, endTimeUtc, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { +function _getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -34053,9 +34627,12 @@ function _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { 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'; + let apiVersion = '6.4'; // 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.'); } @@ -34090,7 +34667,8 @@ function _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Containers/Events'; + 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) { @@ -34175,7 +34753,7 @@ function _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { name: 'Sequence', element: { required: false, - serializedName: 'ContainerInstanceEventElementType', + serializedName: 'NodeEventElementType', type: { name: 'Composite', polymorphicDiscriminator: { @@ -34183,7 +34761,7 @@ function _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { clientName: 'kind' }, uberParent: 'FabricEvent', - className: 'ContainerInstanceEvent' + className: 'NodeEvent' } } } @@ -34203,12 +34781,10 @@ function _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { } /** - * @summary Gets a Node-related events. + * @summary Gets all Nodes-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. * @@ -34249,7 +34825,7 @@ function _getContainersEventList(startTimeUtc, endTimeUtc, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, callback) { +function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -34263,12 +34839,9 @@ function _getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, callback 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'; + let apiVersion = '6.4'; // 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.'); } @@ -34303,8 +34876,7 @@ function _getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, callback // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Nodes/{nodeName}/$/Events'; - requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Nodes/Events'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -34417,9 +34989,17 @@ function _getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, callback } /** - * @summary Gets all Nodes-related Events. + * @summary Gets an Application-related events. * - * The response is list of NodeEvent objects. + * 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. @@ -34461,7 +35041,7 @@ function _getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, callback * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { +function _getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -34475,9 +35055,12 @@ function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { 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'; + let apiVersion = '6.4'; // 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.'); } @@ -34512,7 +35095,8 @@ function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Nodes/Events'; + 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) { @@ -34597,7 +35181,7 @@ function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { name: 'Sequence', element: { required: false, - serializedName: 'NodeEventElementType', + serializedName: 'ApplicationEventElementType', type: { name: 'Composite', polymorphicDiscriminator: { @@ -34605,7 +35189,7 @@ function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { clientName: 'kind' }, uberParent: 'FabricEvent', - className: 'NodeEvent' + className: 'ApplicationEvent' } } } @@ -34625,18 +35209,10 @@ function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { } /** - * @summary Gets an Application-related events. + * @summary Gets all Applications-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. * @@ -34677,7 +35253,7 @@ function _getNodesEventList(startTimeUtc, endTimeUtc, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, callback) { +function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -34691,12 +35267,9 @@ function _getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, optio 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'; + let apiVersion = '6.4'; // 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.'); } @@ -34731,8 +35304,7 @@ function _getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, optio // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Applications/{applicationId}/$/Events'; - requestUrl = requestUrl.replace('{applicationId}', applicationId); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Applications/Events'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -34845,9 +35417,17 @@ function _getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, optio } /** - * @summary Gets all Applications-related events. + * @summary Gets a Service-related events. * - * The response is list of ApplicationEvent objects. + * 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. @@ -34889,7 +35469,7 @@ function _getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, optio * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) { +function _getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -34903,9 +35483,12 @@ function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) 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'; + let apiVersion = '6.4'; // 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.'); } @@ -34940,7 +35523,8 @@ function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Applications/Events'; + 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) { @@ -35025,7 +35609,7 @@ function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) name: 'Sequence', element: { required: false, - serializedName: 'ApplicationEventElementType', + serializedName: 'ServiceEventElementType', type: { name: 'Composite', polymorphicDiscriminator: { @@ -35033,7 +35617,7 @@ function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) clientName: 'kind' }, uberParent: 'FabricEvent', - className: 'ApplicationEvent' + className: 'ServiceEvent' } } } @@ -35053,18 +35637,10 @@ function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) } /** - * @summary Gets a Service-related events. + * @summary Gets all Services-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. * @@ -35105,7 +35681,7 @@ function _getApplicationsEventList(startTimeUtc, endTimeUtc, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, callback) { +function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -35119,12 +35695,9 @@ function _getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, call 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'; + let apiVersion = '6.4'; // 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.'); } @@ -35159,8 +35732,7 @@ function _getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, call // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Services/{serviceId}/$/Events'; - requestUrl = requestUrl.replace('{serviceId}', serviceId); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Services/Events'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -35273,9 +35845,11 @@ function _getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, call } /** - * @summary Gets all Services-related events. + * @summary Gets a Partition-related events. * - * The response is list of ServiceEvent objects. + * 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. @@ -35317,7 +35891,7 @@ function _getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { +function _getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -35331,9 +35905,12 @@ function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { 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'; + let apiVersion = '6.4'; // 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.'); } @@ -35368,7 +35945,8 @@ function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Services/Events'; + 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) { @@ -35453,7 +36031,7 @@ function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { name: 'Sequence', element: { required: false, - serializedName: 'ServiceEventElementType', + serializedName: 'PartitionEventElementType', type: { name: 'Composite', polymorphicDiscriminator: { @@ -35461,7 +36039,7 @@ function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { clientName: 'kind' }, uberParent: 'FabricEvent', - className: 'ServiceEvent' + className: 'PartitionEvent' } } } @@ -35481,12 +36059,10 @@ function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { } /** - * @summary Gets a Partition-related events. + * @summary Gets all Partitions-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. * @@ -35527,7 +36103,7 @@ function _getServicesEventList(startTimeUtc, endTimeUtc, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, callback) { +function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -35541,12 +36117,9 @@ function _getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, 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'; + let apiVersion = '6.4'; // 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.'); } @@ -35581,8 +36154,7 @@ function _getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/{partitionId}/$/Events'; - requestUrl = requestUrl.replace('{partitionId}', partitionId.toString()); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/Events'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (timeout !== null && timeout !== undefined) { @@ -35695,9 +36267,13 @@ function _getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, } /** - * @summary Gets all Partitions-related events. + * @summary Gets a Partition Replica-related events. * - * The response is list of PartitionEvent objects. + * 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. @@ -35739,7 +36315,7 @@ function _getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { +function _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -35753,9 +36329,15 @@ function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { 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'; + let apiVersion = '6.4'; // 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.'); } @@ -35790,7 +36372,9 @@ function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/Events'; + 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) { @@ -35875,7 +36459,7 @@ function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { name: 'Sequence', element: { required: false, - serializedName: 'PartitionEventElementType', + serializedName: 'ReplicaEventElementType', type: { name: 'Composite', polymorphicDiscriminator: { @@ -35883,7 +36467,7 @@ function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { clientName: 'kind' }, uberParent: 'FabricEvent', - className: 'PartitionEvent' + className: 'ReplicaEvent' } } } @@ -35903,14 +36487,12 @@ function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { } /** - * @summary Gets a Partition Replica-related events. + * @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} replicaId The identifier of the replica. - * * @param {string} startTimeUtc The start time of a lookup query in ISO UTC * yyyy-MM-ddTHH:mm:ssZ. * @@ -35951,7 +36533,7 @@ function _getPartitionsEventList(startTimeUtc, endTimeUtc, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, callback) { +function _getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -35965,15 +36547,12 @@ function _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, end 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'; + let apiVersion = '6.4'; // 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.'); } @@ -36008,9 +36587,8 @@ function _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, end // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'EventsStore/Partitions/{partitionId}/$/Replicas/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) { @@ -36123,17 +36701,11 @@ function _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, end } /** - * @summary Gets all Replicas-related events for a Partition. - * - * The response is list of ReplicaEvent objects. - * - * @param {uuid} partitionId The identity of the partition. + * @summary Gets all correlated events for a given event. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * The response is list of FabricEvents. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} eventInstanceId The EventInstanceId. * * @param {object} [options] Optional Parameters. * @@ -36142,18 +36714,6 @@ function _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, end * 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 * @@ -36169,7 +36729,7 @@ function _getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, end * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, callback) { +function _getCorrelatedEventList(eventInstanceId, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -36180,14 +36740,11 @@ function _getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, o 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'; + let apiVersion = '6.4'; // 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 (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.'); @@ -36202,207 +36759,14 @@ function _getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, o 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 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) { @@ -36503,1323 +36867,6 @@ function _getCorrelatedEventList(eventInstanceId, options, callback) { }); } -/** - * @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 application 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 { /** @@ -37844,6 +36891,15 @@ class ServiceFabricClient extends ServiceClient { let packageInfo = this.getPackageJsonInfo(__dirname); this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + this.meshSecret = new operations.MeshSecret(this); + this.meshSecretValue = new operations.MeshSecretValue(this); + this.meshVolume = new operations.MeshVolume(this); + this.meshNetwork = new operations.MeshNetwork(this); + this.meshApplication = new operations.MeshApplication(this); + this.meshService = new operations.MeshService(this); + this.meshCodePackage = new operations.MeshCodePackage(this); + this.meshServiceReplica = new operations.MeshServiceReplica(this); + this.meshGateway = new operations.MeshGateway(this); this.models = models; this._getClusterManifest = _getClusterManifest; this._getClusterHealth = _getClusterHealth; @@ -37866,6 +36922,7 @@ class ServiceFabricClient extends ServiceClient { this._startClusterConfigurationUpgrade = _startClusterConfigurationUpgrade; this._updateClusterUpgrade = _updateClusterUpgrade; this._getAadMetadata = _getAadMetadata; + this._getClusterVersion = _getClusterVersion; this._getNodeInfoList = _getNodeInfoList; this._getNodeInfo = _getNodeInfo; this._getNodeHealth = _getNodeHealth; @@ -37961,6 +37018,7 @@ class ServiceFabricClient extends ServiceClient { this._getComposeDeploymentUpgradeProgress = _getComposeDeploymentUpgradeProgress; this._removeComposeDeployment = _removeComposeDeployment; this._startComposeDeploymentUpgrade = _startComposeDeploymentUpgrade; + this._startRollbackComposeDeploymentUpgrade = _startRollbackComposeDeploymentUpgrade; this._getChaos = _getChaos; this._startChaos = _startChaos; this._stopChaos = _stopChaos; @@ -38040,16 +37098,6 @@ class ServiceFabricClient extends ServiceClient { 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); } @@ -39455,7 +38503,7 @@ class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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. * @@ -39582,439 +38630,39 @@ 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 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 {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, if the reporter has issues (e.g. 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 @@ -40030,7 +38678,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterConfiguration} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40038,14 +38686,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 ClusterConfiguration} 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. */ - getClusterConfiguration(configurationApiVersion, options, optionalCallback) { + reportClusterHealth(healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40054,26 +38701,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterConfiguration(configurationApiVersion, options, (err, result, request, response) => { + self._reportClusterHealth(healthInformation, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterConfiguration(configurationApiVersion, options, optionalCallback); + return self._reportClusterHealth(healthInformation, options, optionalCallback); } } /** - * @summary Get the cluster configuration upgrade status of a Service Fabric - * standalone cluster. + * @summary Gets a list of fabric code versions that are provisioned in a + * Service Fabric cluster. * - * Get the cluster configuration upgrade status details of a Service Fabric - * standalone 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 @@ -40084,15 +38734,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getProvisionedFabricCodeVersionInfoListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterConfigurationUpgradeStatus(options, (err, result, request, response) => { + self._getProvisionedFabricCodeVersionInfoList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40103,14 +38753,17 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the cluster configuration upgrade status of a Service Fabric - * standalone cluster. + * @summary Gets a list of fabric code versions that are provisioned in a + * Service Fabric cluster. * - * Get the cluster configuration upgrade status details of a Service Fabric - * standalone 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 @@ -40126,7 +38779,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ClusterConfigurationUpgradeStatusInfo} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40134,15 +38787,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 ClusterConfigurationUpgradeStatusInfo} 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. */ - getClusterConfigurationUpgradeStatus(options, optionalCallback) { + getProvisionedFabricCodeVersionInfoList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40151,26 +38802,30 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterConfigurationUpgradeStatus(options, (err, result, request, response) => { + self._getProvisionedFabricCodeVersionInfoList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterConfigurationUpgradeStatus(options, optionalCallback); + return self._getProvisionedFabricCodeVersionInfoList(options, optionalCallback); } } /** - * @summary Get the service state of Service Fabric Upgrade Orchestration - * Service. + * @summary Gets a list of fabric config versions that are provisioned in a + * Service Fabric cluster. * - * Get the service state of Service Fabric Upgrade Orchestration Service. This - * API is internally used for support purposes. + * 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 @@ -40181,15 +38836,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getUpgradeOrchestrationServiceStateWithHttpOperationResponse(options) { + getProvisionedFabricConfigVersionInfoListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getUpgradeOrchestrationServiceState(options, (err, result, request, response) => { + self._getProvisionedFabricConfigVersionInfoList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40200,14 +38855,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the service state of Service Fabric Upgrade Orchestration - * Service. + * @summary Gets a list of fabric config versions that are provisioned in a + * Service Fabric cluster. * - * Get the service state of Service Fabric Upgrade Orchestration Service. This - * API is internally used for support purposes. + * 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 @@ -40223,7 +38882,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {UpgradeOrchestrationServiceState} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40231,15 +38890,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 UpgradeOrchestrationServiceState} 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. */ - getUpgradeOrchestrationServiceState(options, optionalCallback) { + getProvisionedFabricConfigVersionInfoList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40248,29 +38905,22 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getUpgradeOrchestrationServiceState(options, (err, result, request, response) => { + self._getProvisionedFabricConfigVersionInfoList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getUpgradeOrchestrationServiceState(options, optionalCallback); + return self._getProvisionedFabricConfigVersionInfoList(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. + * @summary Gets the progress of the current cluster upgrade. * - * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of - * Service Fabric Upgrade Orchestration Service. + * 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. * @@ -40284,15 +38934,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - setUpgradeOrchestrationServiceStateWithHttpOperationResponse(upgradeOrchestrationServiceState, options) { + getClusterUpgradeProgressWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, (err, result, request, response) => { + self._getClusterUpgradeProgress(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40303,17 +38953,10 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the progress of the current cluster upgrade. * - * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of - * Service Fabric Upgrade Orchestration Service. + * 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. * @@ -40332,7 +38975,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {UpgradeOrchestrationServiceStateSummary} - The deserialized result object. + * @resolve {ClusterUpgradeProgressObject} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40341,14 +38984,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 UpgradeOrchestrationServiceStateSummary} for - * more information. + * 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. */ - setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, optionalCallback) { + getClusterUpgradeProgress(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40357,32 +39000,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, (err, result, request, response) => { + self._getClusterUpgradeProgress(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, optionalCallback); + return self._getClusterUpgradeProgress(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. + * @summary Get the Service Fabric standalone cluster configuration. * - * @param {string} [provisionFabricDescription.codeFilePath] The cluster code - * package file path. + * 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} [provisionFabricDescription.clusterManifestFilePath] The - * cluster manifest file path. + * @param {string} configurationApiVersion The API version of the Standalone + * cluster json configuration. * * @param {object} [options] Optional Parameters. * @@ -40396,15 +39033,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - provisionClusterWithHttpOperationResponse(provisionFabricDescription, options) { + getClusterConfigurationWithHttpOperationResponse(configurationApiVersion, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._provisionCluster(provisionFabricDescription, options, (err, result, request, response) => { + self._getClusterConfiguration(configurationApiVersion, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40415,20 +39052,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Get the Service Fabric standalone cluster configuration. * - * @param {string} [provisionFabricDescription.codeFilePath] The cluster code - * package file path. + * 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} [provisionFabricDescription.clusterManifestFilePath] The - * cluster manifest file path. + * @param {string} configurationApiVersion The API version of the Standalone + * cluster json configuration. * * @param {object} [options] Optional Parameters. * @@ -40447,7 +39078,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ClusterConfiguration} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40455,13 +39086,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 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. */ - provisionCluster(provisionFabricDescription, options, optionalCallback) { + getClusterConfiguration(configurationApiVersion, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40470,31 +39102,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._provisionCluster(provisionFabricDescription, options, (err, result, request, response) => { + self._getClusterConfiguration(configurationApiVersion, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._provisionCluster(provisionFabricDescription, options, optionalCallback); + return self._getClusterConfiguration(configurationApiVersion, 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. + * @summary Get the cluster configuration upgrade status of a Service Fabric + * standalone cluster. * - * @param {string} [unprovisionFabricDescription.configVersion] The cluster - * manifest version. + * Get the cluster configuration upgrade status details of a Service Fabric + * standalone cluster. * * @param {object} [options] Optional Parameters. * @@ -40508,15 +39132,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - unprovisionClusterWithHttpOperationResponse(unprovisionFabricDescription, options) { + getClusterConfigurationUpgradeStatusWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._unprovisionCluster(unprovisionFabricDescription, options, (err, result, request, response) => { + self._getClusterConfigurationUpgradeStatus(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40527,19 +39151,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Get the cluster configuration upgrade status of a Service Fabric + * standalone cluster. * - * @param {string} [unprovisionFabricDescription.configVersion] The cluster - * manifest version. + * Get the cluster configuration upgrade status details of a Service Fabric + * standalone cluster. * * @param {object} [options] Optional Parameters. * @@ -40558,7 +39174,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ClusterConfigurationUpgradeStatusInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40566,13 +39182,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 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. */ - unprovisionCluster(unprovisionFabricDescription, options, optionalCallback) { + getClusterConfigurationUpgradeStatus(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40581,21 +39199,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._unprovisionCluster(unprovisionFabricDescription, options, (err, result, request, response) => { + self._getClusterConfigurationUpgradeStatus(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._unprovisionCluster(unprovisionFabricDescription, options, optionalCallback); + return self._getClusterConfigurationUpgradeStatus(options, optionalCallback); } } /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Get the service state of Service Fabric Upgrade Orchestration + * Service. * - * Rollback the code or configuration upgrade 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} [options] Optional Parameters. * @@ -40609,15 +39229,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getUpgradeOrchestrationServiceStateWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._rollbackClusterUpgrade(options, (err, result, request, response) => { + self._getUpgradeOrchestrationServiceState(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40628,9 +39248,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Rollback the upgrade of a Service Fabric cluster. + * @summary Get the service state of Service Fabric Upgrade Orchestration + * Service. * - * Rollback the code or configuration upgrade 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} [options] Optional Parameters. * @@ -40649,7 +39271,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {UpgradeOrchestrationServiceState} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40657,13 +39279,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 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. */ - rollbackClusterUpgrade(options, optionalCallback) { + getUpgradeOrchestrationServiceState(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40672,28 +39296,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._rollbackClusterUpgrade(options, (err, result, request, response) => { + self._getUpgradeOrchestrationServiceState(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._rollbackClusterUpgrade(options, optionalCallback); + return self._getUpgradeOrchestrationServiceState(options, optionalCallback); } } /** - * @summary Make the cluster upgrade move on to the next upgrade domain. + * @summary Update the service state of Service Fabric Upgrade Orchestration + * Service. * - * Make the cluster code or configuration upgrade move on to the next upgrade - * domain if appropriate. + * Update the service state of Service Fabric Upgrade Orchestration Service. + * This API is internally used for support purposes. * - * @param {object} resumeClusterUpgradeDescription Describes the parameters for - * resuming a cluster upgrade. + * @param {object} upgradeOrchestrationServiceState Service state of Service + * Fabric Upgrade Orchestration Service. * - * @param {string} resumeClusterUpgradeDescription.upgradeDomain The next - * upgrade domain for this cluster upgrade. + * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of + * Service Fabric Upgrade Orchestration Service. * * @param {object} [options] Optional Parameters. * @@ -40707,15 +39332,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resumeClusterUpgradeWithHttpOperationResponse(resumeClusterUpgradeDescription, options) { + setUpgradeOrchestrationServiceStateWithHttpOperationResponse(upgradeOrchestrationServiceState, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { + self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -40726,16 +39351,17 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Make the cluster upgrade move on to the next upgrade domain. + * @summary Update the service state of Service Fabric Upgrade Orchestration + * Service. * - * Make the cluster code or configuration upgrade move on to the next upgrade - * domain if appropriate. + * Update the service state of Service Fabric Upgrade Orchestration Service. + * This API is internally used for support purposes. * - * @param {object} resumeClusterUpgradeDescription Describes the parameters for - * resuming a cluster upgrade. + * @param {object} upgradeOrchestrationServiceState Service state of Service + * Fabric Upgrade Orchestration Service. * - * @param {string} resumeClusterUpgradeDescription.upgradeDomain The next - * upgrade domain for this cluster upgrade. + * @param {string} [upgradeOrchestrationServiceState.serviceState] The state of + * Service Fabric Upgrade Orchestration Service. * * @param {object} [options] Optional Parameters. * @@ -40754,7 +39380,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {UpgradeOrchestrationServiceStateSummary} - The deserialized result object. * * @reject {Error} - The error object. * @@ -40762,13 +39388,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 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. */ - resumeClusterUpgrade(resumeClusterUpgradeDescription, options, optionalCallback) { + setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -40777,208 +39405,32 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { + self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, 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. + }); + } else { + return self._setUpgradeOrchestrationServiceState(upgradeOrchestrationServiceState, options, optionalCallback); + } + } + + /** + * @summary Provision the code or configuration packages of a Service Fabric + * cluster. * - * @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%. + * Validate and provision the code or configuration packages of a Service + * Fabric cluster. * - * @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} provisionFabricDescription Describes the parameters for + * provisioning a cluster. * - * @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 {string} [provisionFabricDescription.codeFilePath] The cluster code + * package file path. * - * @param {array} - * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] - * The wrapper that contains the map with application health policies used to - * evaluate specific applications in the cluster. + * @param {string} [provisionFabricDescription.clusterManifestFilePath] The + * cluster manifest file path. * * @param {object} [options] Optional Parameters. * @@ -40996,11 +39448,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startClusterUpgradeWithHttpOperationResponse(startClusterUpgradeDescription, options) { + provisionClusterWithHttpOperationResponse(provisionFabricDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { + self._provisionCluster(provisionFabricDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41011,196 +39463,131 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Start upgrading the code or configuration version of a Service + * @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. * - * 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} provisionFabricDescription Describes the parameters for + * provisioning a cluster. * - * @param {object} startClusterUpgradeDescription Describes the parameters for - * starting a cluster upgrade. + * @param {string} [provisionFabricDescription.codeFilePath] The cluster code + * package file path. * - * @param {string} [startClusterUpgradeDescription.codeVersion] The cluster - * code version. + * @param {string} [provisionFabricDescription.clusterManifestFilePath] The + * cluster manifest file path. * - * @param {string} [startClusterUpgradeDescription.configVersion] The cluster - * configuration version. + * @param {object} [options] Optional Parameters. * - * @param {string} [startClusterUpgradeDescription.upgradeKind] The kind of - * upgrade out of the following possible values. Possible values include: - * 'Invalid', 'Rolling' + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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} [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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {function} [optionalCallback] - The optional callback. * - * @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). + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {object} [startClusterUpgradeDescription.monitoringPolicy] Describes - * the parameters for monitoring an upgrade in Monitored mode. + * {Promise} A promise is returned * - * @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' + * @resolve {null} - The deserialized result object. * - * @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. + * @reject {Error} - The error object. * - * @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. + * {function} optionalCallback(err, result, request, response) * - * @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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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. + * {null} [result] - The deserialized result object if an error did not occur. * - * @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. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] Defines - * a health policy used to evaluate the health of the cluster or of a cluster - * node. + * {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. * - * @param {boolean} - * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * It is supported to unprovision code and configuration separately. * - * @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. + * @param {object} unprovisionFabricDescription Describes the parameters for + * unprovisioning a cluster. * - * 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 {string} [unprovisionFabricDescription.codeVersion] The cluster code + * package version. * - * In large clusters, some nodes will always be down or out for repairs, so - * this percentage should be configured to tolerate that. + * @param {string} [unprovisionFabricDescription.configVersion] The cluster + * manifest version. * - * @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. + * @param {object} [options] Optional Parameters. * - * 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 {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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} - * [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. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * 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. + * @returns {Promise} A promise is returned * - * @param {boolean} - * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, - * enables delta health evaluation rather than absolute health evaluation after - * completion of each upgrade domain. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] - * Defines a health policy used to evaluate the health of the cluster during a - * cluster upgrade. + * @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. * - * @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%. + * It is supported to unprovision code and configuration separately. * - * @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} unprovisionFabricDescription Describes the parameters for + * unprovisioning a cluster. * - * @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 {string} [unprovisionFabricDescription.codeVersion] The cluster code + * package version. * - * @param {array} - * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] - * The wrapper that contains the map with application health policies used to - * evaluate specific applications in the cluster. + * @param {string} [unprovisionFabricDescription.configVersion] The cluster + * manifest version. * * @param {object} [options] Optional Parameters. * @@ -41233,7 +39620,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startClusterUpgrade(startClusterUpgradeDescription, options, optionalCallback) { + unprovisionCluster(unprovisionFabricDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -41242,81 +39629,119 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { + self._unprovisionCluster(unprovisionFabricDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startClusterUpgrade(startClusterUpgradeDescription, options, optionalCallback); + return self._unprovisionCluster(unprovisionFabricDescription, options, optionalCallback); } } /** - * @summary Start upgrading the configuration of a Service Fabric standalone - * cluster. + * @summary Roll back the upgrade of a Service Fabric cluster. * - * Validate the supplied configuration upgrade parameters and start upgrading - * the cluster configuration if the parameters are valid. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * - * @param {object} clusterConfigurationUpgradeDescription Parameters for a - * standalone cluster configuration upgrade. + * @param {object} [options] Optional Parameters. * - * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The - * cluster 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 {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length - * of time between attempts to perform a health checks if the application or - * cluster is not healthy. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckWaitDurationInSeconds] - * The length of time to wait after completing an upgrade domain before - * starting the health checks process. + * @returns {Promise} A promise is returned * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] - * The length of time that the application or cluster must remain healthy. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The - * timeout for the upgrade domain. + * @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 Roll back the upgrade of a Service Fabric cluster. * - * @param {moment.duration} - * [clusterConfigurationUpgradeDescription.upgradeTimeoutInSeconds] The upgrade - * timeout. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyApplications] The - * maximum allowed percentage of unhealthy applications during the upgrade. - * Allowed values are integer values from zero to 100. + * @param {object} [options] Optional Parameters. * - * @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} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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} - * [clusterConfigurationUpgradeDescription.maxPercentDeltaUnhealthyNodes] The - * maximum allowed percentage of delta health degradation during the upgrade. - * Allowed values are integer values from zero to 100. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {function} [optionalCallback] - The optional callback. * - * @param {object} - * [clusterConfigurationUpgradeDescription.applicationHealthPolicies] Defines - * the application health policy map used to evaluate the health of an - * application or one of its children entities. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {array} - * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] - * The wrapper that contains the map with application health policies used to - * evaluate specific applications in the cluster. + * {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. * @@ -41334,11 +39759,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startClusterConfigurationUpgradeWithHttpOperationResponse(clusterConfigurationUpgradeDescription, options) { + resumeClusterUpgradeWithHttpOperationResponse(resumeClusterUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { + self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41349,69 +39774,16 @@ 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. - * - * @param {number} - * [clusterConfigurationUpgradeDescription.maxPercentDeltaUnhealthyNodes] The - * maximum allowed percentage of delta health degradation during the upgrade. - * Allowed values are integer values from zero to 100. + * @summary Make the cluster upgrade move on to the next upgrade domain. * - * @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. + * Make the cluster code or configuration upgrade move on to the next upgrade + * domain if appropriate. * - * @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 {object} resumeClusterUpgradeDescription Describes the parameters for + * resuming a cluster upgrade. * - * @param {array} - * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] - * The wrapper that contains the map with application health policies used to - * evaluate specific applications in the cluster. + * @param {string} resumeClusterUpgradeDescription.upgradeDomain The next + * upgrade domain for this cluster upgrade. * * @param {object} [options] Optional Parameters. * @@ -41444,7 +39816,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback) { + resumeClusterUpgrade(resumeClusterUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -41453,55 +39825,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { + self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback); + return self._resumeClusterUpgrade(resumeClusterUpgradeDescription, options, optionalCallback); } } /** - * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. + * @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. * - * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * @param {object} startClusterUpgradeDescription Describes the parameters for + * starting a cluster upgrade. * - * @param {object} updateClusterUpgradeDescription Parameters for updating a - * cluster upgrade. + * @param {string} [startClusterUpgradeDescription.codeVersion] The cluster + * code version. * - * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of - * upgrade out of the following possible values. Possible values include: - * 'Invalid', 'Rolling', 'Rolling_ForceRestart' + * @param {string} [startClusterUpgradeDescription.configVersion] The cluster + * configuration version. * - * @param {object} [updateClusterUpgradeDescription.updateDescription] - * Describes the parameters for updating a rolling upgrade of application or - * cluster. + * @param {string} [startClusterUpgradeDescription.upgradeKind] The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @param {string} - * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode The - * mode used to monitor health during a rolling upgrade. The values are + * @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 {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 + * [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} - * [updateClusterUpgradeDescription.updateDescription.failureAction] The + * [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 @@ -41510,14 +39888,14 @@ class ServiceFabricClient extends ServiceClient { * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * [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} - * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * [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, @@ -41525,7 +39903,7 @@ class ServiceFabricClient extends ServiceClient { * milliseconds. * * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * [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, @@ -41533,29 +39911,29 @@ class ServiceFabricClient extends ServiceClient { * milliseconds. * * @param {string} - * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] + * [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} - * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * [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} [updateClusterUpgradeDescription.clusterHealthPolicy] - * Defines a health policy used to evaluate the health of the cluster or of a - * cluster node. + * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} - * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] + * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * * @param {number} - * [updateClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyNodes] + * [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. * @@ -41572,7 +39950,7 @@ class ServiceFabricClient extends ServiceClient { * this percentage should be configured to tolerate that. * * @param {number} - * [updateClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] + * [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. @@ -41589,7 +39967,7 @@ class ServiceFabricClient extends ServiceClient { * applications. Default percentage is zero. * * @param {array} - * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * [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 @@ -41614,16 +39992,16 @@ class ServiceFabricClient extends ServiceClient { * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} - * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, * enables delta health evaluation rather than absolute health evaluation after * completion of each upgrade domain. * - * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] * Defines a health policy used to evaluate the health of the cluster during a * cluster upgrade. * * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] + * [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 @@ -41632,7 +40010,7 @@ class ServiceFabricClient extends ServiceClient { * limits. The default value is 10%. * * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] + * [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 @@ -41641,12 +40019,12 @@ class ServiceFabricClient extends ServiceClient { * upgrade domains to make sure the state of the upgrade domains is within * tolerated limits. The default value is 15%. * - * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * @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} - * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] * The wrapper that contains the map with application health policies used to * evaluate specific applications in the cluster. * @@ -41666,11 +40044,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - updateClusterUpgradeWithHttpOperationResponse(updateClusterUpgradeDescription, options) { + startClusterUpgradeWithHttpOperationResponse(startClusterUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateClusterUpgrade(updateClusterUpgradeDescription, options, (err, result, request, response) => { + self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -41681,43 +40059,49 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. + * @summary Start upgrading the code or configuration version of a Service + * Fabric cluster. * - * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * 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} updateClusterUpgradeDescription Parameters for updating a - * cluster upgrade. + * @param {object} startClusterUpgradeDescription Describes the parameters for + * starting 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 {string} [startClusterUpgradeDescription.codeVersion] The cluster + * code version. * - * @param {object} [updateClusterUpgradeDescription.updateDescription] - * Describes the parameters for updating a rolling upgrade of application or - * cluster. + * @param {string} [startClusterUpgradeDescription.configVersion] The cluster + * configuration version. * - * @param {string} - * updateClusterUpgradeDescription.updateDescription.rollingUpgradeMode The - * mode used to monitor health during a rolling upgrade. The values are + * @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 {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 + * [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} - * [updateClusterUpgradeDescription.updateDescription.failureAction] The + * [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 @@ -41726,14 +40110,14 @@ class ServiceFabricClient extends ServiceClient { * mode. Possible values include: 'Invalid', 'Rollback', 'Manual' * * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds] + * [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} - * [updateClusterUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds] + * [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, @@ -41741,7 +40125,7 @@ class ServiceFabricClient extends ServiceClient { * milliseconds. * * @param {string} - * [updateClusterUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds] + * [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, @@ -41749,29 +40133,29 @@ class ServiceFabricClient extends ServiceClient { * milliseconds. * * @param {string} - * [updateClusterUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds] + * [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} - * [updateClusterUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds] + * [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} [updateClusterUpgradeDescription.clusterHealthPolicy] - * Defines a health policy used to evaluate the health of the cluster or of a - * cluster node. + * @param {object} [startClusterUpgradeDescription.clusterHealthPolicy] Defines + * a health policy used to evaluate the health of the cluster or of a cluster + * node. * * @param {boolean} - * [updateClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] + * [startClusterUpgradeDescription.clusterHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * * @param {number} - * [updateClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyNodes] + * [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. * @@ -41788,7 +40172,7 @@ class ServiceFabricClient extends ServiceClient { * this percentage should be configured to tolerate that. * * @param {number} - * [updateClusterUpgradeDescription.clusterHealthPolicy.maxPercentUnhealthyApplications] + * [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. @@ -41805,7 +40189,7 @@ class ServiceFabricClient extends ServiceClient { * applications. Default percentage is zero. * * @param {array} - * [updateClusterUpgradeDescription.clusterHealthPolicy.applicationTypeHealthPolicyMap] + * [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 @@ -41830,16 +40214,16 @@ class ServiceFabricClient extends ServiceClient { * HealthManager/EnableApplicationTypeHealthEvaluation. * * @param {boolean} - * [updateClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, + * [startClusterUpgradeDescription.enableDeltaHealthEvaluation] When true, * enables delta health evaluation rather than absolute health evaluation after * completion of each upgrade domain. * - * @param {object} [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy] + * @param {object} [startClusterUpgradeDescription.clusterUpgradeHealthPolicy] * Defines a health policy used to evaluate the health of the cluster during a * cluster upgrade. * * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentDeltaUnhealthyNodes] + * [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 @@ -41848,7 +40232,7 @@ class ServiceFabricClient extends ServiceClient { * limits. The default value is 10%. * * @param {number} - * [updateClusterUpgradeDescription.clusterUpgradeHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] + * [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 @@ -41857,12 +40241,12 @@ class ServiceFabricClient extends ServiceClient { * upgrade domains to make sure the state of the upgrade domains is within * tolerated limits. The default value is 15%. * - * @param {object} [updateClusterUpgradeDescription.applicationHealthPolicyMap] + * @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} - * [updateClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] + * [startClusterUpgradeDescription.applicationHealthPolicyMap.applicationHealthPolicyMap] * The wrapper that contains the map with application health policies used to * evaluate specific applications in the cluster. * @@ -41897,247 +40281,7 @@ class ServiceFabricClient extends ServiceClient { * * {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) { + startClusterUpgrade(startClusterUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42146,151 +40290,87 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeInfoList(options, (err, result, request, response) => { + self._startClusterUpgrade(startClusterUpgradeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeInfoList(options, optionalCallback); + return self._startClusterUpgrade(startClusterUpgradeDescription, 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 + * @summary Start upgrading the configuration of a Service Fabric standalone * 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. + * Validate the supplied configuration upgrade parameters and start upgrading + * the cluster configuration if the parameters are valid. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {object} clusterConfigurationUpgradeDescription Parameters for a + * standalone cluster configuration upgrade. * - * {Promise} A promise is returned + * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The + * cluster configuration as a JSON string. For example, [this + * file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) + * contains JSON describing the [nodes and other properties of the + * cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest). * - * @resolve {NodeInfo} - The deserialized result object. + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length + * of time between attempts to perform health checks if the application or + * cluster is not healthy. * - * @reject {Error} - The error object. + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckWaitDurationInSeconds] + * The length of time to wait after completing an upgrade domain before + * starting the health checks process. * - * {function} optionalCallback(err, result, request, response) + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckStableDurationInSeconds] + * The length of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.upgradeDomainTimeoutInSeconds] The + * timeout for the upgrade domain. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NodeInfo} for more information. + * @param {moment.duration} + * [clusterConfigurationUpgradeDescription.upgradeTimeoutInSeconds] The upgrade + * timeout. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyApplications] The + * maximum allowed percentage of unhealthy applications during the upgrade. + * Allowed values are integer values from zero to 100. * - * {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. + * @param {number} + * [clusterConfigurationUpgradeDescription.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes during the upgrade. Allowed + * values are integer values from zero to 100. * - * 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 {number} + * [clusterConfigurationUpgradeDescription.maxPercentDeltaUnhealthyNodes] The + * maximum allowed percentage of delta health degradation during the upgrade. + * Allowed values are integer values from zero to 100. * - * @param {string} nodeName The name of the node. + * @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} [options] Optional Parameters. + * @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 {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 {array} + * [clusterConfigurationUpgradeDescription.applicationHealthPolicies.applicationHealthPolicyMap] + * The wrapper that contains the map with application health policies used to + * evaluate specific applications in the 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} [options] Optional Parameters. * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the @@ -42302,15 +40382,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + startClusterConfigurationUpgradeWithHttpOperationResponse(clusterConfigurationUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeHealth(nodeName, options, (err, result, request, response) => { + self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42321,39 +40401,75 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric node. + * @summary Start upgrading the configuration of a Service Fabric standalone + * cluster. * - * 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. + * Validate the supplied configuration upgrade parameters and start upgrading + * the cluster configuration if the parameters are valid. * - * @param {string} nodeName The name of the node. + * @param {object} clusterConfigurationUpgradeDescription Parameters for a + * standalone cluster configuration upgrade. * - * @param {object} [options] Optional Parameters. + * @param {string} clusterConfigurationUpgradeDescription.clusterConfig The + * cluster configuration as a JSON string. For example, [this + * file](https://github.com/Azure-Samples/service-fabric-dotnet-standalone-cluster-configuration/blob/master/Samples/ClusterConfig.Unsecure.DevCluster.json) + * contains JSON describing the [nodes and other properties of the + * cluster](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-manifest). * - * @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 {moment.duration} + * [clusterConfigurationUpgradeDescription.healthCheckRetryTimeout] The length + * of time between attempts to perform health checks if the application or + * cluster is not healthy. * - * - 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 {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 + * before the upgrade proceeds to the next upgrade domain. + * + * @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 @@ -42370,7 +40486,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. * @@ -42378,14 +40494,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) { + startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42394,65 +40509,111 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeHealth(nodeName, options, (err, result, request, response) => { + self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeHealth(nodeName, options, optionalCallback); + return self._startClusterConfigurationUpgrade(clusterConfigurationUpgradeDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric node, by using the specified - * health policy. + * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. * - * 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. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. * - * @param {string} nodeName The name of the node. + * @param {object} updateClusterUpgradeDescription Parameters for updating a + * cluster upgrade. * - * @param {object} [options] Optional Parameters. + * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling', 'Rolling_ForceRestart' * - * @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} [updateClusterUpgradeDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * 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} + * 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 {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} + * [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 {boolean} [options.clusterHealthPolicy.considerWarningAsError] + * @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} [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. + * @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. @@ -42467,10 +40628,10 @@ class ServiceFabricClient extends ServiceClient { * 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. + * [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. @@ -42483,7 +40644,8 @@ 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] + * @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 @@ -42507,6 +40669,45 @@ class ServiceFabricClient extends ServiceClient { * 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 @@ -42517,15 +40718,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + updateClusterUpgradeWithHttpOperationResponse(updateClusterUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeHealthUsingPolicy(nodeName, options, (err, result, request, response) => { + self._updateClusterUpgrade(updateClusterUpgradeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42536,53 +40737,99 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric node, by using the specified - * health policy. + * @summary Update the upgrade parameters of a Service Fabric cluster upgrade. * - * 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. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. * - * @param {string} nodeName The name of the node. + * @param {object} updateClusterUpgradeDescription Parameters for updating a + * cluster upgrade. * - * @param {object} [options] Optional Parameters. + * @param {string} [updateClusterUpgradeDescription.upgradeKind] The type of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling', 'Rolling_ForceRestart' * - * @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} [updateClusterUpgradeDescription.updateDescription] + * Describes the parameters for updating a rolling upgrade of application or + * 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} + * 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 {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} + * [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 {boolean} [options.clusterHealthPolicy.considerWarningAsError] + * @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} [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. + * @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. @@ -42597,10 +40844,10 @@ class ServiceFabricClient extends ServiceClient { * 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. + * [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. @@ -42613,7 +40860,8 @@ 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] + * @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 @@ -42637,6 +40885,45 @@ class ServiceFabricClient extends ServiceClient { * 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 @@ -42652,7 +40939,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. * @@ -42660,14 +40947,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. */ - getNodeHealthUsingPolicy(nodeName, options, optionalCallback) { + updateClusterUpgrade(updateClusterUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42676,125 +40962,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeHealthUsingPolicy(nodeName, options, (err, result, request, response) => { + self._updateClusterUpgrade(updateClusterUpgradeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeHealthUsingPolicy(nodeName, options, optionalCallback); + return self._updateClusterUpgrade(updateClusterUpgradeDescription, 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. + * @summary Gets the Azure Active Directory metadata used for secured + * connection to cluster. * - * @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. + * 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 {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 @@ -42805,15 +40995,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getAadMetadataWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { + self._getAadMetadata(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -42824,112 +41014,110 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric node. + * @summary Gets the Azure Active Directory metadata used for secured + * connection to cluster. * - * 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. + * 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 {string} nodeName The name of the node. + * @param {object} [options] Optional Parameters. * - * @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.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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} healthInformation.sourceId The source name that identifies - * the client/watchdog/system component that generated the health information. + * @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. + * @param {function} [optionalCallback] - The optional callback. * - * Together with the SourceId, the property uniquely identifies the health - * information. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @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' + * {Promise} A promise is returned * - * @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. + * @resolve {AadMetadataObject} - The deserialized result object. * - * If not specified, time to live defaults to infinite value. + * @reject {Error} - The error 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. + * {function} optionalCallback(err, result, request, response) * - * @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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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. + * {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 Get the current Service Fabric cluster version. + * + * If a cluster upgrade is happening, then this API will return the lowest + * (older) version of the current and target cluster runtime versions. * * @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. + */ + getClusterVersionWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getClusterVersion(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 current Service Fabric cluster version. + * + * If a cluster upgrade is happening, then this API will return the lowest + * (older) version of the current and target cluster runtime 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 @@ -42946,7 +41134,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ClusterVersion} - The deserialized result object. * * @reject {Error} - The error object. * @@ -42954,13 +41142,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 ClusterVersion} for more information. * * {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) { + getClusterVersion(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -42969,27 +41158,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { + self._getClusterVersion(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportNodeHealth(nodeName, healthInformation, options, optionalCallback); + return self._getClusterVersion(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. + * @summary Gets the list of nodes in the Service Fabric cluster. * - * @param {string} nodeName The name of 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 + * 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 @@ -43000,15 +41209,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getNodeInfoListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeLoadInfo(nodeName, options, (err, result, request, response) => { + self._getNodeInfoList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43019,15 +41228,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the list of nodes in the Service Fabric cluster. * - * @param {string} nodeName The name of 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 + * 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 @@ -43043,7 +41272,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {NodeLoadInfo} - The deserialized result object. + * @resolve {PagedNodeInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43052,13 +41281,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 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. */ - getNodeLoadInfo(nodeName, options, optionalCallback) { + getNodeInfoList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43067,40 +41296,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeLoadInfo(nodeName, options, (err, result, request, response) => { + self._getNodeInfoList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeLoadInfo(nodeName, options, optionalCallback); + return self._getNodeInfoList(options, optionalCallback); } } /** - * @summary Deactivate a Service Fabric cluster node with the specified - * deactivation intent. + * @summary Gets the information about a specific node in the Service Fabric + * cluster. * - * 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. + * 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} 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 @@ -43113,15 +41328,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getNodeInfoWithHttpOperationResponse(nodeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { + self._getNodeInfo(nodeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43132,28 +41347,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deactivate a Service Fabric cluster node with the specified - * deactivation intent. + * @summary Gets the information about a specific node in the Service Fabric + * cluster. * - * 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. + * 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} 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 @@ -43171,7 +41372,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {NodeInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43179,13 +41380,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 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. */ - disableNode(nodeName, deactivationIntentDescription, options, optionalCallback) { + getNodeInfo(nodeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43194,30 +41396,52 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { + self._getNodeInfo(nodeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._disableNode(nodeName, deactivationIntentDescription, options, optionalCallback); + return self._getNodeInfo(nodeName, options, optionalCallback); } } /** - * @summary Activate a Service Fabric cluster node that is currently - * deactivated. + * @summary Gets the health of a Service Fabric node. * - * 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. + * 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 @@ -43228,15 +41452,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getNodeHealthWithHttpOperationResponse(nodeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._enableNode(nodeName, options, (err, result, request, response) => { + self._getNodeHealth(nodeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43247,17 +41471,39 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Activate a Service Fabric cluster node that is currently - * deactivated. + * @summary Gets the health of a Service Fabric node. * - * 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. + * 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 {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 @@ -43274,7 +41520,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {NodeHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43282,13 +41528,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 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. */ - enableNode(nodeName, options, optionalCallback) { + getNodeHealth(nodeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43297,34 +41544,119 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._enableNode(nodeName, options, (err, result, request, response) => { + self._getNodeHealth(nodeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._enableNode(nodeName, options, optionalCallback); + return self._getNodeHealth(nodeName, options, optionalCallback); } } /** - * @summary Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. + * @summary Gets the health of a Service Fabric node, by using the specified + * health policy. * - * 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. + * 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 @@ -43335,15 +41667,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getNodeHealthUsingPolicyWithHttpOperationResponse(nodeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._removeNodeState(nodeName, options, (err, result, request, response) => { + self._getNodeHealthUsingPolicy(nodeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43354,22 +41686,107 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Notifies Service Fabric that the persisted state on a node has been - * permanently removed or lost. + * @summary Gets the health of a Service Fabric node, by using the specified + * health policy. * - * 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. + * 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 @@ -43385,7 +41802,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {NodeHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43393,13 +41810,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 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. */ - removeNodeState(nodeName, options, optionalCallback) { + getNodeHealthUsingPolicy(nodeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43408,38 +41826,125 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._removeNodeState(nodeName, options, (err, result, request, response) => { + self._getNodeHealthUsingPolicy(nodeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._removeNodeState(nodeName, options, optionalCallback); + return self._getNodeHealthUsingPolicy(nodeName, options, optionalCallback); } } /** - * @summary Restarts a Service Fabric cluster node. + * @summary Sends a health report on the Service Fabric node. * - * Restarts a Service Fabric cluster node that is already started. + * 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} restartNodeDescription The instance of the node to be - * restarted and a flag indicating the need to take dump of the fabric process. + * @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} 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} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * - * @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 {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, if the reporter has issues (e.g. 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 @@ -43454,11 +41959,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - restartNodeWithHttpOperationResponse(nodeName, restartNodeDescription, options) { + reportNodeHealthWithHttpOperationResponse(nodeName, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { + self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43469,26 +41974,113 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Restarts a Service Fabric cluster node. + * @summary Sends a health report on the Service Fabric node. * - * Restarts a Service Fabric cluster node that is already started. + * 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} restartNodeDescription The instance of the node to be - * restarted and a flag indicating the need to take dump of the fabric process. + * @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} 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} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * - * @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 {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, if the reporter has issues (e.g. 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 @@ -43518,7 +42110,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restartNode(nodeName, restartNodeDescription, options, optionalCallback) { + reportNodeHealth(nodeName, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43527,66 +42119,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { + self._reportNodeHealth(nodeName, healthInformation, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restartNode(nodeName, restartNodeDescription, options, optionalCallback); + return self._reportNodeHealth(nodeName, healthInformation, 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. + * @summary Gets the load information of a Service Fabric node. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * Retrieves the load information of a Service Fabric node for all the metrics + * that have load or capacity defined. * - * @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} nodeName The name of the node. * - * @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 @@ -43598,15 +42150,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getNodeLoadInfoWithHttpOperationResponse(nodeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationTypeInfoList(options, (err, result, request, response) => { + self._getNodeLoadInfo(nodeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43617,54 +42169,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the load information of a Service Fabric node. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * Retrieves the load information of a Service Fabric node for all the metrics + * that have load or capacity defined. * - * @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} nodeName The name of the node. * - * @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 @@ -43681,7 +42193,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedApplicationTypeInfoList} - The deserialized result object. + * @resolve {NodeLoadInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -43690,14 +42202,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 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. */ - getApplicationTypeInfoList(options, optionalCallback) { + getNodeLoadInfo(nodeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43706,62 +42217,41 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationTypeInfoList(options, (err, result, request, response) => { + self._getNodeLoadInfo(nodeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationTypeInfoList(options, optionalCallback); + return self._getNodeLoadInfo(nodeName, 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. + * @summary Deactivate a Service Fabric cluster node with the specified + * deactivation intent. * - * @param {object} [options] Optional Parameters. + * 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} [options.applicationTypeVersion] The version of the - * application type. + * @param {string} nodeName The name of the node. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {object} deactivationIntentDescription Describes the intent or reason + * for deactivating the node. * - * @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} [deactivationIntentDescription.deactivationIntent] Describes + * the intent or reason for deactivating the node. The possible values are + * following. Possible values include: 'Pause', 'Restart', 'RemoveData' * - * @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 @@ -43773,15 +42263,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + disableNodeWithHttpOperationResponse(nodeName, deactivationIntentDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationTypeInfoListByName(applicationTypeName, options, (err, result, request, response) => { + self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43792,50 +42282,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Deactivate a Service Fabric cluster node with the specified + * deactivation intent. * - * @param {object} [options] Optional Parameters. + * 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} [options.applicationTypeVersion] The version of the - * application type. + * @param {string} nodeName The name of the node. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @param {object} deactivationIntentDescription Describes the intent or reason + * for deactivating the node. * - * @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} [deactivationIntentDescription.deactivationIntent] Describes + * the intent or reason for deactivating the node. The possible values are + * following. Possible values include: 'Pause', 'Restart', 'RemoveData' * - * @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 @@ -43852,7 +42321,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. * @@ -43860,15 +42329,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) { + disableNode(nodeName, deactivationIntentDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -43877,43 +42344,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationTypeInfoListByName(applicationTypeName, options, (err, result, request, response) => { + self._disableNode(nodeName, deactivationIntentDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationTypeInfoListByName(applicationTypeName, options, optionalCallback); + return self._disableNode(nodeName, deactivationIntentDescription, 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. + * @summary Activate a Service Fabric cluster node that is currently + * deactivated. * - * @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. + * 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} - * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic - * Discriminator + * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * @@ -43931,11 +42382,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - provisionApplicationTypeWithHttpOperationResponse(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options) { + enableNodeWithHttpOperationResponse(nodeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, (err, result, request, response) => { + self._enableNode(nodeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -43946,31 +42397,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Activate a Service Fabric cluster node that is currently + * deactivated. * - * @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. + * 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} - * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic - * Discriminator + * @param {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * @@ -44003,7 +42438,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, optionalCallback) { + enableNode(nodeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44012,42 +42447,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, (err, result, request, response) => { + self._enableNode(nodeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, optionalCallback); + return self._enableNode(nodeName, 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. + * @summary Notifies Service Fabric that the persisted state on a node has been + * permanently removed or lost. * - * @param {string} - * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version - * of the application type as defined in the application manifest. + * 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 {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 {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * @@ -44065,11 +42489,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - unprovisionApplicationTypeWithHttpOperationResponse(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options) { + removeNodeStateWithHttpOperationResponse(nodeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, (err, result, request, response) => { + self._removeNodeState(nodeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44080,30 +42504,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Notifies Service Fabric that the persisted state on a node has been + * permanently removed or lost. * - * @param {string} - * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version - * of the application type as defined in the application manifest. + * 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 {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 {string} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * @@ -44136,7 +42549,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, optionalCallback) { + removeNodeState(nodeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44145,28 +42558,35 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, (err, result, request, response) => { + self._removeNodeState(nodeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, optionalCallback); + return self._removeNodeState(nodeName, 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 Restarts a Service Fabric cluster node. * - * 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. + * Restarts a Service Fabric cluster node that is already started. * - * @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 {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. * @@ -44180,15 +42600,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + restartNodeWithHttpOperationResponse(nodeName, restartNodeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44199,16 +42619,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 Restarts a Service Fabric cluster node. * - * 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. + * Restarts a Service Fabric cluster node that is already started. * - * @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 {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. * @@ -44227,7 +42654,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. * @@ -44235,13 +42662,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. */ - getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback) { + restartNode(nodeName, restartNodeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44250,35 +42677,66 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._restartNode(nodeName, restartNodeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback); + return self._restartNode(nodeName, restartNodeDescription, options, optionalCallback); } } /** - * @summary Gets the information about a specific service type that is - * supported by a provisioned application type in a Service Fabric cluster. + * @summary Gets the list of application types in the 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 specified service type is not found in the - * 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 {string} applicationTypeName The name of the application type. + * @param {object} [options] Optional Parameters. * - * @param {string} applicationTypeVersion The version of the application type. + * @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 {string} serviceTypeName Specifies the name of a Service Fabric - * service type. + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. * - * @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 @@ -44290,15 +42748,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceTypeInfoByNameWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, serviceTypeName, options) { + getApplicationTypeInfoListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, (err, result, request, response) => { + self._getApplicationTypeInfoList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44309,23 +42767,54 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about a specific service type that is - * supported by a provisioned application type in a Service Fabric cluster. + * @summary Gets the list of application types in the 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 specified service type is not found in the - * 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 {string} applicationTypeName The name of the application type. + * @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 {string} 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} serviceTypeName Specifies the name of a Service Fabric - * service type. + * @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] Optional Parameters. + * @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 @@ -44342,7 +42831,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceTypeInfo} - The deserialized result object. + * @resolve {PagedApplicationTypeInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -44351,13 +42840,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 ServiceTypeInfo} for more information. + * 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. */ - getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, optionalCallback) { + getApplicationTypeInfoList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44366,31 +42856,62 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, (err, result, request, response) => { + self._getApplicationTypeInfoList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, optionalCallback); + return self._getApplicationTypeInfoList(options, optionalCallback); } } /** - * @summary Gets the manifest describing a service type. + * @summary Gets the list of application types in the Service Fabric cluster + * matching exactly the specified name. * - * Gets the manifest describing a service type. The response contains the - * service manifest XML as a string. + * 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 {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.applicationTypeVersion] The version of the + * application type. * - * @param {object} [options] Optional Parameters. + * @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 @@ -44402,15 +42923,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getApplicationTypeInfoListByNameWithHttpOperationResponse(applicationTypeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, (err, result, request, response) => { + self._getApplicationTypeInfoListByName(applicationTypeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44421,19 +42942,50 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the manifest describing a service type. + * @summary Gets the list of application types in the Service Fabric cluster + * matching exactly the specified name. * - * Gets the manifest describing a service type. The response contains the - * service manifest XML as a string. + * 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 {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.applicationTypeVersion] The version of the + * application type. * - * @param {object} [options] Optional Parameters. + * @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 @@ -44450,7 +43002,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceTypeManifest} - The deserialized result object. + * @resolve {PagedApplicationTypeInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -44459,13 +43011,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 ServiceTypeManifest} for more information. + * 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. */ - getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, optionalCallback) { + getApplicationTypeInfoListByName(applicationTypeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44474,42 +43027,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, (err, result, request, response) => { + self._getApplicationTypeInfoListByName(applicationTypeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, optionalCallback); + return self._getApplicationTypeInfoListByName(applicationTypeName, 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 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. * - * 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. + * 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 {string} nodeName The name of the node. + * @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} 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} + * 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 {object} [options] Optional Parameters. + * @param {string} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic + * Discriminator * - * @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 timeout specifies the time duration that the @@ -44521,15 +43077,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + provisionApplicationTypeWithHttpOperationResponse(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44540,30 +43096,33 @@ 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 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. * - * 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. + * 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 {string} nodeName The name of the node. + * @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} 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} + * 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 {object} [options] Optional Parameters. + * @param {string} + * provisionApplicationTypeDescriptionBaseRequiredBodyParam.kind Polymorphic + * Discriminator * - * @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 timeout specifies the time duration that the @@ -44580,7 +43139,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. * @@ -44588,13 +43147,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) { + provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44603,47 +43162,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, optionalCallback); + return self._provisionApplicationType(provisionApplicationTypeDescriptionBaseRequiredBodyParam, options, optionalCallback); } } /** - * @summary Gets the information about a specified service type of the - * application deployed on a node in a Service Fabric cluster. + * @summary Removes or unregisters a Service Fabric application type from the + * 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. + * 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} 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 {object} unprovisionApplicationTypeDescriptionInfo The relative path + * for the application package in the image store specified during the prior + * copy operation. * - * @param {string} serviceTypeName Specifies the name of a Service Fabric - * service type. + * @param {string} + * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version + * of the application type as defined in the application manifest. * - * @param {object} [options] Optional Parameters. + * @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 {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 timeout specifies the time duration that the @@ -44655,15 +43211,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedServiceTypeInfoByNameWithHttpOperationResponse(nodeName, applicationId, serviceTypeName, options) { + unprovisionApplicationTypeWithHttpOperationResponse(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, (err, result, request, response) => { + self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44674,35 +43230,32 @@ 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 Removes or unregisters a Service Fabric application type from the + * 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. + * 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} 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 {object} unprovisionApplicationTypeDescriptionInfo The relative path + * for the application package in the image store specified during the prior + * copy operation. * - * @param {string} serviceTypeName Specifies the name of a Service Fabric - * service type. + * @param {string} + * unprovisionApplicationTypeDescriptionInfo.applicationTypeVersion The version + * of the application type as defined in the application manifest. * - * @param {object} [options] Optional Parameters. + * @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 {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 timeout specifies the time duration that the @@ -44719,7 +43272,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. * @@ -44727,13 +43280,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. */ - getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback) { + unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44742,64 +43295,28 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, (err, result, request, response) => { + self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback); + return self._unprovisionApplicationType(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, 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 + * @summary Gets the list containing the information about service types that + * are supported by a provisioned application type in a Service Fabric cluster. * - * @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. + * 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 {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} applicationTypeName The name of the application type. * - * @param {array} - * [applicationDescription.applicationCapacity.applicationMetrics] List of - * application capacity metric description. + * @param {string} applicationTypeVersion The version of the application type. * * @param {object} [options] Optional Parameters. * @@ -44813,15 +43330,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getServiceTypeInfoListWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createApplication(applicationDescription, options, (err, result, request, response) => { + self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44832,52 +43349,16 @@ 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 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 + * @summary Gets the list containing the information about service types that + * are supported by a provisioned application type in a Service Fabric cluster. * - * @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. + * 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 {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} applicationTypeName The name of the application type. * - * @param {array} - * [applicationDescription.applicationCapacity.applicationMetrics] List of - * application capacity metric description. + * @param {string} applicationTypeVersion The version of the application type. * * @param {object} [options] Optional Parameters. * @@ -44896,7 +43377,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. * @@ -44904,13 +43385,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) { + getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -44919,43 +43400,35 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createApplication(applicationDescription, options, (err, result, request, response) => { + self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createApplication(applicationDescription, options, optionalCallback); + return self._getServiceTypeInfoList(applicationTypeName, applicationTypeVersion, options, optionalCallback); } } /** - * @summary Deletes an existing Service Fabric application. + * @summary Gets the information about a specific service type that is + * supported by a provisioned application type in a Service Fabric cluster. * - * 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. + * 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 specified service type is not found in the + * 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. + * @param {string} applicationTypeName The name of the application type. * - * @param {object} [options] Optional Parameters. + * @param {string} applicationTypeVersion The version of the application type. * - * @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} 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 @@ -44967,15 +43440,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getServiceTypeInfoByNameWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, serviceTypeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteApplication(applicationId, options, (err, result, request, response) => { + self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -44986,31 +43459,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes an existing Service Fabric application. + * @summary Gets the information about a specific service type that is + * supported by a provisioned application type in a Service Fabric cluster. * - * 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. + * 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 specified service type is not found in the + * 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. + * @param {string} applicationTypeName The name of the application type. * - * @param {object} [options] Optional Parameters. + * @param {string} applicationTypeVersion The version of the application type. * - * @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} 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 @@ -45027,7 +43492,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceTypeInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45035,13 +43500,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 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. */ - deleteApplication(applicationId, options, optionalCallback) { + getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45050,34 +43516,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteApplication(applicationId, options, (err, result, request, response) => { + self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteApplication(applicationId, options, optionalCallback); + return self._getServiceTypeInfoByName(applicationTypeName, applicationTypeVersion, serviceTypeName, options, optionalCallback); } } /** - * @summary Gets load information about a Service Fabric application. + * @summary Gets the manifest describing a service type. * - * 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. + * Gets the manifest describing a service type. The response contains the + * service manifest XML as a string. * - * @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} 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. * @@ -45091,15 +43552,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationLoadInfoWithHttpOperationResponse(applicationId, options) { + getServiceManifestWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, serviceManifestName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationLoadInfo(applicationId, options, (err, result, request, response) => { + self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45110,22 +43571,17 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets load information about a Service Fabric application. + * @summary Gets the manifest describing a service type. * - * 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. + * Gets the manifest describing a service type. The response contains the + * service manifest XML as a string. * - * @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} 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. * @@ -45144,7 +43600,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationLoadInfo} - The deserialized result object. + * @resolve {ServiceTypeManifest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45153,13 +43609,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 ApplicationLoadInfo} for more information. + * 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. */ - getApplicationLoadInfo(applicationId, options, optionalCallback) { + getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45168,66 +43624,42 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationLoadInfo(applicationId, options, (err, result, request, response) => { + self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationLoadInfo(applicationId, options, optionalCallback); + return self._getServiceManifest(applicationTypeName, applicationTypeVersion, serviceManifestName, 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. + * @summary Gets the list containing the information about service types from + * the applications deployed on a node in a Service Fabric cluster. * - * @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. + * 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} [options.applicationTypeName] The application type name used - * to filter the applications to query for. This value should not contain the - * application type version. + * @param {string} nodeName The name of the node. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @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} [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] Optional Parameters. * - * @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 {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 @@ -45239,15 +43671,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedServiceTypeInfoListWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationInfoList(options, (err, result, request, response) => { + self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45258,54 +43690,30 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the list containing the information about service types from + * the applications deployed on a node in a Service Fabric cluster. * - * @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. + * 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} [options.applicationTypeName] The application type name used - * to filter the applications to query for. This value should not contain the - * application type version. + * @param {string} nodeName The name of the node. * - * @param {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @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} [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] Optional Parameters. * - * @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 {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 @@ -45322,7 +43730,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedApplicationInfoList} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45330,15 +43738,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 PagedApplicationInfoList} 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. */ - getApplicationInfoList(options, optionalCallback) { + getDeployedServiceTypeInfoList(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45347,24 +43753,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationInfoList(options, (err, result, request, response) => { + self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationInfoList(options, optionalCallback); + return self._getDeployedServiceTypeInfoList(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Gets information about a Service Fabric application. + * @summary Gets the information about a specified service type of the + * application deployed on a node in a Service Fabric cluster. * - * 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. + * 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. @@ -45374,10 +43785,15 @@ class ServiceFabricClient extends ServiceClient { * 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 {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @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 @@ -45389,15 +43805,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedServiceTypeInfoByNameWithHttpOperationResponse(nodeName, applicationId, serviceTypeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationInfo(applicationId, options, (err, result, request, response) => { + self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45408,12 +43824,17 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets information about a Service Fabric application. + * @summary Gets the information about a specified service type of the + * application deployed on a node in a Service Fabric cluster. * - * 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. + * 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. @@ -45423,10 +43844,15 @@ class ServiceFabricClient extends ServiceClient { * 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 {boolean} [options.excludeApplicationParameters] The flag that - * specifies whether application parameters will be excluded from the result. + * @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 @@ -45443,7 +43869,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationInfo} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -45451,14 +43877,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. + * {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. */ - getApplicationInfo(applicationId, options, optionalCallback) { + getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45467,110 +43892,66 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationInfo(applicationId, options, (err, result, request, response) => { + self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationInfo(applicationId, options, optionalCallback); + return self._getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, options, optionalCallback); } } /** - * @summary Gets the health of the service fabric application. + * @summary Creates a 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. + * 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 {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 {string} applicationDescription.typeName 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} applicationDescription.typeVersion The version of the + * application type as defined in the application manifest. * - * @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. + * @param {array} [applicationDescription.parameterList] List of application + * parameters with overridden values from their default values specified 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 {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} [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. + * @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. * - * - 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} [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 {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} + * [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 @@ -45582,15 +43963,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + createApplicationWithHttpOperationResponse(applicationDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationHealth(applicationId, options, (err, result, request, response) => { + self._createApplication(applicationDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45601,98 +43982,54 @@ 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 health store, it will return Error. + * @summary Creates a 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. + * Creates a Service Fabric application using the specified description. * - * @param {object} [options] Optional Parameters. + * @param {object} applicationDescription Description for creating an + * application. * - * @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 {string} applicationDescription.name The name of the application, + * including the 'fabric:' URI scheme. * - * - 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} applicationDescription.typeName The application type name as + * defined in the application manifest. * - * @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. + * @param {string} applicationDescription.typeVersion The version of the + * application type 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 {array} [applicationDescription.parameterList] List of application + * parameters with overridden values from their default values specified in the + * application manifest. * - * @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. + * @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 * - * - 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} [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 {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} [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 @@ -45709,7 +44046,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. * @@ -45717,14 +44054,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) { + createApplication(applicationDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -45733,25 +44069,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationHealth(applicationId, options, (err, result, request, response) => { + self._createApplication(applicationDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationHealth(applicationId, options, optionalCallback); + return self._createApplication(applicationDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric application using the specified - * policy. + * @summary Deletes an existing Service Fabric application. * - * 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. + * 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. @@ -45763,155 +44101,11 @@ class ServiceFabricClient extends ServiceClient { * * @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 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.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 @@ -45923,15 +44117,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + deleteApplicationWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationHealthUsingPolicy(applicationId, options, (err, result, request, response) => { + self._deleteApplication(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -45942,13 +44136,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric application using the specified - * policy. + * @summary Deletes an existing Service Fabric application. * - * 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. + * 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. @@ -45960,155 +44156,11 @@ class ServiceFabricClient extends ServiceClient { * * @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 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.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 @@ -46125,7 +44177,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. * @@ -46133,14 +44185,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. */ - getApplicationHealthUsingPolicy(applicationId, options, optionalCallback) { + deleteApplication(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46149,130 +44200,36 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationHealthUsingPolicy(applicationId, options, (err, result, request, response) => { + self._deleteApplication(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationHealthUsingPolicy(applicationId, options, optionalCallback); + return self._deleteApplication(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. + * @summary Gets load information about a Service Fabric application. * - * @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. + * 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 @@ -46284,15 +44241,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getApplicationLoadInfoWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { + self._getApplicationLoadInfo(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46303,19 +44260,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric application. + * @summary Gets load information about a 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. + * 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. @@ -46325,97 +44277,8 @@ class ServiceFabricClient extends ServiceClient { * 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 @@ -46431,7 +44294,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationLoadInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46439,13 +44302,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 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. */ - reportApplicationHealth(applicationId, healthInformation, options, optionalCallback) { + getApplicationLoadInfo(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46454,190 +44318,66 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { + self._getApplicationLoadInfo(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportApplicationHealth(applicationId, healthInformation, options, optionalCallback); + return self._getApplicationLoadInfo(applicationId, 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 + * @summary Gets the list of applications created in the Service Fabric cluster + * that match the specified filters. * - * 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. + * 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 {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.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 {number} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @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. * - * 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 {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. * - * @param {array} - * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * @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] Optional Parameters. + * @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 @@ -46649,15 +44389,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - startApplicationUpgradeWithHttpOperationResponse(applicationId, applicationUpgradeDescription, options) { + getApplicationInfoListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { + self._getApplicationInfoList(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46668,179 +44408,176 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Starts upgrading an application in the Service Fabric cluster. + * @summary Gets the list of applications created in the Service Fabric cluster + * that match the specified filters. * - * Validates the supplied application upgrade parameters and starts upgrading - * the application if the parameters are valid. + * 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 {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} applicationUpgradeDescription Parameters for an application - * upgrade. + * @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} applicationUpgradeDescription.name The name of the target - * application, including the 'fabric:' URI scheme. + * @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 {string} applicationUpgradeDescription.targetApplicationTypeVersion - * The target application type version (found in the application manifest) for - * the application upgrade. + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. * - * @param {array} applicationUpgradeDescription.parameters List of application - * parameters with overridden values from their default values specified in the - * application manifest. + * @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} applicationUpgradeDescription.upgradeKind The kind of - * upgrade out of the following possible values. Possible values include: - * 'Invalid', 'Rolling' + * @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 {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} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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} - * [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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {function} [optionalCallback] - The optional callback. * - * @param {object} [applicationUpgradeDescription.monitoringPolicy] Describes - * the parameters for monitoring an upgrade in Monitored mode. + * @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.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' + * {Promise} A promise is returned * - * @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. + * @resolve {PagedApplicationInfoList} - The deserialized result object. * - * @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. + * @reject {Error} - The error object. * - * @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. + * {function} optionalCallback(err, result, request, response) * - * @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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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. + * {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. * - * @param {object} [applicationUpgradeDescription.applicationHealthPolicy] - * Defines a health policy used to evaluate the health of an application or one - * of its children entities. + * 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 {boolean} - * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * @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} - * [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} [options] Optional Parameters. * - * @param {object} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * The health policy used by default to evaluate the health of a service type. + * @param {boolean} [options.excludeApplicationParameters] The flag that + * specifies whether application parameters will be excluded from the result. * - * @param {number} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * 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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} - * [applicationUpgradeDescription.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. * - * @param {number} - * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @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. * - * 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. + * 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 {array} - * [applicationUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * @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 @@ -46856,7 +44593,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46864,13 +44601,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 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. */ - startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, optionalCallback) { + getApplicationInfo(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46879,22 +44617,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { + self._getApplicationInfo(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, optionalCallback); + return self._getApplicationInfo(applicationId, options, optionalCallback); } } /** - * @summary Gets details for the latest upgrade performed on this application. + * @summary Gets the health of the service fabric application. * - * Returns information about the state of the latest application upgrade along - * with details to aid debugging application health issues. + * 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. @@ -46906,6 +44645,83 @@ class ServiceFabricClient extends ServiceClient { * * @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 @@ -46916,15 +44732,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getApplicationHealthWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationUpgrade(applicationId, options, (err, result, request, response) => { + self._getApplicationHealth(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -46935,10 +44751,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets details for the latest upgrade performed on this application. + * @summary Gets the health of the service fabric application. * - * Returns information about the state of the latest application upgrade along - * with details to aid debugging application health issues. + * 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. @@ -46950,6 +44767,83 @@ class ServiceFabricClient extends ServiceClient { * * @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 @@ -46965,7 +44859,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationUpgradeProgressInfo} - The deserialized result object. + * @resolve {ApplicationHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -46974,14 +44868,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 ApplicationUpgradeProgressInfo} for more - * information. + * 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. */ - getApplicationUpgrade(applicationId, options, optionalCallback) { + getApplicationHealth(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -46990,25 +44883,25 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationUpgrade(applicationId, options, (err, result, request, response) => { + self._getApplicationHealth(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationUpgrade(applicationId, options, optionalCallback); + return self._getApplicationHealth(applicationId, options, optionalCallback); } } /** - * @summary Updates an ongoing application upgrade in the Service Fabric - * cluster. + * @summary Gets the health of a Service Fabric application using the specified + * policy. * - * 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. + * 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. @@ -47018,27 +44911,96 @@ class ServiceFabricClient extends ServiceClient { * 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 {object} [options] Optional Parameters. * - * @param {string} applicationUpgradeUpdateDescription.name The name of the - * application, including the 'fabric:' URI scheme. + * @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 {string} applicationUpgradeUpdateDescription.upgradeKind The kind of - * upgrade out of the following possible values. Possible values include: - * 'Invalid', 'Rolling' + * - 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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a - * health policy used to evaluate the health of an application or one of its - * children entities. + * @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. * - * @param {boolean} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] + * - 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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * [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 @@ -47051,11 +45013,11 @@ class ServiceFabricClient extends ServiceClient { * Default percentage is zero. * * @param {object} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * The health policy used by default to evaluate the health of a service type. + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed * values are Byte values from zero to 100 * @@ -47069,7 +45031,7 @@ class ServiceFabricClient extends ServiceClient { * partitions. Default percentage is zero. * * @param {number} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed * values are Byte values from zero to 100. * @@ -47083,7 +45045,7 @@ class ServiceFabricClient extends ServiceClient { * replicas. Default percentage is zero. * * @param {number} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum allowed percentage of unhealthy services. Allowed values are * Byte values from zero to 100. * @@ -47097,83 +45059,9 @@ 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 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 {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 @@ -47185,15 +45073,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getApplicationHealthUsingPolicyWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, (err, result, request, response) => { + self._getApplicationHealthUsingPolicy(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -47204,13 +45092,13 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Updates an ongoing application upgrade in the Service Fabric - * cluster. + * @summary Gets the health of a Service Fabric application using the specified + * policy. * - * 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. + * 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. @@ -47220,27 +45108,96 @@ class ServiceFabricClient extends ServiceClient { * 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 {object} [options] Optional Parameters. * - * @param {string} applicationUpgradeUpdateDescription.name The name of the - * application, including the 'fabric:' URI scheme. + * @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 {string} applicationUpgradeUpdateDescription.upgradeKind The kind of - * upgrade out of the following possible values. Possible values include: - * 'Invalid', 'Rolling' + * - 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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a - * health policy used to evaluate the health of an application or one of its - * children entities. + * @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. * - * @param {boolean} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] + * - 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} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * [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 @@ -47253,11 +45210,11 @@ class ServiceFabricClient extends ServiceClient { * Default percentage is zero. * * @param {object} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * The health policy used by default to evaluate the health of a service type. + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * * @param {number} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed * values are Byte values from zero to 100 * @@ -47271,7 +45228,7 @@ class ServiceFabricClient extends ServiceClient { * partitions. Default percentage is zero. * * @param {number} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed * values are Byte values from zero to 100. * @@ -47285,7 +45242,7 @@ class ServiceFabricClient extends ServiceClient { * replicas. Default percentage is zero. * * @param {number} - * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum allowed percentage of unhealthy services. Allowed values are * Byte values from zero to 100. * @@ -47299,84 +45256,10 @@ 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] + * @param {array} [options.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 @@ -47392,7 +45275,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -47400,13 +45283,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 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. */ - updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, optionalCallback) { + getApplicationHealthUsingPolicy(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -47415,24 +45299,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, (err, result, request, response) => { + self._getApplicationHealthUsingPolicy(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, optionalCallback); + return self._getApplicationHealthUsingPolicy(applicationId, options, optionalCallback); } } /** - * @summary Resumes upgrading an application in the Service Fabric cluster. + * @summary Sends a health report on the Service Fabric application. * - * 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. + * 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. @@ -47442,14 +45333,97 @@ class ServiceFabricClient extends ServiceClient { * 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 {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} resumeApplicationUpgradeDescription.upgradeDomainName The - * name of the upgrade domain in which to resume the upgrade. + * @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, if the reporter has issues (e.g. 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 @@ -47464,11 +45438,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - resumeApplicationUpgradeWithHttpOperationResponse(applicationId, resumeApplicationUpgradeDescription, options) { + reportApplicationHealthWithHttpOperationResponse(applicationId, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, (err, result, request, response) => { + self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -47479,12 +45453,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resumes upgrading an application in the Service Fabric cluster. + * @summary Sends a health report on the Service Fabric application. * - * 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. + * 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. @@ -47494,131 +45475,97 @@ class ServiceFabricClient extends ServiceClient { * 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 {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} 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} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * - * @param {object} [options] Optional Parameters. + * @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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that the - * client is willing to wait for the requested operation to complete. The - * default value for this parameter is 60 seconds. + * Together with the SourceId, the property uniquely identifies the health + * information. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @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' * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * If not specified, time to live defaults to infinite value. * - * @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. + * @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. * - * 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} [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} 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} [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, if the reporter has issues (e.g. 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 @@ -47648,7 +45595,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - rollbackApplicationUpgrade(applicationId, options, optionalCallback) { + reportApplicationHealth(applicationId, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -47657,194 +45604,188 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._rollbackApplicationUpgrade(applicationId, options, (err, result, request, response) => { + self._reportApplicationHealth(applicationId, healthInformation, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._rollbackApplicationUpgrade(applicationId, options, optionalCallback); + return self._reportApplicationHealth(applicationId, healthInformation, 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. + * @summary Starts upgrading an application in the Service Fabric cluster. * - * @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. + * Validates the supplied application upgrade parameters and starts upgrading + * the application if the parameters are valid. * - * @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} 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.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} applicationUpgradeDescription Parameters for an application + * upgrade. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} applicationUpgradeDescription.name The name of the target + * application, including the 'fabric:' URI scheme. * - * @returns {Promise} A promise is returned + * @param {string} applicationUpgradeDescription.targetApplicationTypeVersion + * The target application type version (found in the application manifest) for + * the application upgrade. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} applicationUpgradeDescription.parameters List of application + * parameters with overridden values from their default values specified in the + * application manifest. * - * @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. + * @param {string} applicationUpgradeDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * 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} [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 {string} nodeName The name of the node. + * @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 {object} [options] Optional Parameters. + * @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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that the - * client is willing to wait for the requested operation to complete. The - * default value for this parameter is 60 seconds. + * @param {object} [applicationUpgradeDescription.monitoringPolicy] Describes + * the parameters for monitoring an upgrade in Monitored mode. * - * @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} + * [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} [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} + * [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 {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 {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 {object} [options.customHeaders] Headers that will be added to the - * request + * @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 {function} [optionalCallback] - The optional callback. + * @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. * - * @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.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. * - * {Promise} A promise is returned + * @param {object} [applicationUpgradeDescription.applicationHealthPolicy] + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. * - * @resolve {PagedDeployedApplicationInfoList} - The deserialized result object. + * @param {boolean} + * [applicationUpgradeDescription.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * @reject {Error} - The error object. + * @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. * - * {function} optionalCallback(err, result, request, response) + * @param {object} + * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {number} + * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] + * The maximum allowed percentage of unhealthy partitions per service. Allowed + * values are Byte values from zero to 100 * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PagedDeployedApplicationInfoList} for more - * information. + * 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. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {number} + * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. * - * {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. + * 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. * - * 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 {number} + * [applicationUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The 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 {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. * @@ -47853,28 +45794,20 @@ class ServiceFabricClient extends ServiceClient { * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeployedApplicationInfoWithHttpOperationResponse(nodeName, applicationId, options) { + startApplicationUpgradeWithHttpOperationResponse(applicationId, applicationUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedApplicationInfo(nodeName, applicationId, options, (err, result, request, response) => { + self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -47885,17 +45818,10 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Starts upgrading an application in the Service Fabric cluster. * - * @param {string} nodeName The name of the node. + * 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. @@ -47905,20 +45831,170 @@ class ServiceFabricClient extends ServiceClient { * application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in * previous versions. * - * @param {object} [options] Optional Parameters. + * @param {object} applicationUpgradeDescription Parameters for an application + * upgrade. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time 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.name The name of the target + * application, including the 'fabric:' URI scheme. * - * @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} 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 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 @@ -47930,7 +46006,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. * @@ -47938,15 +46014,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) { + startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -47955,28 +46029,22 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedApplicationInfo(nodeName, applicationId, options, (err, result, request, response) => { + self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedApplicationInfo(nodeName, applicationId, options, optionalCallback); + return self._startApplicationUpgrade(applicationId, applicationUpgradeDescription, 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. + * @summary Gets details for the latest upgrade performed on this application. * - * @param {string} nodeName The name of the node. + * 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. @@ -47988,60 +46056,6 @@ class ServiceFabricClient extends ServiceClient { * * @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 @@ -48052,15 +46066,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getApplicationUpgradeWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedApplicationHealth(nodeName, applicationId, options, (err, result, request, response) => { + self._getApplicationUpgrade(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -48071,16 +46085,10 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets details for the latest upgrade performed on this application. * - * @param {string} nodeName The name of the node. + * 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. @@ -48092,60 +46100,6 @@ class ServiceFabricClient extends ServiceClient { * * @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 @@ -48161,7 +46115,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedApplicationHealth} - The deserialized result object. + * @resolve {ApplicationUpgradeProgressInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -48170,14 +46124,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 DeployedApplicationHealth} for more + * 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. */ - getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback) { + getApplicationUpgrade(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -48186,33 +46140,25 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedApplicationHealth(nodeName, applicationId, options, (err, result, request, response) => { + self._getApplicationUpgrade(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback); + return self._getApplicationUpgrade(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. + * @summary Updates an ongoing application upgrade in the Service Fabric + * cluster. * - * @param {string} nodeName The name of the node. + * 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. @@ -48222,67 +46168,27 @@ class ServiceFabricClient extends ServiceClient { * 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 {object} applicationUpgradeUpdateDescription Parameters for updating + * an existing application upgrade. * - * @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. + * @param {string} applicationUpgradeUpdateDescription.name The name of the + * application, including the 'fabric:' URI scheme. * - * - 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} applicationUpgradeUpdateDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @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} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * @param {boolean} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * * @param {number} - * [options.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * [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 @@ -48295,11 +46201,11 @@ class ServiceFabricClient extends ServiceClient { * Default percentage is zero. * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health - * policy used by default to evaluate the health of a service type. + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed * values are Byte values from zero to 100 * @@ -48313,7 +46219,7 @@ class ServiceFabricClient extends ServiceClient { * partitions. Default percentage is zero. * * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] * The maximum allowed percentage of unhealthy replicas per partition. Allowed * values are Byte values from zero to 100. * @@ -48327,7 +46233,7 @@ class ServiceFabricClient extends ServiceClient { * replicas. Default percentage is zero. * * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] * The maximum allowed percentage of unhealthy services. Allowed values are * Byte values from zero to 100. * @@ -48341,15 +46247,83 @@ 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] + * @param {array} + * [applicationUpgradeUpdateDescription.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 {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 @@ -48361,15 +46335,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + updateApplicationUpgradeWithHttpOperationResponse(applicationId, applicationUpgradeUpdateDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, (err, result, request, response) => { + self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -48380,21 +46354,13 @@ 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. + * @summary Updates an ongoing application upgrade in the Service Fabric + * cluster. * - * @param {string} nodeName The name of the node. + * 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. @@ -48404,67 +46370,27 @@ class ServiceFabricClient extends ServiceClient { * 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 {object} applicationUpgradeUpdateDescription Parameters for updating + * an existing application upgrade. * - * @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. + * @param {string} applicationUpgradeUpdateDescription.name The name of the + * application, including the 'fabric:' URI scheme. * - * - 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} applicationUpgradeUpdateDescription.upgradeKind The kind of + * upgrade out of the following possible values. Possible values include: + * 'Invalid', 'Rolling' * - * @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} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. * - * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * @param {boolean} + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * * @param {number} - * [options.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * [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 @@ -48477,11 +46403,11 @@ class ServiceFabricClient extends ServiceClient { * Default percentage is zero. * * @param {object} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health - * policy used by default to evaluate the health of a service type. + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] + * [applicationUpgradeUpdateDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] * The maximum allowed percentage of unhealthy partitions per service. Allowed * values are Byte values from zero to 100 * @@ -48495,43 +46421,111 @@ class ServiceFabricClient extends ServiceClient { * partitions. Default percentage is zero. * * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * [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. + * 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 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 {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @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. * - * 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} + * [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 {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * @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 {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 {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the @@ -48548,7 +46542,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. * @@ -48556,15 +46550,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. */ - getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback) { + updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -48573,35 +46565,24 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, (err, result, request, response) => { + self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback); + return self._updateApplicationUpgrade(applicationId, applicationUpgradeUpdateDescription, 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. + * @summary Resumes upgrading an application in the Service Fabric cluster. * - * @param {string} nodeName The name of the node. + * 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. @@ -48611,97 +46592,14 @@ class ServiceFabricClient extends ServiceClient { * 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 {object} resumeApplicationUpgradeDescription Describes the parameters + * for resuming an application upgrade. * - * @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 {string} resumeApplicationUpgradeDescription.upgradeDomainName The + * name of the upgrade domain in which to resume the upgrade. * * @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 @@ -48716,11 +46614,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - reportDeployedApplicationHealthWithHttpOperationResponse(nodeName, applicationId, healthInformation, options) { + resumeApplicationUpgradeWithHttpOperationResponse(applicationId, resumeApplicationUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, (err, result, request, response) => { + self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -48731,23 +46629,12 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Resumes upgrading an application in the Service Fabric cluster. * - * @param {string} nodeName The name of the node. + * 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. @@ -48757,97 +46644,14 @@ class ServiceFabricClient extends ServiceClient { * 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 {object} resumeApplicationUpgradeDescription Describes the parameters + * for resuming an application upgrade. * - * @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 {string} resumeApplicationUpgradeDescription.upgradeDomainName The + * name of the upgrade domain in which to resume the upgrade. * * @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 @@ -48877,7 +46681,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, optionalCallback) { + resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -48886,25 +46690,34 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, (err, result, request, response) => { + self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, optionalCallback); + return self._resumeApplicationUpgrade(applicationId, resumeApplicationUpgradeDescription, options, optionalCallback); } } /** - * @summary Gets the manifest describing an application type. - * - * The response contains the application manifest XML as a string. + * @summary Starts rolling back the currently on-going upgrade of an + * application in the Service Fabric cluster. * - * @param {string} applicationTypeName The name of the application type. + * 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} applicationTypeVersion The version 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 {object} [options] Optional Parameters. * @@ -48918,15 +46731,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + rollbackApplicationUpgradeWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._rollbackApplicationUpgrade(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -48937,13 +46750,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the manifest describing an application type. - * - * The response contains the application manifest XML as a string. + * @summary Starts rolling back the currently on-going upgrade of an + * application in the Service Fabric cluster. * - * @param {string} applicationTypeName The name of the application type. + * 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} applicationTypeVersion The version 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 {object} [options] Optional Parameters. * @@ -48962,7 +46784,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. * @@ -48970,15 +46792,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) { + rollbackApplicationUpgrade(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -48987,36 +46807,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { + self._rollbackApplicationUpgrade(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, optionalCallback); + return self._rollbackApplicationUpgrade(applicationId, options, optionalCallback); } } /** - * @summary Gets the information about all services belonging to the - * application specified by the application ID. + * @summary Gets the list of applications deployed on a Service Fabric node. * - * Returns the information about all services belonging to the application - * specified by the application ID. + * 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} 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} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceTypeName] The service type name used to - * filter the services to query for. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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 @@ -49026,25 +46854,28 @@ class ServiceFabricClient extends ServiceClient { * 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 {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. */ - getServiceInfoListWithHttpOperationResponse(applicationId, options) { + getDeployedApplicationInfoListWithHttpOperationResponse(nodeName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceInfoList(applicationId, options, (err, result, request, response) => { + self._getDeployedApplicationInfoList(nodeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -49055,24 +46886,32 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about all services belonging to the - * application specified by the application ID. + * @summary Gets the list of applications deployed on a Service Fabric node. * - * Returns the information about all services belonging to the application - * specified by the application ID. + * 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} 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} nodeName The name of the node. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.serviceTypeName] The service type name used to - * filter the services to query for. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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 @@ -49082,10 +46921,13 @@ class ServiceFabricClient extends ServiceClient { * 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 {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 @@ -49097,7 +46939,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedServiceInfoList} - The deserialized result object. + * @resolve {PagedDeployedApplicationInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -49106,13 +46948,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 PagedServiceInfoList} for more information. + * 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. */ - getServiceInfoList(applicationId, options, optionalCallback) { + getDeployedApplicationInfoList(nodeName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -49121,23 +46964,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceInfoList(applicationId, options, (err, result, request, response) => { + self._getDeployedApplicationInfoList(nodeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceInfoList(applicationId, options, optionalCallback); + return self._getDeployedApplicationInfoList(nodeName, options, optionalCallback); } } /** - * @summary Gets the information about the specific service belonging to the - * Service Fabric application. + * @summary Gets the information about an application deployed on a Service + * Fabric node. * - * Returns the information about the specified service belonging to the - * specified Service Fabric application. + * 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. @@ -49147,14 +46996,6 @@ class ServiceFabricClient extends ServiceClient { * 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 @@ -49162,20 +47003,28 @@ class ServiceFabricClient extends ServiceClient { * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceInfoWithHttpOperationResponse(applicationId, serviceId, options) { + getDeployedApplicationInfoWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceInfo(applicationId, serviceId, options, (err, result, request, response) => { + self._getDeployedApplicationInfo(nodeName, applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -49186,11 +47035,17 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about the specific service belonging to the - * Service Fabric application. + * @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. * - * Returns the information about the specified service belonging to the - * specified Service Fabric 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. @@ -49200,14 +47055,6 @@ class ServiceFabricClient extends ServiceClient { * 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 @@ -49215,6 +47062,14 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -49225,7 +47080,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceInfo} - The deserialized result object. + * @resolve {DeployedApplicationInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -49234,13 +47089,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 ServiceInfo} for more information. + * 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. */ - getServiceInfo(applicationId, serviceId, options, optionalCallback) { + getDeployedApplicationInfo(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -49249,34 +47105,93 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceInfo(applicationId, serviceId, options, (err, result, request, response) => { + self._getDeployedApplicationInfo(nodeName, applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceInfo(applicationId, serviceId, options, optionalCallback); + return self._getDeployedApplicationInfo(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Gets the name of the Service Fabric application for a service. + * @summary Gets the information about health of an application deployed on a + * Service Fabric node. * - * 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. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -49287,15 +47202,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedApplicationHealthWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationNameInfo(serviceId, options, (err, result, request, response) => { + self._getDeployedApplicationHealth(nodeName, applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -49306,22 +47221,81 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the name of the Service Fabric application for a service. + * @summary Gets the information about health of an application deployed on a + * Service Fabric node. * - * 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. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -49337,7 +47311,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationNameInfo} - The deserialized result object. + * @resolve {DeployedApplicationHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -49346,13 +47320,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 ApplicationNameInfo} for more information. + * 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. */ - getApplicationNameInfo(serviceId, options, optionalCallback) { + getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -49361,25 +47336,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationNameInfo(serviceId, options, (err, result, request, response) => { + self._getDeployedApplicationHealth(nodeName, applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationNameInfo(serviceId, options, optionalCallback); + return self._getDeployedApplicationHealth(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Creates the specified Service Fabric service. + * @summary Gets the information about health of an application deployed on a + * Service Fabric node. using the specified policy. * - * 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. + * 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. @@ -49389,63 +47372,134 @@ class ServiceFabricClient extends ServiceClient { * 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] The name of the - * application, including the 'fabric:' URI scheme. + * @param {object} [options] Optional Parameters. * - * @param {string} serviceDescription.serviceName The full name of the service - * with 'fabric:' URI scheme. + * @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 {string} serviceDescription.serviceTypeName Name of the service type - * as specified in the service 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 {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 {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. * - * @param {object} serviceDescription.partitionDescription The partition - * description as an 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. * - * @param {string} serviceDescription.partitionDescription.partitionScheme - * Polymorphic Discriminator + * @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} [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 {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * @param {array} [serviceDescription.correlationScheme] The correlation - * scheme. + * @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 {array} [serviceDescription.serviceLoadMetrics] The service load - * metrics. + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * - * @param {array} [serviceDescription.servicePlacementPolicies] The service - * placement policies. + * @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} [serviceDescription.defaultMoveCost] The move cost for the - * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * 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} [serviceDescription.isDefaultMoveCostSpecified] Indicates - * if the DefaultMoveCost property is specified. + * @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} [serviceDescription.servicePackageActivationMode] The - * activation mode of service package to be used for a service. Possible values - * include: 'SharedProcess', 'ExclusiveProcess' + * 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} [serviceDescription.serviceDnsName] The DNS name of the - * service. It requires the DNS system service to be enabled in Service Fabric - * cluster. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum allowed percentage of unhealthy services. Allowed values are + * Byte values from zero to 100. * - * @param {array} [serviceDescription.scalingPolicies] Scaling policies for - * this 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. * - * @param {string} serviceDescription.serviceKind Polymorphic Discriminator + * @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 timeout specifies the time duration that the @@ -49457,15 +47511,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createServiceWithHttpOperationResponse(applicationId, serviceDescription, options) { + getDeployedApplicationHealthUsingPolicyWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createService(applicationId, serviceDescription, options, (err, result, request, response) => { + self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -49476,13 +47530,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates the specified Service Fabric service. + * @summary Gets the information about health of an application deployed on a + * Service Fabric node. using the specified policy. * - * 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. + * 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. @@ -49492,63 +47554,134 @@ class ServiceFabricClient extends ServiceClient { * 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] The name of the - * application, including the 'fabric:' URI scheme. + * @param {object} [options] Optional Parameters. * - * @param {string} serviceDescription.serviceName The full name of the service - * with 'fabric:' URI scheme. + * @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 {string} serviceDescription.serviceTypeName Name of the service type - * as specified in the service 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 {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 {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. * - * @param {object} serviceDescription.partitionDescription The partition - * description as an 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. * - * @param {string} serviceDescription.partitionDescription.partitionScheme - * Polymorphic Discriminator + * @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} [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 {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * @param {array} [serviceDescription.correlationScheme] The correlation - * scheme. + * @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 {array} [serviceDescription.serviceLoadMetrics] The service load - * metrics. + * @param {object} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * - * @param {array} [serviceDescription.servicePlacementPolicies] The service - * placement policies. + * @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} [serviceDescription.defaultMoveCost] The move cost for the - * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * 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} [serviceDescription.isDefaultMoveCostSpecified] Indicates - * if the DefaultMoveCost property is specified. + * @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} [serviceDescription.servicePackageActivationMode] The - * activation mode of service package to be used for a service. Possible values - * include: 'SharedProcess', 'ExclusiveProcess' + * 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} [serviceDescription.serviceDnsName] The DNS name of the - * service. It requires the DNS system service to be enabled in Service Fabric - * cluster. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum allowed percentage of unhealthy services. Allowed values are + * Byte values from zero to 100. * - * @param {array} [serviceDescription.scalingPolicies] Scaling policies for - * this 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. * - * @param {string} serviceDescription.serviceKind Polymorphic Discriminator + * @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 timeout specifies the time duration that the @@ -49565,7 +47698,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {DeployedApplicationHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -49573,13 +47706,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 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. */ - createService(applicationId, serviceDescription, options, optionalCallback) { + getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -49588,25 +47723,35 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createService(applicationId, serviceDescription, options, (err, result, request, response) => { + self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createService(applicationId, serviceDescription, options, optionalCallback); + return self._getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Creates a Service Fabric service from the service template. + * @summary Sends a health report on the Service Fabric application deployed on + * a Service Fabric node. * - * 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. + * 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. @@ -49616,32 +47761,97 @@ class ServiceFabricClient extends ServiceClient { * 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 {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} serviceFromTemplateDescription.applicationName The name of - * the application, including the 'fabric:' URI scheme. + * @param {string} healthInformation.sourceId The source name that identifies + * the client/watchdog/system component that generated the health information. * - * @param {string} serviceFromTemplateDescription.serviceName The full name of - * the service with 'fabric:' URI scheme. + * @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 {string} serviceFromTemplateDescription.serviceTypeName Name of the - * service type as specified in the service manifest. + * Together with the SourceId, the property uniquely identifies the health + * information. * - * @param {array} [serviceFromTemplateDescription.initializationData] The - * initialization data for the newly created service instance. + * @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 {string} - * [serviceFromTemplateDescription.servicePackageActivationMode] The activation - * mode of service package to be used for a service. Possible values include: - * 'SharedProcess', 'ExclusiveProcess' + * @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. * - * @param {string} [serviceFromTemplateDescription.serviceDnsName] The DNS name - * of the service. It requires the DNS system service to be enabled in Service - * Fabric cluster. + * 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, if the reporter has issues (e.g. 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 @@ -49656,11 +47866,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - createServiceFromTemplateWithHttpOperationResponse(applicationId, serviceFromTemplateDescription, options) { + reportDeployedApplicationHealthWithHttpOperationResponse(nodeName, applicationId, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, (err, result, request, response) => { + self._reportDeployedApplicationHealth(nodeName, applicationId, healthInformation, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -49671,13 +47881,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates a Service Fabric service from the service template. + * @summary Sends a health report on the Service Fabric application deployed on + * a Service Fabric node. * - * 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. + * 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. @@ -49687,160 +47907,96 @@ class ServiceFabricClient extends ServiceClient { * 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.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that the - * client is willing to wait for the requested 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} 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 that identifies + * the client/watchdog/system component that generated the health information. * - * @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} 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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that the - * client is willing to wait for the requested operation to complete. The - * default value for this parameter is 60 seconds. + * Together with the SourceId, the property uniquely identifies the health + * information. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @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' * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * If not specified, time to live defaults to infinite value. * - * @reject {Error} - The error object. - */ - deleteServiceWithHttpOperationResponse(serviceId, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._deleteService(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 Deletes an existing Service Fabric service. + * @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. * - * 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} [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 {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, if the reporter has issues (e.g. 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.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 {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 @@ -49865,115 +48021,40 @@ 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} [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. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {array} [serviceUpdateDescription.servicePlacementPolicies] The - * service placement policies. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [serviceUpdateDescription.defaultMoveCost] The move cost for - * the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * {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. * - * @param {array} [serviceUpdateDescription.scalingPolicies] Scaling policies - * for this service. + * The response contains the application manifest XML as a string. * - * @param {string} serviceUpdateDescription.serviceKind Polymorphic - * Discriminator + * @param {string} applicationTypeName The name of the application type. + * + * @param {string} applicationTypeVersion The version of the application type. * * @param {object} [options] Optional Parameters. * @@ -49987,15 +48068,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getApplicationManifestWithHttpOperationResponse(applicationTypeName, applicationTypeVersion, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateService(serviceId, serviceUpdateDescription, options, (err, result, request, response) => { + self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -50006,88 +48087,13 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the manifest describing an application type. * - * @param {string} [serviceUpdateDescription.defaultMoveCost] The move cost for - * the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * The response contains the application manifest XML as a string. * - * @param {array} [serviceUpdateDescription.scalingPolicies] Scaling policies - * for this service. + * @param {string} applicationTypeName The name of the application type. * - * @param {string} serviceUpdateDescription.serviceKind Polymorphic - * Discriminator + * @param {string} applicationTypeVersion The version of the application type. * * @param {object} [options] Optional Parameters. * @@ -50106,7 +48112,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationTypeManifest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -50114,13 +48120,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 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. */ - updateService(serviceId, serviceUpdateDescription, options, optionalCallback) { + getApplicationManifest(applicationTypeName, applicationTypeVersion, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -50129,33 +48137,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateService(serviceId, serviceUpdateDescription, options, (err, result, request, response) => { + self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateService(serviceId, serviceUpdateDescription, options, optionalCallback); + return self._getApplicationManifest(applicationTypeName, applicationTypeVersion, options, optionalCallback); } } /** - * @summary Gets the description of an existing Service Fabric service. + * @summary Gets the information about all services belonging to the + * application specified by the application ID. * - * Gets the description of an existing Service Fabric service. A service must - * be created before its description can be obtained. + * Returns the information about all services belonging to the application + * specified by the application ID. * - * @param {string} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -50166,15 +48186,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getServiceInfoListWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceDescription(serviceId, options, (err, result, request, response) => { + self._getServiceInfoList(applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -50185,21 +48205,33 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the description of an existing Service Fabric service. + * @summary Gets the information about all services belonging to the + * application specified by the application ID. * - * Gets the description of an existing Service Fabric service. A service must - * be created before its description can be obtained. + * Returns the information about all services belonging to the application + * specified by the application ID. * - * @param {string} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -50215,7 +48247,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceDescription} - The deserialized result object. + * @resolve {PagedServiceInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -50224,13 +48256,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 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. */ - getServiceDescription(serviceId, options, optionalCallback) { + getServiceInfoList(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -50239,27 +48271,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceDescription(serviceId, options, (err, result, request, response) => { + self._getServiceInfoList(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceDescription(serviceId, options, optionalCallback); + return self._getServiceInfoList(applicationId, options, optionalCallback); } } /** - * @summary Gets the health of the specified Service Fabric service. + * @summary Gets the information about the specific service belonging to the + * Service Fabric application. * - * 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. + * 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. @@ -50271,59 +48307,6 @@ class ServiceFabricClient extends ServiceClient { * * @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 timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -50334,15 +48317,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getServiceInfoWithHttpOperationResponse(applicationId, serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceHealth(serviceId, options, (err, result, request, response) => { + self._getServiceInfo(applicationId, serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -50353,15 +48336,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric service. + * @summary Gets the information about the specific service belonging to the + * Service Fabric application. * - * 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. + * 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. @@ -50373,59 +48360,6 @@ class ServiceFabricClient extends ServiceClient { * * @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 timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -50441,7 +48375,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceHealth} - The deserialized result object. + * @resolve {ServiceInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -50450,184 +48384,48 @@ 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. + * 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. */ - getServiceHealth(serviceId, options, optionalCallback) { + 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._getServiceHealth(serviceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getServiceHealth(serviceId, 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 - * 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 {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 allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + 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. * - * 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. + * 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 {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * @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} [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 {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the @@ -50639,15 +48437,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getApplicationNameInfoWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceHealthUsingPolicy(serviceId, options, (err, result, request, response) => { + self._getApplicationNameInfo(serviceId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -50658,21 +48456,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric service, by using - * the specified health policy. + * @summary Gets the name of the Service Fabric application for a service. * - * 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. + * 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. @@ -50684,132 +48472,6 @@ class ServiceFabricClient extends ServiceClient { * * @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 {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 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 @@ -50825,7 +48487,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceHealth} - The deserialized result object. + * @resolve {ApplicationNameInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -50834,13 +48496,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. + * 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. */ - getServiceHealthUsingPolicy(serviceId, options, optionalCallback) { + getApplicationNameInfo(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -50849,131 +48511,91 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceHealthUsingPolicy(serviceId, options, (err, result, request, response) => { + self._getApplicationNameInfo(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceHealthUsingPolicy(serviceId, options, optionalCallback); + return self._getApplicationNameInfo(serviceId, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric service. + * @summary Creates the specified 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. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 {object} serviceDescription The information necessary to create a + * service. * - * @param {string} healthInformation.sourceId The source name that identifies - * the client/watchdog/system component that generated the health information. + * @param {string} [serviceDescription.applicationName] The name of the + * application, including the 'fabric:' URI scheme. * - * @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 {string} serviceDescription.serviceName The full name of the service + * with 'fabric:' URI scheme. * - * Together with the SourceId, the property uniquely identifies the health - * information. + * @param {string} serviceDescription.serviceTypeName Name of the service type + * as specified in the service manifest. * - * @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 {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 {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. + * @param {object} serviceDescription.partitionDescription The partition + * description as an object. * - * If not specified, time to live defaults to infinite value. + * @param {string} serviceDescription.partitionDescription.partitionScheme + * Polymorphic Discriminator * - * @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} [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 {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 {array} [serviceDescription.correlationScheme] The correlation + * scheme. * - * @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 {array} [serviceDescription.serviceLoadMetrics] The service load + * metrics. * - * @param {object} [options] Optional Parameters. + * @param {array} [serviceDescription.servicePlacementPolicies] The service + * placement policies. * - * @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 {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 timeout specifies the time duration that the @@ -50989,11 +48611,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - reportServiceHealthWithHttpOperationResponse(serviceId, healthInformation, options) { + createServiceWithHttpOperationResponse(applicationId, serviceDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportServiceHealth(serviceId, healthInformation, 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); } @@ -51004,119 +48626,79 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric service. + * @summary Creates the specified 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. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 {object} serviceDescription The information necessary to create a + * service. * - * @param {string} healthInformation.sourceId The source name that identifies - * the client/watchdog/system component that generated the health information. + * @param {string} [serviceDescription.applicationName] The name of the + * application, including the 'fabric:' URI scheme. * - * @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 {string} serviceDescription.serviceName The full name of the service + * with 'fabric:' URI scheme. * - * Together with the SourceId, the property uniquely identifies the health - * information. + * @param {string} serviceDescription.serviceTypeName Name of the service type + * as specified in the service manifest. * - * @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 {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 {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. + * @param {object} serviceDescription.partitionDescription The partition + * description as an object. * - * If not specified, time to live defaults to infinite value. + * @param {string} serviceDescription.partitionDescription.partitionScheme + * Polymorphic Discriminator * - * @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} [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 {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 {array} [serviceDescription.correlationScheme] The correlation + * scheme. * - * @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 {array} [serviceDescription.serviceLoadMetrics] The service load + * metrics. * - * @param {object} [options] Optional Parameters. + * @param {array} [serviceDescription.servicePlacementPolicies] The service + * placement policies. * - * @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 {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 timeout specifies the time duration that the @@ -51147,7 +48729,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - reportServiceHealth(serviceId, healthInformation, options, optionalCallback) { + createService(applicationId, serviceDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -51156,52 +48738,59 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportServiceHealth(serviceId, healthInformation, 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._reportServiceHealth(serviceId, healthInformation, options, optionalCallback); + return self._createService(applicationId, serviceDescription, options, optionalCallback); } } /** - * @summary Resolve a Service Fabric partition. + * @summary Creates a Service Fabric service from the service template. * - * Resolve a Service Fabric service partition to get the endpoints of the - * service replicas. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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} serviceFromTemplateDescription Describes the service that + * needs to be created from the template defined in the application manifest. * - * @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} serviceFromTemplateDescription.applicationName The name of + * the application, including the 'fabric:' URI scheme. * - * @param {string} [options.partitionKeyValue] Partition key. This is required - * if the partition scheme for the service is Int64Range or Named. + * @param {string} serviceFromTemplateDescription.serviceName The full name of + * the service with 'fabric:' URI scheme. * - * @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 {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.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the @@ -51213,15 +48802,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + createServiceFromTemplateWithHttpOperationResponse(applicationId, serviceFromTemplateDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resolveService(serviceId, options, (err, result, request, response) => { + self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -51232,40 +48821,47 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resolve a Service Fabric partition. + * @summary Creates a Service Fabric service from the service template. * - * Resolve a Service Fabric service partition to get the endpoints of the - * service replicas. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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} serviceFromTemplateDescription Describes the service that + * needs to be created from the template defined in the application manifest. * - * @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} serviceFromTemplateDescription.applicationName The name of + * the application, including the 'fabric:' URI scheme. * - * @param {string} [options.partitionKeyValue] Partition key. This is required - * if the partition scheme for the service is Int64Range or Named. + * @param {string} serviceFromTemplateDescription.serviceName The full name of + * the service with 'fabric:' URI scheme. * - * @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 {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.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the @@ -51282,7 +48878,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ResolvedServicePartition} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -51290,15 +48886,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 ResolvedServicePartition} 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. */ - resolveService(serviceId, options, optionalCallback) { + createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -51307,23 +48901,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resolveService(serviceId, options, (err, result, request, response) => { + self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resolveService(serviceId, options, optionalCallback); + return self._createServiceFromTemplate(applicationId, serviceFromTemplateDescription, options, optionalCallback); } } /** - * @summary Gets the list of partitions of a Service Fabric service. + * @summary Deletes an existing Service Fabric service. * - * The response includes the partition ID, partitioning scheme information, - * keys supported by the partition, status, health, and other details about the - * partition. + * 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. @@ -51335,13 +48932,11 @@ 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 {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 @@ -51353,15 +48948,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + deleteServiceWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionInfoList(serviceId, 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); } @@ -51372,11 +48967,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of partitions of a Service Fabric service. + * @summary Deletes an existing Service Fabric service. * - * The response includes the partition ID, partitioning scheme information, - * keys supported by the partition, status, health, and other details about the - * partition. + * 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. @@ -51388,13 +48986,11 @@ 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 {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 @@ -51411,7 +49007,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. * @@ -51419,15 +49015,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) { + deleteService(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -51436,25 +49030,100 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionInfoList(serviceId, options, (err, result, request, response) => { + self._deleteService(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionInfoList(serviceId, options, optionalCallback); + return self._deleteService(serviceId, options, optionalCallback); } } /** - * @summary Gets the information about a Service Fabric partition. + * @summary Updates a Service Fabric service using the specified update + * description. * - * 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. + * 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 {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} 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. * @@ -51468,15 +49137,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + updateServiceWithHttpOperationResponse(serviceId, serviceUpdateDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionInfo(partitionId, options, (err, result, request, response) => { + self._updateService(serviceId, serviceUpdateDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -51487,13 +49156,88 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about a Service Fabric partition. + * @summary Updates a Service Fabric service using the specified update + * description. * - * 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. + * 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 {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} 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. * @@ -51512,7 +49256,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServicePartitionInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -51520,14 +49264,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 ServicePartitionInfo} 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. */ - getPartitionInfo(partitionId, options, optionalCallback) { + updateService(serviceId, serviceUpdateDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -51536,24 +49279,30 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionInfo(partitionId, 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._getPartitionInfo(partitionId, options, optionalCallback); + return self._updateService(serviceId, serviceUpdateDescription, options, optionalCallback); } } /** - * @summary Gets the name of the Service Fabric service for a partition. + * @summary Gets the description of an existing Service Fabric service. * - * Gets name of the service for the specified partition. A 404 error is - * returned if the partition ID does not exist in the cluster. + * Gets the description of an existing Service Fabric service. A service must + * be created before its description can be obtained. * - * @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. * @@ -51567,15 +49316,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getServiceDescriptionWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceNameInfo(partitionId, 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); } @@ -51586,12 +49335,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the name of the Service Fabric service for a partition. + * @summary Gets the description of an existing Service Fabric service. * - * Gets name of the service for the specified partition. A 404 error is - * returned if the partition ID does not exist in the cluster. + * Gets the description of an existing Service Fabric service. A service must + * be created before its description can be obtained. * - * @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. * @@ -51610,7 +49365,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceNameInfo} - The deserialized result object. + * @resolve {ServiceDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -51619,13 +49374,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. + * 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. */ - getServiceNameInfo(partitionId, options, optionalCallback) { + getServiceDescription(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -51634,28 +49389,35 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceNameInfo(partitionId, options, (err, result, request, response) => { + self._getServiceDescription(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceNameInfo(partitionId, options, optionalCallback); + return self._getServiceDescription(serviceId, options, optionalCallback); } } /** - * @summary Gets the health of the specified Service Fabric partition. + * @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 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 + * 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 {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. * @@ -51682,17 +49444,18 @@ 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 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 {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 @@ -51721,15 +49484,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getServiceHealthWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionHealth(partitionId, 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); } @@ -51740,16 +49503,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric partition. + * @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 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 + * 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 {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. * @@ -51768,25 +49538,26 @@ class ServiceFabricClient extends ServiceClient { * - 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. + * - 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 @@ -51820,7 +49591,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionHealth} - The deserialized result object. + * @resolve {ServiceHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -51829,13 +49600,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. + * 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. */ - getPartitionHealth(partitionId, options, optionalCallback) { + getServiceHealth(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -51844,36 +49615,41 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionHealth(partitionId, options, (err, result, request, response) => { + self._getServiceHealth(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionHealth(partitionId, options, optionalCallback); + return self._getServiceHealth(serviceId, options, optionalCallback); } } /** - * @summary Gets the health of the specified Service Fabric partition, by using + * @summary Gets the health of the specified Service Fabric service, by using * the specified health policy. * - * Gets the health information of the specified partition. + * 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 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 + * 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 {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. * @@ -51900,17 +49676,18 @@ 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 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 {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 @@ -52012,15 +49789,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getServiceHealthUsingPolicyWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionHealthUsingPolicy(partitionId, 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); } @@ -52031,24 +49808,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of the specified Service Fabric partition, by using + * @summary Gets the health of the specified Service Fabric service, by using * the specified health policy. * - * Gets the health information of the specified partition. + * 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 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 + * 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 {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. * @@ -52075,17 +49857,18 @@ 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 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 {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 @@ -52192,7 +49975,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionHealth} - The deserialized result object. + * @resolve {ServiceHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -52201,13 +49984,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. + * 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. */ - getPartitionHealthUsingPolicy(partitionId, options, optionalCallback) { + getServiceHealthUsingPolicy(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -52216,34 +49999,183 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionHealthUsingPolicy(partitionId, options, (err, result, request, response) => { + self._getServiceHealthUsingPolicy(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionHealthUsingPolicy(partitionId, options, optionalCallback); + return self._getServiceHealthUsingPolicy(serviceId, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric partition. + * @summary Sends a health report on the Service Fabric service. * - * Reports health state of the specified Service Fabric partition. The report + * 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 Partition, which forwards to + * 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 - * GetPartitionHealth and check that the report appears in the HealthEvents + * GetServiceHealth and check that the report appears in the HealthEvents * section. * - * @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} 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, if the reporter has issues (e.g. 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. + */ + reportServiceHealthWithHttpOperationResponse(serviceId, healthInformation, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._reportServiceHealth(serviceId, 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 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 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 @@ -52311,30 +50243,265 @@ class ServiceFabricClient extends ServiceClient { * 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 + * This way, if the reporter has issues (e.g. 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 {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. + */ + reportServiceHealth(serviceId, 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._reportServiceHealth(serviceId, healthInformation, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reportServiceHealth(serviceId, healthInformation, options, optionalCallback); + } + } + + /** + * @summary Resolve a Service Fabric partition. + * + * 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 {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. + * This is not the partition ID, but rather, either the integer key value, or + * the name of the partition ID. + * For example, if your service is using ranged partitions from 0 to 10, then + * they PartitionKeyValue would be an + * integer in that range. Query service description to see the range or name. + * + * @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 timeout specifies the time duration that the + * client is willing to wait for the requested 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. + */ + resolveServiceWithHttpOperationResponse(serviceId, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._resolveService(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 Resolve a Service Fabric partition. + * + * 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 {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. + * This is not the partition ID, but rather, either the integer key value, or + * the name of the partition ID. + * For example, if your service is using ranged partitions from 0 to 10, then + * they PartitionKeyValue would be an + * integer in that range. Query service description to see the range or name. + * + * @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 timeout specifies the time duration that the + * client is willing to wait for the requested 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 {ResolvedServicePartition} - 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 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. + */ + resolveService(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._resolveService(serviceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resolveService(serviceId, options, optionalCallback); + } + } + + /** + * @summary Gets the list of partitions of a Service Fabric service. + * + * 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.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 @@ -52346,15 +50513,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getPartitionInfoListWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportPartitionHealth(partitionId, healthInformation, 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); } @@ -52365,113 +50532,29 @@ 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 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. + * @summary Gets the list of partitions of a Service Fabric service. * - * @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. + * The response includes the partition ID, partitioning scheme information, + * keys supported by the partition, status, health, and other details about 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 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 {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 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 {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 @@ -52488,7 +50571,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PagedServicePartitionInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -52496,13 +50579,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 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. */ - reportPartitionHealth(partitionId, healthInformation, options, optionalCallback) { + getPartitionInfoList(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -52511,25 +50596,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportPartitionHealth(partitionId, healthInformation, options, (err, result, request, response) => { + self._getPartitionInfoList(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._reportPartitionHealth(partitionId, healthInformation, options, optionalCallback); + return self._getPartitionInfoList(serviceId, options, optionalCallback); } } /** - * @summary Gets the load information of the specified Service Fabric - * partition. + * @summary Gets the information about a 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. + * 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. * @@ -52545,15 +50628,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getPartitionInfoWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionLoadInformation(partitionId, 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); } @@ -52564,13 +50647,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the load information of the specified Service Fabric - * partition. + * @summary Gets the information about a 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. + * 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. * @@ -52591,7 +50672,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionLoadInformation} - The deserialized result object. + * @resolve {ServicePartitionInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -52600,14 +50681,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. + * 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. */ - getPartitionLoadInformation(partitionId, options, optionalCallback) { + getPartitionInfo(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -52616,22 +50696,22 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionLoadInformation(partitionId, options, (err, result, request, response) => { + self._getPartitionInfo(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionLoadInformation(partitionId, options, optionalCallback); + return self._getPartitionInfo(partitionId, options, optionalCallback); } } /** - * @summary Resets the current load of a Service Fabric partition. + * @summary Gets the name of the Service Fabric service for a partition. * - * Resets the current load of a Service Fabric partition to the default load - * for the service. + * 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. * @@ -52647,15 +50727,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resetPartitionLoadWithHttpOperationResponse(partitionId, options) { + getServiceNameInfoWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resetPartitionLoad(partitionId, 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); } @@ -52666,10 +50746,10 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resets the current load of a Service Fabric partition. + * @summary Gets the name of the Service Fabric service for a partition. * - * Resets the current load of a Service Fabric partition to the default load - * for the service. + * 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. * @@ -52690,7 +50770,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceNameInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -52698,13 +50778,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 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. */ - resetPartitionLoad(partitionId, options, optionalCallback) { + getServiceNameInfo(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -52713,29 +50794,83 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resetPartitionLoad(partitionId, options, (err, result, request, response) => { + self._getServiceNameInfo(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resetPartitionLoad(partitionId, options, optionalCallback); + return self._getServiceNameInfo(partitionId, options, optionalCallback); } } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover a specific partition that is currently stuck in quorum loss. + * @summary Gets the health of the specified Service Fabric partition. * - * 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. + * 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 @@ -52746,15 +50881,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - recoverPartitionWithHttpOperationResponse(partitionId, options) { + getPartitionHealthWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverPartition(partitionId, options, (err, result, request, response) => { + self._getPartitionHealth(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -52765,17 +50900,71 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover a specific partition that is currently stuck in quorum loss. + * @summary Gets the health of the specified Service Fabric partition. * - * 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. + * 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 @@ -52791,7 +50980,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. * @@ -52799,51 +50988,179 @@ 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. + */ + 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. - */ - recoverPartition(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._recoverPartition(partitionId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._recoverPartition(partitionId, options, optionalCallback); - } - } - - /** - * @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} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum allowed percentage of unhealthy services. Allowed values are + * Byte 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. + * 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} 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 {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 timeout specifies the time duration that the @@ -52855,15 +51172,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getPartitionHealthUsingPolicyWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverServicePartitions(serviceId, 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); } @@ -52874,125 +51191,151 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the specified service that is currently stuck in quorum loss. + * @summary Gets the health of the specified Service Fabric partition, by using + * the specified health policy. * - * 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. + * 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 {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.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that the - * client is willing to wait for the requested 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. + * @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. * - * @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) + * @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. * - * {Error} err - The Error object if an error occurred, null otherwise. + * - 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. * - * {null} [result] - The deserialized result 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. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [options.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - recoverServicePartitions(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._recoverServicePartitions(serviceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - 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 {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. * - * 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.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The health + * policy used by default to evaluate the health of a service type. * - * @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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that the - * client is willing to wait for the requested operation to complete. The - * default value for this parameter is 60 seconds. + * 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 {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. + * @param {number} + * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum allowed percentage of unhealthy services. Allowed values are + * Byte values from zero to 100. * - * @reject {Error} - The error object. - */ - recoverSystemPartitionsWithHttpOperationResponse(options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._recoverSystemPartitions(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Indicates to the Service Fabric cluster that it should attempt to - * recover the system services that are currently stuck in quorum loss. + * 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. * - * 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 {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 timeout specifies the time duration that the @@ -53009,7 +51352,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. * @@ -53017,13 +51360,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. */ - recoverSystemPartitions(options, optionalCallback) { + getPartitionHealthUsingPolicy(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -53032,28 +51376,126 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverSystemPartitions(options, (err, result, request, response) => { + self._getPartitionHealthUsingPolicy(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverSystemPartitions(options, optionalCallback); + return self._getPartitionHealthUsingPolicy(partitionId, 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 Sends a health report on the Service Fabric partition. * - * 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. + * 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 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, if the reporter has issues (e.g. 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 @@ -53068,11 +51510,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - recoverAllPartitionsWithHttpOperationResponse(options) { + reportPartitionHealthWithHttpOperationResponse(partitionId, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverAllPartitions(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); } @@ -53083,16 +51525,114 @@ 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 Sends a health report on the Service Fabric partition. * - * 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. + * 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 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, if the reporter has issues (e.g. 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 @@ -53122,7 +51662,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverAllPartitions(options, optionalCallback) { + reportPartitionHealth(partitionId, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -53131,176 +51671,49 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverAllPartitions(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._recoverAllPartitions(options, optionalCallback); + return self._reportPartitionHealth(partitionId, healthInformation, 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. 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' + * @summary Gets the load information of the specified Service Fabric + * partition. * - * @param {boolean} [repairTask.performPreparingHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Preparing state. + * 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 {boolean} [repairTask.performRestoringHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Restoring state. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createRepairTaskWithHttpOperationResponse(repairTask, options) { + getPartitionLoadInformationWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createRepairTask(repairTask, 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); } @@ -53311,150 +51724,23 @@ 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. - * - * @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. 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' + * @summary Gets the load information of the specified Service Fabric + * partition. * - * @param {boolean} [repairTask.performPreparingHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Preparing state. + * 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 {boolean} [repairTask.performRestoringHealthCheck] A value to - * determine if health checks will be performed when the repair task enters the - * Restoring state. + * @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 * @@ -53465,7 +51751,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {RepairTaskUpdateInfo} - The deserialized result object. + * @resolve {PartitionLoadInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -53474,13 +51760,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 RepairTaskUpdateInfo} for more information. + * 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. */ - createRepairTask(repairTask, options, optionalCallback) { + getPartitionLoadInformation(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -53489,55 +51776,46 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createRepairTask(repairTask, options, (err, result, request, response) => { + self._getPartitionLoadInformation(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createRepairTask(repairTask, options, optionalCallback); + return self._getPartitionLoadInformation(partitionId, 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 Resets the current load of a Service Fabric partition. * - * @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. + * Resets the current load of a Service Fabric partition to the default load + * for the service. * - * @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 {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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - cancelRepairTaskWithHttpOperationResponse(repairTaskCancelDescription, options) { + resetPartitionLoadWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._cancelRepairTask(repairTaskCancelDescription, 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); } @@ -53548,29 +51826,20 @@ 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. - * - * @param {object} repairTaskCancelDescription Describes the repair task to be - * cancelled. - * - * @param {string} repairTaskCancelDescription.taskId The ID of the repair - * task. + * @summary Resets the current load of a Service Fabric partition. * - * @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. + * Resets the current load of a Service Fabric partition to the default load + * for the service. * - * @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 {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 * @@ -53581,7 +51850,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. * @@ -53589,14 +51858,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) { + resetPartitionLoad(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -53605,36 +51873,34 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._cancelRepairTask(repairTaskCancelDescription, options, (err, result, request, response) => { + self._resetPartitionLoad(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._cancelRepairTask(repairTaskCancelDescription, options, optionalCallback); + return self._resetPartitionLoad(partitionId, options, optionalCallback); } } /** - * @summary Deletes a completed repair task. - * - * 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. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover a specific partition that is currently stuck in quorum loss. * - * @param {string} repairTaskDeleteDescription.taskId The ID of the completed - * repair task to be deleted. + * 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} [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 {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 * @@ -53644,11 +51910,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - deleteRepairTaskWithHttpOperationResponse(repairTaskDeleteDescription, options) { + recoverPartitionWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteRepairTask(repairTaskDeleteDescription, 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); } @@ -53659,24 +51925,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes a completed repair task. - * - * 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. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover a specific partition that is currently stuck in quorum loss. * - * @param {string} repairTaskDeleteDescription.taskId The ID of the completed - * repair task to be deleted. + * 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} [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 {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 * @@ -53701,7 +51965,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteRepairTask(repairTaskDeleteDescription, options, optionalCallback) { + recoverPartition(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -53710,56 +51974,56 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteRepairTask(repairTaskDeleteDescription, options, (err, result, request, response) => { + self._recoverPartition(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteRepairTask(repairTaskDeleteDescription, options, optionalCallback); + return self._recoverPartition(partitionId, options, optionalCallback); } } /** - * @summary Gets a list of repair tasks matching the given filters. - * - * 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 - * matched. + * @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} [options.stateFilter] A bitwise-OR of the following values, - * specifying which task states should be included in the result list. + * 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. * - * - 1 - Created - * - 2 - Claimed - * - 4 - Preparing - * - 8 - Approved - * - 16 - Executing - * - 32 - Restoring - * - 64 - Completed + * @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} [options.executorFilter] The name of the repair executor - * whose claimed tasks should be included in the list. + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested 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. */ - getRepairTaskListWithHttpOperationResponse(options) { + recoverServicePartitionsWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getRepairTaskList(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); } @@ -53770,29 +52034,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a list of repair tasks matching the given filters. - * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. - * - * @param {object} [options] Optional Parameters. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover the specified service that is currently stuck in quorum loss. * - * @param {string} [options.taskIdFilter] The repair task ID prefix to be - * matched. + * 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} [options.stateFilter] A bitwise-OR of the following values, - * specifying which task states should be included in the result list. + * @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. * - * - 1 - Created - * - 2 - Claimed - * - 4 - Preparing - * - 8 - Approved - * - 16 - Executing - * - 32 - Restoring - * - 64 - Completed + * @param {object} [options] Optional Parameters. * - * @param {string} [options.executorFilter] The name of the repair executor - * whose claimed tasks should be included in the list. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -53804,7 +52068,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. * @@ -53812,13 +52076,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. */ - getRepairTaskList(options, optionalCallback) { + recoverServicePartitions(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -53827,50 +52091,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getRepairTaskList(options, (err, result, request, response) => { + self._recoverServicePartitions(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getRepairTaskList(options, optionalCallback); + return self._recoverServicePartitions(serviceId, 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. - * - * @param {string} repairTaskApproveDescription.taskId The ID of the repair - * task. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover the system services that are currently stuck in quorum loss. * - * @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. + * 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 timeout specifies the time duration that the + * client is willing to wait for the requested 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) { + recoverSystemPartitionsWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._forceApproveRepairTask(repairTaskApproveDescription, 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); } @@ -53881,24 +52143,22 @@ 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. - * - * @param {string} repairTaskApproveDescription.taskId The ID of the repair - * task. + * @summary Indicates to the Service Fabric cluster that it should attempt to + * recover the system services that are currently stuck in quorum loss. * - * @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. + * 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 timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -53909,7 +52169,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. * @@ -53917,14 +52177,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) { + recoverSystemPartitions(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -53933,62 +52192,47 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._forceApproveRepairTask(repairTaskApproveDescription, options, (err, result, request, response) => { + self._recoverSystemPartitions(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._forceApproveRepairTask(repairTaskApproveDescription, options, optionalCallback); + return self._recoverSystemPartitions(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. - * - * @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. + * @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. * - * @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. + * 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 timeout specifies the time duration that the + * client is willing to wait for the requested 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) { + recoverAllPartitionsWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, 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); } @@ -53999,36 +52243,21 @@ 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. - * - * @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. + * @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. * - * @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. + * 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 timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -54039,7 +52268,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. * @@ -54047,14 +52276,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) { + recoverAllPartitions(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -54063,19 +52291,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, (err, result, request, response) => { + self._recoverAllPartitions(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, optionalCallback); + return self._recoverAllPartitions(options, optionalCallback); } } /** - * @summary Updates the execution state of a repair task. + * @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. @@ -54214,11 +52456,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - updateRepairExecutionStateWithHttpOperationResponse(repairTask, options) { + createRepairTaskWithHttpOperationResponse(repairTask, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateRepairExecutionState(repairTask, 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); } @@ -54229,7 +52471,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Updates the execution state of a repair task. + * @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. @@ -54384,7 +52640,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateRepairExecutionState(repairTask, options, optionalCallback) { + createRepairTask(repairTask, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -54393,166 +52649,55 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateRepairExecutionState(repairTask, options, (err, result, request, response) => { + self._createRepairTask(repairTask, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateRepairExecutionState(repairTask, options, optionalCallback); + return self._createRepairTask(repairTask, options, optionalCallback); } } /** - * @summary Gets the information about replicas of a Service Fabric service - * partition. - * - * 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 {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 timeout specifies the time duration that the - * client is willing to wait for the requested 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. - */ - getReplicaInfoListWithHttpOperationResponse(partitionId, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._getReplicaInfoList(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 information about replicas of a Service Fabric service - * partition. - * - * 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 {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 timeout specifies the time duration that the - * client is willing to wait for the requested 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 {PagedReplicaInfoList} - 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 PagedReplicaInfoList} for more information. + * @summary Requests the cancellation of the given repair task. * - * {object} [request] - The HTTP Request object if an error did not occur. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getReplicaInfoList(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._getReplicaInfoList(partitionId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getReplicaInfoList(partitionId, options, optionalCallback); - } - } - - /** - * @summary Gets the information about a replica of a Service Fabric partition. + * @param {object} repairTaskCancelDescription Describes the repair task to be + * cancelled. * - * The response includes the ID, role, status, health, node name, uptime, and - * other details about the replica. + * @param {string} repairTaskCancelDescription.taskId The ID of the repair + * task. * - * @param {uuid} partitionId The identity of the partition. + * @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 {string} replicaId The identifier of the replica. + * @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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that the - * client is willing to wait for the requested 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) { + cancelRepairTaskWithHttpOperationResponse(repairTaskCancelDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicaInfo(partitionId, replicaId, 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); } @@ -54563,21 +52708,28 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about a replica of a Service Fabric partition. + * @summary Requests the cancellation of the given repair task. * - * The response includes the ID, role, status, health, node name, uptime, and - * other details about the replica. + * 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 {object} repairTaskCancelDescription Describes the repair task to be + * cancelled. * - * @param {string} replicaId The identifier of the replica. + * @param {string} repairTaskCancelDescription.taskId The ID of the repair + * task. * - * @param {object} [options] Optional Parameters. + * @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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time 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} [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 @@ -54589,7 +52741,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ReplicaInfo} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -54598,13 +52750,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 ReplicaInfo} 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. */ - getReplicaInfo(partitionId, replicaId, options, optionalCallback) { + cancelRepairTask(repairTaskCancelDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -54613,73 +52765,50 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicaInfo(partitionId, replicaId, options, (err, result, request, response) => { + self._cancelRepairTask(repairTaskCancelDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getReplicaInfo(partitionId, replicaId, options, optionalCallback); + return self._cancelRepairTask(repairTaskCancelDescription, options, optionalCallback); } } /** - * @summary Gets the health of a Service Fabric stateful service replica or - * stateless service instance. - * - * 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 {uuid} partitionId The identity of the partition. + * @summary Deletes a completed repair task. * - * @param {string} replicaId The identifier of the replica. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {object} [options] Optional Parameters. + * @param {object} repairTaskDeleteDescription Describes the repair task to be + * deleted. * - * @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 {string} repairTaskDeleteDescription.taskId The ID of the completed + * 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.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 timeout specifies the time duration that 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. */ - getReplicaHealthWithHttpOperationResponse(partitionId, replicaId, options) { + deleteRepairTaskWithHttpOperationResponse(repairTaskDeleteDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicaHealth(partitionId, replicaId, 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); } @@ -54690,46 +52819,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the health of a Service Fabric stateful service replica or - * stateless service instance. - * - * 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 {uuid} partitionId The identity of the partition. + * @summary Deletes a completed repair task. * - * @param {string} replicaId The identifier of the replica. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @param {object} [options] Optional Parameters. + * @param {object} repairTaskDeleteDescription Describes the repair task to be + * deleted. * - * @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 {string} repairTaskDeleteDescription.taskId The ID of the completed + * 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.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 timeout specifies the time duration that 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 @@ -54741,7 +52847,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. * @@ -54749,14 +52855,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. */ - getReplicaHealth(partitionId, replicaId, options, optionalCallback) { + deleteRepairTask(repairTaskDeleteDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -54765,151 +52870,56 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicaHealth(partitionId, replicaId, options, (err, result, request, response) => { + self._deleteRepairTask(repairTaskDeleteDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getReplicaHealth(partitionId, replicaId, options, optionalCallback); + return self._deleteRepairTask(repairTaskDeleteDescription, 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. - * - * @param {uuid} partitionId The identity of the partition. + * @summary Gets a list of repair tasks matching the given filters. * - * @param {string} replicaId The identifier of the replica. + * 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 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. - * - * @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 allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @param {string} [options.taskIdFilter] The repair task ID prefix to be + * matched. * - * 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 {number} [options.stateFilter] A bitwise-OR of the following values, + * specifying which task states should be included in the result list. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * - 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 timeout specifies the time 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. */ - getReplicaHealthUsingPolicyWithHttpOperationResponse(partitionId, replicaId, options) { + getRepairTaskListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicaHealthUsingPolicy(partitionId, replicaId, 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); } @@ -54920,124 +52930,29 @@ 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. - * - * @param {uuid} partitionId The identity of the partition. + * @summary Gets a list of repair tasks matching the given filters. * - * @param {string} replicaId The identifier of the replica. + * 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 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. - * - * @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 allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @param {string} [options.taskIdFilter] The repair task ID prefix to be + * matched. * - * 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 {number} [options.stateFilter] A bitwise-OR of the following values, + * specifying which task states should be included in the result list. * - * @param {array} [options.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * - 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 timeout specifies the time 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 @@ -55049,7 +52964,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ReplicaHealth} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -55057,14 +52972,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. + * {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. */ - getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback) { + getRepairTaskList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -55073,279 +52987,77 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, (err, result, request, response) => { + self._getRepairTaskList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback); + return self._getRepairTaskList(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} 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 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. + * @summary Forces the approval of the given repair task. * - * If not specified, time to live defaults to infinite value. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * @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 {object} repairTaskApproveDescription Describes the repair task to be + * approved. * - * @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} repairTaskApproveDescription.taskId The ID of the repair + * task. * - * @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 {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 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. - */ - reportReplicaHealthWithHttpOperationResponse(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - 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); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @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} 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 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. + * @returns {Promise} A promise is returned * - * If not specified, time to live defaults to infinite value. + * @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. + */ + forceApproveRepairTaskWithHttpOperationResponse(repairTaskApproveDescription, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._forceApproveRepairTask(repairTaskApproveDescription, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @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 {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} repairTaskApproveDescription Describes the repair task to be + * approved. * - * @param {object} [options] Optional Parameters. + * @param {string} repairTaskApproveDescription.taskId The ID of the repair + * task. * - * @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 {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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that 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 @@ -55357,7 +53069,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. * @@ -55365,13 +53077,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. */ - reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, optionalCallback) { + forceApproveRepairTask(repairTaskApproveDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -55380,63 +53093,62 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, 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._reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, optionalCallback); + return self._forceApproveRepairTask(repairTaskApproveDescription, options, optionalCallback); } } /** - * @summary Gets the list of replicas deployed on a Service Fabric node. + * @summary Updates the health policy of the given repair task. * - * 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. + * 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} repairTaskUpdateHealthPolicyDescription Describes the repair + * task healthy policy to be updated. * - * @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} 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 {uuid} [options.partitionId] The identity of the partition. + * @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 {string} [options.serviceManifestName] The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. + * @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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that 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. */ - getDeployedServiceReplicaInfoListWithHttpOperationResponse(nodeName, applicationId, options) { + updateRepairTaskHealthPolicyWithHttpOperationResponse(repairTaskUpdateHealthPolicyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaInfoList(nodeName, applicationId, 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); } @@ -55447,36 +53159,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of replicas deployed on a Service Fabric node. + * @summary Updates the health policy of the given repair task. * - * 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. + * 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} repairTaskUpdateHealthPolicyDescription Describes the repair + * task healthy policy to be updated. * - * @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} 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 {uuid} [options.partitionId] The identity of the partition. + * @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 {string} [options.serviceManifestName] The name of a service manifest - * registered as part of an application type in a Service Fabric cluster. + * @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 {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time duration that 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 @@ -55488,7 +53199,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -55496,13 +53207,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 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. */ - getDeployedServiceReplicaInfoList(nodeName, applicationId, options, optionalCallback) { + updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -55511,52 +53223,162 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, (err, result, request, response) => { + self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceReplicaInfoList(nodeName, applicationId, options, optionalCallback); + return self._updateRepairTaskHealthPolicy(repairTaskUpdateHealthPolicyDescription, options, optionalCallback); } } /** - * @summary Gets the details of replica deployed on a Service Fabric node. + * @summary Updates the execution state of a repair task. * - * 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. + * 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 {uuid} partitionId The identity of the partition. + * @param {string} repairTask.taskId The ID of the repair task. * - * @param {string} replicaId The identifier of the replica. + * @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 timeout specifies the time 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. */ - getDeployedServiceReplicaDetailInfoWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { + updateRepairExecutionStateWithHttpOperationResponse(repairTask, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, 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); } @@ -55567,25 +53389,135 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the details of replica deployed on a Service Fabric node. + * @summary Updates the execution state of a repair task. * - * 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. + * 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 {uuid} partitionId The identity of the partition. + * @param {string} repairTask.taskId The ID of the repair task. * - * @param {string} replicaId The identifier of the replica. + * @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 timeout specifies the time 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 @@ -55597,7 +53529,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServiceReplicaDetailInfo} - The deserialized result object. + * @resolve {RepairTaskUpdateInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -55606,14 +53538,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. + * 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. */ - getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback) { + updateRepairExecutionState(repairTask, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -55622,31 +53553,37 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, (err, result, request, response) => { + self._updateRepairExecutionState(repairTask, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback); + return self._updateRepairExecutionState(repairTask, 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 includes 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 information about replicas of a Service Fabric service + * partition. * - * @param {string} nodeName The name of the node. + * 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 {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 timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -55657,15 +53594,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getReplicaInfoListWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, 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); } @@ -55676,19 +53613,25 @@ 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 includes 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 information about replicas of a Service Fabric service + * partition. * - * @param {string} nodeName The name of the node. + * 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 {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 timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -55704,7 +53647,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServiceReplicaDetailInfo} - The deserialized result object. + * @resolve {PagedReplicaInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -55713,14 +53656,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. + * 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. */ - getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback) { + getReplicaInfoList(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -55729,26 +53671,22 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, (err, result, request, response) => { + self._getReplicaInfoList(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback); + return self._getReplicaInfoList(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 information about a replica of a Service Fabric partition. * - * @param {string} nodeName The name of the node. + * 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. * @@ -55766,15 +53704,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getReplicaInfoWithHttpOperationResponse(partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restartReplica(nodeName, partitionId, replicaId, 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); } @@ -55785,14 +53723,10 @@ 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 information about a replica of a Service Fabric partition. * - * @param {string} nodeName The name of the node. + * 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. * @@ -55815,7 +53749,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. * @@ -55823,13 +53757,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. */ - restartReplica(nodeName, partitionId, replicaId, options, optionalCallback) { + getReplicaInfo(partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -55838,31 +53773,24 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartReplica(nodeName, partitionId, replicaId, 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._restartReplica(nodeName, partitionId, replicaId, options, optionalCallback); + return self._getReplicaInfo(partitionId, replicaId, 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 Gets the health of a Service Fabric stateful service replica or + * stateless service instance. * - * @param {string} nodeName The name of the node. + * 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 {uuid} partitionId The identity of the partition. * @@ -55870,11 +53798,28 @@ class ServiceFabricClient extends ServiceClient { * * @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 timeout specifies the time duration that the @@ -55886,15 +53831,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - removeReplicaWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { + getReplicaHealthWithHttpOperationResponse(partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._removeReplica(nodeName, partitionId, replicaId, 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); } @@ -55905,19 +53850,12 @@ 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 Gets the health of a Service Fabric stateful service replica or + * stateless service instance. * - * @param {string} nodeName The name of the node. + * 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 {uuid} partitionId The identity of the partition. * @@ -55925,11 +53863,28 @@ class ServiceFabricClient extends ServiceClient { * * @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 timeout specifies the time duration that the @@ -55946,7 +53901,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. * @@ -55954,13 +53909,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. */ - removeReplica(nodeName, partitionId, replicaId, options, optionalCallback) { + getReplicaHealth(partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -55969,36 +53925,132 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._removeReplica(nodeName, partitionId, replicaId, 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._removeReplica(nodeName, partitionId, replicaId, options, optionalCallback); + return self._getReplicaHealth(partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the list of service packages deployed on a Service Fabric - * node. + * @summary Gets the health of a Service Fabric stateful service replica or + * stateless service instance using the specified policy. * - * Returns the information about the service packages deployed on a Service - * Fabric node for the given application. + * 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 {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 {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. + * + * @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 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 @@ -56009,15 +54061,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getReplicaHealthUsingPolicyWithHttpOperationResponse(partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoList(nodeName, applicationId, 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); } @@ -56028,24 +54080,120 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of service packages deployed on a Service Fabric - * node. + * @summary Gets the health of a Service Fabric stateful service replica or + * stateless service instance using the specified policy. * - * Returns the information about the service packages deployed on a Service - * Fabric node for the given application. + * 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 {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 {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. + * + * @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 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 @@ -56061,7 +54209,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {ReplicaHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -56069,13 +54217,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 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. */ - getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback) { + getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -56084,40 +54233,132 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoList(nodeName, applicationId, 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._getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback); + return self._getReplicaHealthUsingPolicy(partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the list of service packages deployed on a Service Fabric node - * matching exactly the specified name. + * @summary Sends a health report on the Service Fabric replica. * - * 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. + * 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} nodeName The name of the node. + * @param {uuid} partitionId The identity of the partition. + * + * @param {string} replicaId The identifier of the replica. + * + * @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 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} 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} [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} servicePackageName The name of the service package. + * @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, if the reporter has issues (e.g. 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 @@ -56128,15 +54369,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + reportReplicaHealthWithHttpOperationResponse(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, 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); } @@ -56147,28 +54388,120 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of service packages deployed on a Service Fabric node - * matching exactly the specified name. + * @summary Sends a health report on the Service Fabric replica. * - * 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. + * 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} 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 {string} replicaId The identifier of the replica. * - * @param {string} servicePackageName The name of the service package. + * @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 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, if the reporter has issues (e.g. 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 @@ -56184,7 +54517,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. * @@ -56192,13 +54525,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) { + reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -56207,25 +54540,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, 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._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, optionalCallback); + return self._reportReplicaHealth(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, options, optionalCallback); } } /** - * @summary Gets the information about health of a service package for a - * specific application deployed for a Service Fabric node and application. + * @summary Gets the list of replicas deployed on a Service Fabric node. * - * 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. + * 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 {string} nodeName The name of the node. * @@ -56237,32 +54571,12 @@ class ServiceFabricClient extends ServiceClient { * 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 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 {uuid} [options.partitionId] The identity of the partition. * - * - 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.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 timeout specifies the time duration that the @@ -56274,15 +54588,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedServiceReplicaInfoListWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, 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); } @@ -56293,13 +54607,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the information about health of a service package for a - * specific application deployed for a Service Fabric node and application. + * @summary Gets the list of replicas deployed on a Service Fabric node. * - * 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. + * 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 {string} nodeName The name of the node. * @@ -56311,32 +54626,12 @@ class ServiceFabricClient extends ServiceClient { * 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 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 {uuid} [options.partitionId] The identity of the partition. * - * - 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.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 timeout specifies the time duration that the @@ -56353,7 +54648,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServicePackageHealth} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -56361,15 +54656,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. + * {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. */ - getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback) { + getDeployedServiceReplicaInfoList(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -56378,141 +54671,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, 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._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback); + return self._getDeployedServiceReplicaInfoList(nodeName, applicationId, 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. + * @summary Gets the details of replica deployed on a Service Fabric node. * - * 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. + * 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} 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} servicePackageName The name of the service package. + * @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. - * - * @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 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 @@ -56523,147 +54708,39 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedServiceReplicaDetailInfoWithHttpOperationResponse(nodeName, partitionId, replicaId, 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 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.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. - * - * @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. + let self = this; + return new Promise((resolve, reject) => { + self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, 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 details of replica deployed on a Service Fabric node. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * 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. * - * 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} nodeName The name of the node. * - * @param {number} - * [options.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @param {uuid} partitionId The identity of the partition. * - * 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} replicaId The identifier of the replica. * - * @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 {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the @@ -56680,7 +54757,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeployedServicePackageHealth} - The deserialized result object. + * @resolve {DeployedServiceReplicaDetailInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -56689,14 +54766,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 DeployedServicePackageHealth} for more + * 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. */ - getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback) { + getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -56705,137 +54782,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, 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._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback); + return self._getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, options, optionalCallback); } } /** - * @summary Sends a health report on the Service Fabric deployed service - * package. + * @summary Gets the details of replica deployed on a Service Fabric node. * - * 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. + * 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} 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 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 {uuid} partitionId The identity of the partition. * * @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 @@ -56846,15 +54817,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedServiceReplicaDetailInfoByPartitionIdWithHttpOperationResponse(nodeName, partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, 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); } @@ -56865,125 +54836,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Sends a health report on the Service Fabric deployed service - * package. + * @summary Gets the details of replica deployed on a Service Fabric node. * - * 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. + * 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} 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 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 {uuid} partitionId The identity of the partition. * * @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 @@ -56999,7 +54864,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. * @@ -57007,13 +54872,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. */ - reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback) { + getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -57022,47 +54889,30 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, 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._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback); + return self._getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, options, optionalCallback); } } /** - * @summary Downloads all of the code packages associated with specified - * service manifest on the specified node. + * @summary Restarts a service replica of a persisted service running on a + * 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. + * 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} 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 - * 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 The name of a - * Service Fabric node. + * @param {uuid} partitionId The identity of the partition. * - * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] - * List of package sharing policy information. + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * @@ -57080,11 +54930,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - deployServicePackageToNodeWithHttpOperationResponse(nodeName, deployServicePackageToNodeDescription, options) { + restartReplicaWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, 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); } @@ -57095,35 +54945,18 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Downloads all of the code packages associated with specified - * service manifest on the specified node. + * @summary Restarts a service replica of a persisted service running on a + * 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. + * 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} 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 - * 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 The name of a - * Service Fabric node. + * @param {uuid} partitionId The identity of the partition. * - * @param {array} [deployServicePackageToNodeDescription.packageSharingPolicy] - * List of package sharing policy information. + * @param {string} replicaId The identifier of the replica. * * @param {object} [options] Optional Parameters. * @@ -57156,7 +54989,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback) { + restartReplica(nodeName, partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -57165,41 +54998,43 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, 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._deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback); + return self._restartReplica(nodeName, partitionId, replicaId, options, optionalCallback); } } /** - * @summary Gets the list of code packages deployed on a Service Fabric node. + * @summary Removes a service replica running on a node. * - * Gets the list of code packages deployed on a Service Fabric node for the - * given application. + * 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 {object} [options] Optional Parameters. + * @param {string} replicaId The identifier of the replica. * - * @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 {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.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 @@ -57211,15 +55046,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + removeReplicaWithHttpOperationResponse(nodeName, partitionId, replicaId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeployedCodePackageInfoList(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); } @@ -57230,29 +55065,31 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of code packages deployed on a Service Fabric node. + * @summary Removes a service replica running on a node. * - * Gets the list of code packages deployed on a Service Fabric node for the - * given application. + * 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 {object} [options] Optional Parameters. + * @param {string} replicaId The identifier of the replica. * - * @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 {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.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 @@ -57269,7 +55106,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. * @@ -57277,13 +55114,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) { + removeReplica(nodeName, partitionId, replicaId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -57292,63 +55129,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployedCodePackageInfoList(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._getDeployedCodePackageInfoList(nodeName, applicationId, options, optionalCallback); + return self._removeReplica(nodeName, partitionId, replicaId, options, optionalCallback); } } /** - * @summary Restarts a code package deployed on a Service Fabric node in a - * cluster. + * @summary Gets the list of service packages deployed on a Service Fabric + * node. * - * 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. + * 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 - * 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. + * 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. * @@ -57362,15 +55169,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - restartDeployedCodePackageWithHttpOperationResponse(nodeName, applicationId, restartDeployedCodePackageDescription, options) { + getDeployedServicePackageInfoListWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, 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); } @@ -57381,12 +55188,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Restarts a code package deployed on a Service Fabric node in a - * cluster. + * @summary Gets the list of service packages deployed on a Service Fabric + * node. * - * 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. + * 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. * @@ -57398,35 +55204,6 @@ class ServiceFabricClient extends ServiceClient { * 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 @@ -57444,7 +55221,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. * @@ -57452,13 +55229,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. */ - restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, optionalCallback) { + getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -57467,23 +55244,25 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, 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._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, optionalCallback); + return self._getDeployedServicePackageInfoList(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Gets the container logs for container deployed on a Service Fabric - * node. + * @summary Gets the list of service packages deployed on a Service Fabric node + * matching exactly the specified name. * - * Gets the container logs for container deployed on a Service Fabric node for - * the given code package. + * 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 {string} nodeName The name of the node. * @@ -57495,21 +55274,10 @@ class ServiceFabricClient extends ServiceClient { * 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} servicePackageName The name of the service package. * * @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 @@ -57520,15 +55288,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getContainerLogsDeployedOnNodeWithHttpOperationResponse(nodeName, applicationId, serviceManifestName, codePackageName, options) { + getDeployedServicePackageInfoListByNameWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, 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); } @@ -57539,11 +55307,13 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the container logs for container deployed on a Service Fabric - * node. + * @summary Gets the list of service packages deployed on a Service Fabric node + * matching exactly the specified name. * - * Gets the container logs for container deployed on a Service Fabric node for - * the given code package. + * 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 {string} nodeName The name of the node. * @@ -57555,21 +55325,10 @@ class ServiceFabricClient extends ServiceClient { * 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} servicePackageName The name of the service package. * * @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 @@ -57585,7 +55344,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ContainerLogs} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -57593,14 +55352,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 ContainerLogs} 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. */ - getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, optionalCallback) { + getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -57609,23 +55367,25 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, 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._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, optionalCallback); + return self._getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, options, optionalCallback); } } /** - * @summary Invoke container API on a container deployed on a Service Fabric - * node. + * @summary Gets the information about health of a service package for a + * specific application deployed for a Service Fabric node and application. * - * Invoke container API on a container deployed on a Service Fabric node for - * the given code package. + * 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. * @@ -57637,32 +55397,32 @@ class ServiceFabricClient extends ServiceClient { * 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} servicePackageName The name of the service package. * - * @param {string} [containerApiRequestBody.contentType] Content type of - * container REST API request, defaults to "application/json" + * @param {object} [options] Optional Parameters. * - * @param {string} [containerApiRequestBody.body] HTTP request body of - * container REST API + * @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 timeout specifies the time duration that the @@ -57674,15 +55434,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - invokeContainerApiWithHttpOperationResponse(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options) { + getDeployedServicePackageHealthWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, 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); } @@ -57693,11 +55453,13 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Invoke container API on a container deployed on a Service Fabric - * node. + * @summary Gets the information about health of a service package for a + * specific application deployed for a Service Fabric node and application. * - * Invoke container API on a container deployed on a Service Fabric node for - * the given code package. + * 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. * @@ -57709,32 +55471,32 @@ class ServiceFabricClient extends ServiceClient { * 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} servicePackageName The name of the service package. * - * @param {string} [containerApiRequestBody.contentType] Content type of - * container REST API request, defaults to "application/json" + * @param {object} [options] Optional Parameters. * - * @param {string} [containerApiRequestBody.body] HTTP request body of - * container REST API + * @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 timeout specifies the time duration that the @@ -57751,7 +55513,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ContainerApiResponse} - The deserialized result object. + * @resolve {DeployedServicePackageHealth} - The deserialized result object. * * @reject {Error} - The error object. * @@ -57760,13 +55522,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 ContainerApiResponse} for more information. + * 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. */ - invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, optionalCallback) { + getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -57775,50 +55538,140 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, 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._invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, optionalCallback); + return self._getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, options, optionalCallback); } } /** - * @summary Creates a Service Fabric compose deployment. + * @summary Gets the information about health of service package for a specific + * application deployed on a Service Fabric node using the specified policy. * - * 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. + * 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 {object} createComposeDeploymentDescription Describes the compose - * deployment that needs to be created. + * @param {string} nodeName The name of the node. * - * @param {string} createComposeDeploymentDescription.deploymentName The name - * of the deployment. + * @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} createComposeDeploymentDescription.composeFileContent The - * content of the compose file that describes the deployment to create. + * @param {string} servicePackageName The name of the service package. * - * @param {object} [createComposeDeploymentDescription.registryCredential] - * Credential information to connect to container registry. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryUserName] The - * user name to connect to container registry. + * @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 {string} - * [createComposeDeploymentDescription.registryCredential.registryPassword] The - * password for supplied username to connect to container registry. + * - 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} - * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] - * Indicates that supplied container registry password is encrypted. + * @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.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 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 @@ -57830,15 +55683,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedServicePackageHealthUsingPolicyWithHttpOperationResponse(nodeName, applicationId, servicePackageName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createComposeDeployment(createComposeDeploymentDescription, 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); } @@ -57849,38 +55702,128 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates a Service Fabric compose deployment. + * @summary Gets the information about health of service package for a specific + * application deployed on a Service Fabric node using the specified policy. * - * 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. + * 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 {object} createComposeDeploymentDescription Describes the compose - * deployment that needs to be created. + * @param {string} nodeName The name of the node. * - * @param {string} createComposeDeploymentDescription.deploymentName The name - * of the deployment. + * @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} createComposeDeploymentDescription.composeFileContent The - * content of the compose file that describes the deployment to create. + * @param {string} servicePackageName The name of the service package. * - * @param {object} [createComposeDeploymentDescription.registryCredential] - * Credential information to connect to container registry. + * @param {object} [options] Optional Parameters. * - * @param {string} - * [createComposeDeploymentDescription.registryCredential.registryUserName] The - * user name to connect to container registry. + * @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 {string} - * [createComposeDeploymentDescription.registryCredential.registryPassword] The - * password for supplied username to connect to container registry. + * - 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 allowed percentage of unhealthy services. Allowed values are + * Byte values from zero to 100. * - * @param {boolean} - * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] - * Indicates that supplied container registry password is encrypted. + * 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 {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 @@ -57897,7 +55840,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. * @@ -57905,13 +55848,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. */ - createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback) { + getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -57920,29 +55865,137 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createComposeDeployment(createComposeDeploymentDescription, 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._createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback); + return self._getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, options, optionalCallback); } } /** - * @summary Gets information about a Service Fabric compose deployment. + * @summary Sends a health report on the Service Fabric deployed service + * package. * - * 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. + * 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} 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} 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, if the reporter has issues (e.g. 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 @@ -57953,15 +56006,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + reportDeployedServicePackageHealthWithHttpOperationResponse(nodeName, applicationId, servicePackageName, healthInformation, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getComposeDeploymentStatus(deploymentName, 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); } @@ -57972,17 +56025,125 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets information about a Service Fabric compose deployment. + * @summary Sends a health report on the Service Fabric deployed service + * package. * - * 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. + * 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} 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} 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, if the reporter has issues (e.g. 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 @@ -57998,7 +56159,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ComposeDeploymentStatusInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -58006,15 +56167,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. + * {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. */ - getComposeDeploymentStatus(deploymentName, options, optionalCallback) { + reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -58023,45 +56182,49 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getComposeDeploymentStatus(deploymentName, 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._getComposeDeploymentStatus(deploymentName, options, optionalCallback); + return self._reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, healthInformation, options, optionalCallback); } } /** - * @summary Gets the list of compose deployments created in the Service Fabric - * cluster. + * @summary Downloads all of the code packages associated with specified + * service manifest on the specified node. * - * 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. + * 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 {object} [options] Optional Parameters. + * @param {string} nodeName The name of the node. * - * @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} deployServicePackageToNodeDescription Describes information + * for deploying a service package to a Service Fabric node. * - * @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 {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 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 timeout specifies the time duration that the @@ -58073,15 +56236,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + deployServicePackageToNodeWithHttpOperationResponse(nodeName, deployServicePackageToNodeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getComposeDeploymentStatusList(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); } @@ -58092,33 +56255,37 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of compose deployments created in the Service Fabric - * cluster. + * @summary Downloads all of the code packages associated with specified + * service manifest on the specified node. * - * 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. + * 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 {object} [options] Optional Parameters. + * @param {string} nodeName The name of the node. * - * @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} deployServicePackageToNodeDescription Describes information + * for deploying a service package to a Service Fabric node. * - * @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 {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 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 timeout specifies the time duration that the @@ -58135,7 +56302,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. * @@ -58143,15 +56310,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) { + deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -58160,28 +56325,42 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getComposeDeploymentStatusList(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._getComposeDeploymentStatusList(options, optionalCallback); + return self._deployServicePackageToNode(nodeName, deployServicePackageToNodeDescription, options, optionalCallback); } } /** - * @summary Gets details for the latest upgrade performed on this Service - * Fabric compose deployment. + * @summary Gets the list of code packages deployed on a Service Fabric node. * - * Returns the information about the state of the compose deployment upgrade - * along with details to aid debugging application health issues. + * Gets the list of code packages deployed on a Service Fabric node for the + * given application. * - * @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 {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 timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -58192,15 +56371,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getDeployedCodePackageInfoListWithHttpOperationResponse(nodeName, applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getComposeDeploymentUpgradeProgress(deploymentName, options, (err, result, request, response) => { + self._getDeployedCodePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -58211,16 +56390,30 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets details for the latest upgrade performed on this Service - * Fabric compose deployment. + * @summary Gets the list of code packages deployed on a Service Fabric node. * - * Returns the information about the state of the compose deployment upgrade - * along with details to aid debugging application health issues. + * Gets the list of code packages deployed on a Service Fabric node for the + * given application. * - * @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 {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 timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -58236,7 +56429,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ComposeDeploymentUpgradeProgressInfo} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -58244,15 +56437,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. + * {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. */ - getComposeDeploymentUpgradeProgress(deploymentName, options, optionalCallback) { + getDeployedCodePackageInfoList(nodeName, applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -58261,23 +56452,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getComposeDeploymentUpgradeProgress(deploymentName, options, (err, result, request, response) => { + self._getDeployedCodePackageInfoList(nodeName, applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getComposeDeploymentUpgradeProgress(deploymentName, options, optionalCallback); + return self._getDeployedCodePackageInfoList(nodeName, applicationId, options, optionalCallback); } } /** - * @summary Deletes an existing Service Fabric compose deployment from cluster. + * @summary Restarts a code package deployed on a Service Fabric node in a + * cluster. * - * Deletes an existing Service Fabric compose deployment. + * 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} 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 {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. * @@ -58295,11 +56526,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - removeComposeDeploymentWithHttpOperationResponse(deploymentName, options) { + restartDeployedCodePackageWithHttpOperationResponse(nodeName, applicationId, restartDeployedCodePackageDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._removeComposeDeployment(deploymentName, 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); } @@ -58310,11 +56541,51 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes an existing Service Fabric compose deployment from cluster. + * @summary Restarts a code package deployed on a Service Fabric node in a + * cluster. * - * Deletes an existing Service Fabric compose deployment. + * 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} 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 {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. * @@ -58347,7 +56618,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - removeComposeDeployment(deploymentName, options, optionalCallback) { + restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -58356,196 +56627,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._removeComposeDeployment(deploymentName, options, (err, result, request, response) => { + self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._removeComposeDeployment(deploymentName, options, optionalCallback); + return self._restartDeployedCodePackage(nodeName, applicationId, restartDeployedCodePackageDescription, 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 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. + * @summary Gets the container logs for container deployed on a Service Fabric + * node. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * Gets the container logs for container deployed on a Service Fabric node for + * the given code package. * - * 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} nodeName The name of the node. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. 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 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} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric 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 {object} [options] Optional Parameters. * - * @param {array} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * @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 timeout specifies the time duration that the @@ -58557,15 +56680,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getContainerLogsDeployedOnNodeWithHttpOperationResponse(nodeName, applicationId, serviceManifestName, codePackageName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, (err, result, request, response) => { + 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); } @@ -58576,184 +56699,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the container logs for container deployed on a Service Fabric + * node. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * Gets the container logs for container deployed on a Service Fabric node for + * the given code package. * - * 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} nodeName The name of the node. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. 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 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} serviceManifestName The name of a service manifest + * registered as part of an application type in a Service Fabric cluster. * - * @param {number} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum allowed percentage of unhealthy services. Allowed values are - * Byte values from zero to 100. + * @param {string} codePackageName The name of code package specified in + * service manifest registered as part of an application type in a Service + * Fabric 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 {object} [options] Optional Parameters. * - * @param {array} - * [composeDeploymentUpgradeDescription.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * The map with service type health policy per service type name. The map is - * empty by default. + * @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 timeout specifies the time duration that the @@ -58770,7 +56745,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ContainerLogs} - The deserialized result object. * * @reject {Error} - The error object. * @@ -58778,38 +56753,74 @@ 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 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. + */ + getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, 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._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContainerLogsDeployedOnNode(nodeName, applicationId, serviceManifestName, codePackageName, options, optionalCallback); + } + } + + /** + * @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" * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} containerApiRequestBody.uriPath URI path of container REST + * API * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, 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._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, optionalCallback); - } - } - - /** - * @summary Get the status of Chaos. + * @param {string} [containerApiRequestBody.contentType] Content type of + * container REST API request, defaults to "application/json" * - * 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 {string} [containerApiRequestBody.body] HTTP request body of + * container REST API * * @param {object} [options] Optional Parameters. * @@ -58823,15 +56834,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getChaosWithHttpOperationResponse(options) { + invokeContainerApiWithHttpOperationResponse(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getChaos(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); } @@ -58842,11 +56853,46 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the status of Chaos. + * @summary Invoke container API on a container deployed on a Service Fabric + * 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. + * 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. * @@ -58865,7 +56911,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Chaos} - The deserialized result object. + * @resolve {ContainerApiResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -58874,13 +56920,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 Chaos} 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. */ - getChaos(options, optionalCallback) { + invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -58889,185 +56935,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getChaos(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._getChaos(options, optionalCallback); + return self._invokeContainerApi(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, options, optionalCallback); } } /** - * @summary Starts Chaos in the cluster. - * - * 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 {object} chaosParameters Describes all the parameters to configure a - * Chaos run. + * @summary Creates a Service Fabric compose deployment. * - * @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). + * 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 {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 {object} createComposeDeploymentDescription Describes the compose + * deployment that needs to be created. * - * @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 {string} createComposeDeploymentDescription.deploymentName The name + * of the deployment. * - * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or - * disables the move primary and move secondary faults. + * @param {string} createComposeDeploymentDescription.composeFileContent The + * content of the compose file that describes the deployment to create. * - * @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 {object} [createComposeDeploymentDescription.registryCredential] + * Credential information to connect to container registry. * - * @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} + * [createComposeDeploymentDescription.registryCredential.registryUserName] The + * user name to connect to container registry. * - * @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 {string} + * [createComposeDeploymentDescription.registryCredential.registryPassword] The + * password for supplied username to connect to container registry. * * @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. + * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] + * Indicates that supplied container registry password is encrypted. * * @param {object} [options] Optional Parameters. * @@ -59085,11 +56994,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startChaosWithHttpOperationResponse(chaosParameters, options) { + createComposeDeploymentWithHttpOperationResponse(createComposeDeploymentDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startChaos(chaosParameters, 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); } @@ -59100,173 +57009,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Starts Chaos in the cluster. - * - * 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 {object} chaosParameters Describes all the parameters to configure a - * Chaos run. + * @summary Creates a Service Fabric compose deployment. * - * @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). + * 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 {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 {object} createComposeDeploymentDescription Describes the compose + * deployment that needs to be created. * - * @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 {string} createComposeDeploymentDescription.deploymentName The name + * of the deployment. * - * @param {boolean} [chaosParameters.enableMoveReplicaFaults] Enables or - * disables the move primary and move secondary faults. + * @param {string} createComposeDeploymentDescription.composeFileContent The + * content of the compose file that describes the deployment to create. * - * @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 {object} [createComposeDeploymentDescription.registryCredential] + * Credential information to connect to container registry. * - * @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} + * [createComposeDeploymentDescription.registryCredential.registryUserName] The + * user name to connect to container registry. * - * @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 {string} + * [createComposeDeploymentDescription.registryCredential.registryPassword] The + * password for supplied username to connect to container registry. * * @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. + * [createComposeDeploymentDescription.registryCredential.passwordEncrypted] + * Indicates that supplied container registry password is encrypted. * * @param {object} [options] Optional Parameters. * @@ -59299,7 +57071,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startChaos(chaosParameters, options, optionalCallback) { + createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -59308,27 +57080,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startChaos(chaosParameters, options, (err, result, request, response) => { + self._createComposeDeployment(createComposeDeploymentDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startChaos(chaosParameters, options, optionalCallback); + return self._createComposeDeployment(createComposeDeploymentDescription, options, optionalCallback); } } /** - * @summary Stops Chaos if it is running in the cluster and put the Chaos - * Schedule in a stopped state. + * @summary Gets information about a Service Fabric compose deployment. * - * 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. + * 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. * @@ -59342,15 +57113,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getComposeDeploymentStatusWithHttpOperationResponse(deploymentName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._stopChaos(options, (err, result, request, response) => { + self._getComposeDeploymentStatus(deploymentName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -59361,15 +57132,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Stops Chaos if it is running in the cluster and put the Chaos - * Schedule in a stopped state. + * @summary Gets information about a Service Fabric compose deployment. * - * 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. + * 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. * @@ -59388,7 +57158,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. * @@ -59396,13 +57166,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. */ - stopChaos(options, optionalCallback) { + getComposeDeploymentStatus(deploymentName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -59411,30 +57183,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._stopChaos(options, (err, result, request, response) => { + self._getComposeDeploymentStatus(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._stopChaos(options, optionalCallback); + return self._getComposeDeploymentStatus(deploymentName, options, optionalCallback); } } /** - * @summary Gets the next segment of the Chaos events based on the continuation - * token or the time range. + * @summary Gets the list of compose deployments created in the Service Fabric + * cluster. * - * 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. + * 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. * @@ -59446,18 +57215,6 @@ class ServiceFabricClient extends ServiceClient { * 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 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 @@ -59476,15 +57233,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getChaosEventsWithHttpOperationResponse(options) { + getComposeDeploymentStatusListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getChaosEvents(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); } @@ -59495,18 +57252,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the next segment of the Chaos events based on the continuation - * token or the time range. + * @summary Gets the list of compose deployments created in the Service Fabric + * cluster. * - * 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. + * 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. * @@ -59518,18 +57272,6 @@ class ServiceFabricClient extends ServiceClient { * 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 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 @@ -59553,7 +57295,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ChaosEventsSegment} - The deserialized result object. + * @resolve {PagedComposeDeploymentStatusInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -59562,13 +57304,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 ChaosEventsSegment} 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. */ - getChaosEvents(options, optionalCallback) { + getComposeDeploymentStatusList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -59577,22 +57320,25 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getChaosEvents(options, (err, result, request, response) => { + self._getComposeDeploymentStatusList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getChaosEvents(options, optionalCallback); + return self._getComposeDeploymentStatusList(options, optionalCallback); } } /** - * @summary Get the Chaos Schedule defining when and how to run Chaos. + * @summary Gets details for the latest upgrade performed on this Service + * Fabric compose deployment. * - * Gets the version of the Chaos Schedule in use and the Chaos Schedule that - * defines when and how to run Chaos. + * 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. * @@ -59606,15 +57352,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getChaosScheduleWithHttpOperationResponse(options) { + getComposeDeploymentUpgradeProgressWithHttpOperationResponse(deploymentName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getChaosSchedule(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); } @@ -59625,10 +57371,13 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the Chaos Schedule defining when and how to run Chaos. + * @summary Gets details for the latest upgrade performed on this Service + * Fabric compose deployment. * - * Gets the version of the Chaos Schedule in use and the Chaos Schedule that - * defines when and how to run Chaos. + * 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. * @@ -59647,7 +57396,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ChaosScheduleDescription} - The deserialized result object. + * @resolve {ComposeDeploymentUpgradeProgressInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -59656,14 +57405,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 ChaosScheduleDescription} for more - * information. + * 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. */ - getChaosSchedule(options, optionalCallback) { + getComposeDeploymentUpgradeProgress(deploymentName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -59672,45 +57421,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getChaosSchedule(options, (err, result, request, response) => { + self._getComposeDeploymentUpgradeProgress(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getChaosSchedule(options, optionalCallback); + return self._getComposeDeploymentUpgradeProgress(deploymentName, 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 {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. + * @summary Deletes an existing Service Fabric compose deployment from cluster. * - * @param {array} [chaosSchedule.schedule.chaosParametersDictionary] A mapping - * of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * Deletes an existing Service Fabric compose deployment. * - * @param {array} [chaosSchedule.schedule.jobs] A list of all Chaos Schedule - * Jobs that will be automated by the schedule. + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * @@ -59728,11 +57455,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - postChaosScheduleWithHttpOperationResponse(chaosSchedule, options) { + removeComposeDeploymentWithHttpOperationResponse(deploymentName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._postChaosSchedule(chaosSchedule, 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); } @@ -59743,33 +57470,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Deletes an existing Service Fabric compose deployment from cluster. * - * @param {array} [chaosSchedule.schedule.chaosParametersDictionary] A mapping - * of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * Deletes an existing Service Fabric compose deployment. * - * @param {array} [chaosSchedule.schedule.jobs] A list of all Chaos Schedule - * Jobs that will be automated by the schedule. + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * @@ -59802,7 +57507,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - postChaosSchedule(chaosSchedule, options, optionalCallback) { + removeComposeDeployment(deploymentName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -59811,34 +57516,194 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._postChaosSchedule(chaosSchedule, options, (err, result, request, response) => { + self._removeComposeDeployment(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._postChaosSchedule(chaosSchedule, options, optionalCallback); + return self._removeComposeDeployment(deploymentName, options, optionalCallback); } } /** - * @summary Uploads contents of the file to the image store. + * @summary Starts upgrading a compose deployment in the Service Fabric + * cluster. * - * 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. + * Validates the supplied upgrade parameters and starts upgrading the + * deployment if the parameters are valid. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @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 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. * @@ -59856,11 +57721,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - uploadFileWithHttpOperationResponse(contentPath, options) { + startComposeDeploymentUpgradeWithHttpOperationResponse(deploymentName, composeDeploymentUpgradeDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._uploadFile(contentPath, 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); } @@ -59871,22 +57736,182 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Uploads contents of the file to the image store. + * @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. * - * 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 {number} + * [composeDeploymentUpgradeDescription.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] + * The maximum allowed percentage of unhealthy replicas per partition. Allowed + * values are Byte values from zero to 100. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * 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 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. * @@ -59919,7 +57944,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - uploadFile(contentPath, options, optionalCallback) { + startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -59928,25 +57953,24 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._uploadFile(contentPath, 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._uploadFile(contentPath, options, optionalCallback); + return self._startComposeDeploymentUpgrade(deploymentName, composeDeploymentUpgradeDescription, options, optionalCallback); } } /** - * @summary Gets the image store content information. + * @summary Starts rolling back a compose deployment upgrade in the Service + * Fabric cluster. * - * Returns the information about the image store content at the specified - * contentPath. The contentPath is relative to the root of the image store. + * Rollback a service fabric compose deployment upgrade. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * @@ -59960,15 +57984,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + startRollbackComposeDeploymentUpgradeWithHttpOperationResponse(deploymentName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getImageStoreContent(contentPath, options, (err, result, request, response) => { + self._startRollbackComposeDeploymentUpgrade(deploymentName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -59979,13 +58003,12 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the image store content information. + * @summary Starts rolling back a compose deployment upgrade in the Service + * Fabric cluster. * - * Returns the information about the image store content at the specified - * contentPath. The contentPath is relative to the root of the image store. + * Rollback a service fabric compose deployment upgrade. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * @param {string} deploymentName The identity of the deployment. * * @param {object} [options] Optional Parameters. * @@ -60004,7 +58027,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ImageStoreContent} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -60012,14 +58035,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. + * {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. */ - getImageStoreContent(contentPath, options, optionalCallback) { + startRollbackComposeDeploymentUpgrade(deploymentName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60028,26 +58050,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getImageStoreContent(contentPath, options, (err, result, request, response) => { + self._startRollbackComposeDeploymentUpgrade(deploymentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getImageStoreContent(contentPath, options, optionalCallback); + return self._startRollbackComposeDeploymentUpgrade(deploymentName, options, optionalCallback); } } /** - * @summary Deletes existing image store content. - * - * 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. + * @summary Get the status of Chaos. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * 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. * @@ -60061,15 +58080,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getChaosWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteImageStoreContent(contentPath, 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); } @@ -60080,14 +58099,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes existing image store content. - * - * 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. + * @summary Get the status of Chaos. * - * @param {string} contentPath Relative path to file or folder in the image - * store from its root. + * 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. * @@ -60106,7 +58122,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Chaos} - The deserialized result object. * * @reject {Error} - The error object. * @@ -60114,13 +58130,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 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. */ - deleteImageStoreContent(contentPath, options, optionalCallback) { + getChaos(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60129,134 +58146,185 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteImageStoreContent(contentPath, options, (err, result, request, response) => { + self._getChaos(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteImageStoreContent(contentPath, options, optionalCallback); + return self._getChaos(options, optionalCallback); } } /** - * @summary Gets the content information at the root of the image store. - * - * 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 timeout specifies the time duration that the - * client is willing to wait for the requested 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 + * @summary Starts Chaos in the cluster. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * 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. * - * @reject {Error} - The error object. - */ - getImageStoreRootContentWithHttpOperationResponse(options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._getImageStoreRootContent(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 content information at the root of the image store. + * @param {object} chaosParameters Describes all the parameters to configure a + * Chaos run. * - * Returns the information about the image store content at the root of the - * image store. + * @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} [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 {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 {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. * - * @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. + * @param {number} [chaosParameters.waitTimeBetweenIterationsInSeconds] + * Time-separation (in seconds) between two consecutive iterations of Chaos. + * The larger the value, the lower the fault injection rate. * - * {Promise} A promise is returned + * @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. * - * @resolve {ImageStoreContent} - The deserialized result object. + * @param {boolean} + * [chaosParameters.clusterHealthPolicy.considerWarningAsError] Indicates + * whether warnings are treated with the same severity as errors. * - * @reject {Error} - The error object. + * @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. * - * {function} optionalCallback(err, result, request, 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. * - * {Error} err - The Error object if an error occurred, null otherwise. + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImageStoreContent} for more information. + * @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. * - * {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. - */ - getImageStoreRootContent(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._getImageStoreRootContent(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getImageStoreRootContent(options, optionalCallback); - } - } - - /** - * @summary Copies image store content internally + * @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. * - * Copies the image store content from the source image store relative path to - * the destination image store relative path. + * 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} imageStoreCopyDescription Describes the copy description for - * the image store. + * @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 {string} imageStoreCopyDescription.remoteSource The relative path of - * source image store content to be copied from. + * @param {object} [chaosParameters.context.map] Describes a map that contains + * a collection of ChaosContextMapItem's. * - * @param {string} imageStoreCopyDescription.remoteDestination The relative - * path of destination image store content to be copied to. + * @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} [imageStoreCopyDescription.skipFiles] The list of the file - * names to be skipped for copying. + * @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 {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 {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. * @@ -60274,11 +58342,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - copyImageStoreContentWithHttpOperationResponse(imageStoreCopyDescription, options) { + startChaosWithHttpOperationResponse(chaosParameters, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._copyImageStoreContent(imageStoreCopyDescription, 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); } @@ -60289,28 +58357,173 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Copies image store content internally + * @summary Starts Chaos in the cluster. * - * Copies the image store content from the source image store relative path to - * the destination image store relative path. + * 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 {object} imageStoreCopyDescription Describes the copy description for - * the image store. + * @param {object} chaosParameters Describes all the parameters to configure a + * Chaos run. * - * @param {string} imageStoreCopyDescription.remoteSource The relative path of - * source image store content to be copied from. + * @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} imageStoreCopyDescription.remoteDestination The relative - * path of destination image store content to be copied to. + * @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 {array} [imageStoreCopyDescription.skipFiles] The list of the file - * names to be skipped for copying. + * @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 {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 {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. * @@ -60343,7 +58556,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback) { + startChaos(chaosParameters, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60352,26 +58565,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._copyImageStoreContent(imageStoreCopyDescription, options, (err, result, request, response) => { + self._startChaos(chaosParameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback); + return self._startChaos(chaosParameters, options, optionalCallback); } } /** - * @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. + * @summary Stops Chaos if it is running in the cluster and put the Chaos + * Schedule in a stopped state. * - * @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. + * 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. * @@ -60389,11 +58603,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - deleteImageStoreUploadSessionWithHttpOperationResponse(sessionId, options) { + stopChaosWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteImageStoreUploadSession(sessionId, options, (err, result, request, response) => { + self._stopChaos(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -60404,14 +58618,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Stops Chaos if it is running in the cluster and put the Chaos + * Schedule in a stopped state. * - * @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. + * 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. * @@ -60444,7 +58659,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteImageStoreUploadSession(sessionId, options, optionalCallback) { + stopChaos(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60453,31 +58668,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteImageStoreUploadSession(sessionId, options, (err, result, request, response) => { + self._stopChaos(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteImageStoreUploadSession(sessionId, options, optionalCallback); + return self._stopChaos(options, optionalCallback); } } /** - * @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. + * @summary Gets the next segment of the Chaos events based on the continuation + * token or the time range. * - * @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. + * 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 + * 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.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 @@ -60488,15 +58733,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - commitImageStoreUploadSessionWithHttpOperationResponse(sessionId, options) { + getChaosEventsWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._commitImageStoreUploadSession(sessionId, 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); } @@ -60507,19 +58752,49 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the next segment of the Chaos events based on the continuation + * token or the time range. * - * @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. + * 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 + * 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.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 @@ -60535,7 +58810,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ChaosEventsSegment} - The deserialized result object. * * @reject {Error} - The error object. * @@ -60543,13 +58818,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 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. */ - commitImageStoreUploadSession(sessionId, options, optionalCallback) { + getChaosEvents(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60558,26 +58834,22 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._commitImageStoreUploadSession(sessionId, options, (err, result, request, response) => { + self._getChaosEvents(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._commitImageStoreUploadSession(sessionId, options, optionalCallback); + return self._getChaosEvents(options, optionalCallback); } } /** - * @summary Get the image store upload session by ID. - * - * Gets the image store upload session identified by the given ID. User can - * query the upload session at any time during uploading. + * @summary Get the Chaos Schedule defining when and how to run Chaos. * - * @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. + * 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. * @@ -60591,15 +58863,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getImageStoreUploadSessionByIdWithHttpOperationResponse(sessionId, options) { + getChaosScheduleWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getImageStoreUploadSessionById(sessionId, 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); } @@ -60610,14 +58882,10 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the image store upload session by ID. - * - * Gets the image store upload session identified by the given ID. User can - * query the upload session at any time during uploading. + * @summary Get the Chaos Schedule defining when and how to run Chaos. * - * @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. + * 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. * @@ -60636,7 +58904,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {UploadSession} - The deserialized result object. + * @resolve {ChaosScheduleDescription} - The deserialized result object. * * @reject {Error} - The error object. * @@ -60645,13 +58913,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 UploadSession} for more information. + * 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. */ - getImageStoreUploadSessionById(sessionId, options, optionalCallback) { + getChaosSchedule(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60660,26 +58929,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getImageStoreUploadSessionById(sessionId, options, (err, result, request, response) => { + self._getChaosSchedule(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getImageStoreUploadSessionById(sessionId, options, optionalCallback); + return self._getChaosSchedule(options, optionalCallback); } } /** - * @summary Get the image store upload session by relative path. + * @summary Set the schedule used by Chaos. * - * 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. + * 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} contentPath Relative path to file or folder in the image - * store from its root. + * @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. * @@ -60693,15 +58981,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getImageStoreUploadSessionByPathWithHttpOperationResponse(contentPath, options) { + postChaosScheduleWithHttpOperationResponse(chaosSchedule, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getImageStoreUploadSessionByPath(contentPath, options, (err, result, request, response) => { + self._postChaosSchedule(chaosSchedule, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -60712,14 +59000,33 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Get the image store upload session by relative path. + * @summary Set the schedule used by Chaos. * - * 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. + * 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} contentPath Relative path to file or folder in the image - * store from its root. + * @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. * @@ -60738,7 +59045,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {UploadSession} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -60746,14 +59053,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 UploadSession} 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. */ - getImageStoreUploadSessionByPath(contentPath, options, optionalCallback) { + postChaosSchedule(chaosSchedule, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60762,46 +59068,35 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getImageStoreUploadSessionByPath(contentPath, options, (err, result, request, response) => { + self._postChaosSchedule(chaosSchedule, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getImageStoreUploadSessionByPath(contentPath, options, optionalCallback); + return self._postChaosSchedule(chaosSchedule, options, optionalCallback); } } /** - * @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. + * @summary Uploads contents of the file to the image store. * - * 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. + * 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 {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 @@ -60818,11 +59113,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - uploadFileChunkWithHttpOperationResponse(contentPath, sessionId, contentRange, options) { + uploadFileWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._uploadFileChunk(contentPath, sessionId, contentRange, 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); } @@ -60833,34 +59128,23 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Uploads contents of the file to the image store. * - * 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. + * 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 {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 @@ -60892,7 +59176,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - uploadFileChunk(contentPath, sessionId, contentRange, options, optionalCallback) { + uploadFile(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -60901,44 +59185,28 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._uploadFileChunk(contentPath, sessionId, contentRange, options, (err, result, request, response) => { + self._uploadFile(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._uploadFileChunk(contentPath, sessionId, contentRange, options, optionalCallback); + return self._uploadFile(contentPath, 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. - * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. + * @summary Gets the image store content information. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * 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} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @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 @@ -60949,15 +59217,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getImageStoreContentWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._invokeInfrastructureCommand(command, 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); } @@ -60968,32 +59236,16 @@ 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. - * - * Available commands and their corresponding response formats vary depending - * upon - * the infrastructure on which the cluster is running. + * @summary Gets the image store content information. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * 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} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @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 @@ -61009,7 +59261,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {ImageStoreContent} - The deserialized result object. * * @reject {Error} - The error object. * @@ -61017,13 +59269,14 @@ 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. + * {object} [result] - The deserialized result object if an error did not occur. + * 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. */ - invokeInfrastructureCommand(command, options, optionalCallback) { + getImageStoreContent(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61032,44 +59285,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._invokeInfrastructureCommand(command, options, (err, result, request, response) => { + self._getImageStoreContent(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._invokeInfrastructureCommand(command, options, optionalCallback); + return self._getImageStoreContent(contentPath, 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. + * @summary Deletes existing image store content. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * Deletes existing image store content being found within the given image + * store relative path. This command can be used to delete uploaded application + * packages once they are provisioned. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @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 @@ -61080,15 +59318,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + deleteImageStoreContentWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._invokeInfrastructureQuery(command, 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); } @@ -61099,32 +59337,17 @@ 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 Deletes existing image store content. * - * This API supports the Service Fabric platform; it is not meant to be used - * directly from your code. + * Deletes existing image store content being found within the given image + * store relative path. This command can be used to delete uploaded application + * packages once they are provisioned. * - * @param {string} command The text of the command to be invoked. The content - * of the command is infrastructure-specific. + * @param {string} contentPath Relative path to file or folder in the image + * store from its root. * * @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 @@ -61140,7 +59363,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -61148,13 +59371,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. + * {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. */ - invokeInfrastructureQuery(command, options, optionalCallback) { + deleteImageStoreContent(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61163,59 +59386,22 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._invokeInfrastructureQuery(command, options, (err, result, request, response) => { + self._deleteImageStoreContent(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._invokeInfrastructureQuery(command, options, optionalCallback); + return self._deleteImageStoreContent(contentPath, 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. - * - * 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 + * @summary Gets the content information at the root of the image store. * - * @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' + * Returns the information about the image store content at the root of the + * image store. * * @param {object} [options] Optional Parameters. * @@ -61229,15 +59415,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - startDataLossWithHttpOperationResponse(serviceId, partitionId, operationId, dataLossMode, options) { + getImageStoreRootContentWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, 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); } @@ -61248,47 +59434,10 @@ 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. - * - * 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 + * @summary Gets the content information at the root of the image store. * - * @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' + * Returns the information about the image store content at the root of the + * image store. * * @param {object} [options] Optional Parameters. * @@ -61307,7 +59456,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ImageStoreContent} - The deserialized result object. * * @reject {Error} - The error object. * @@ -61315,13 +59464,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 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. */ - startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, optionalCallback) { + getImageStoreRootContent(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61330,36 +59480,40 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, (err, result, request, response) => { + self._getImageStoreRootContent(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._getImageStoreRootContent(options, optionalCallback); } } /** - * @summary Gets the progress of a partition data loss operation started using - * the StartDataLoss API. + * @summary Copies image store content internally * - * Gets the progress of a data loss operation started with StartDataLoss, using - * the OperationId. + * Copies the image store content from the source image store relative path to + * the destination image store relative path. * - * @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} imageStoreCopyDescription Describes the copy description for + * the image store. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} imageStoreCopyDescription.remoteSource The relative path of + * source image store content to be copied from. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} imageStoreCopyDescription.remoteDestination The relative + * path of destination image store content to be copied to. + * + * @param {array} [imageStoreCopyDescription.skipFiles] The list of the file + * names to be skipped for copying. + * + * @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. * @@ -61373,15 +59527,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + copyImageStoreContentWithHttpOperationResponse(imageStoreCopyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDataLossProgress(serviceId, partitionId, operationId, 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); } @@ -61392,24 +59546,28 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the progress of a partition data loss operation started using - * the StartDataLoss API. + * @summary Copies image store content internally * - * Gets the progress of a data loss operation started with StartDataLoss, using - * the OperationId. + * Copies the image store content from the source image store relative path to + * the destination image store relative path. * - * @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} imageStoreCopyDescription Describes the copy description for + * the image store. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} imageStoreCopyDescription.remoteSource The relative path of + * source image store content to be copied from. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @param {string} imageStoreCopyDescription.remoteDestination The relative + * path of destination image store content to be copied to. + * + * @param {array} [imageStoreCopyDescription.skipFiles] The list of the file + * names to be skipped for copying. + * + * @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. * @@ -61428,7 +59586,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionDataLossProgress} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -61436,15 +59594,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 PartitionDataLossProgress} 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. */ - getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { + copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61453,48 +59609,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDataLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._copyImageStoreContent(imageStoreCopyDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback); + return self._copyImageStoreContent(imageStoreCopyDescription, options, optionalCallback); } } /** - * @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 + * @summary Cancels an image store upload session. * - * @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' + * The DELETE request will cause the existing upload session to expire and + * remove any previously uploaded file chunks. * - * @param {number} quorumLossDuration The amount of time for which the - * partition will be kept in quorum loss. This must be specified in seconds. + * @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. * @@ -61512,11 +59646,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startQuorumLossWithHttpOperationResponse(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options) { + deleteImageStoreUploadSessionWithHttpOperationResponse(sessionId, 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._deleteImageStoreUploadSession(sessionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -61527,36 +59661,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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 + * @summary Cancels an image store upload session. * - * @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' + * The DELETE request will cause the existing upload session to expire and + * remove any previously uploaded file chunks. * - * @param {number} quorumLossDuration The amount of time for which the - * partition will be kept in quorum loss. This must be specified in seconds. + * @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. * @@ -61589,7 +59701,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) { + deleteImageStoreUploadSession(sessionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61598,36 +59710,28 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, (err, result, request, response) => { + self._deleteImageStoreUploadSession(sessionId, 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._deleteImageStoreUploadSession(sessionId, 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 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. + * @summary Commit an image store upload session. * - * @param {uuid} partitionId The identity of the partition. + * 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 {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @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. * @@ -61641,15 +59745,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + commitImageStoreUploadSessionWithHttpOperationResponse(sessionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getQuorumLossProgress(serviceId, partitionId, operationId, 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); } @@ -61660,24 +59764,16 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Commit an image store upload session. * - * @param {uuid} partitionId The identity of the partition. + * 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 {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * @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. * @@ -61696,7 +59792,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionQuorumLossProgress} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -61704,15 +59800,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 PartitionQuorumLossProgress} 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. */ - getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { + commitImageStoreUploadSession(sessionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61721,45 +59815,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getQuorumLossProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._commitImageStoreUploadSession(sessionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback); + return self._commitImageStoreUploadSession(sessionId, 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 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. + * @summary Get the image store upload session by ID. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * Gets the image store upload session identified by the given ID. User can + * query the upload session at any time during uploading. * - * @param {string} restartPartitionMode Describe which partitions to restart. - * Possible values include: 'Invalid', 'AllReplicasOrInstances', - * 'OnlyActiveSecondaries' + * @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. * @@ -61773,15 +59848,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getImageStoreUploadSessionByIdWithHttpOperationResponse(sessionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, 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); } @@ -61792,33 +59867,14 @@ 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 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. + * @summary Get the image store upload session by ID. * - * @param {uuid} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * Gets the image store upload session identified by the given ID. User can + * query the upload session at any time during uploading. * - * @param {string} restartPartitionMode Describe which partitions to restart. - * Possible values include: 'Invalid', 'AllReplicasOrInstances', - * 'OnlyActiveSecondaries' + * @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. * @@ -61837,7 +59893,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. * @@ -61845,13 +59901,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. */ - startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, optionalCallback) { + getImageStoreUploadSessionById(sessionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61860,36 +59917,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, (err, result, request, response) => { + self._getImageStoreUploadSessionById(sessionId, 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._getImageStoreUploadSessionById(sessionId, 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. - * - * @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. + * @summary Get the image store upload session by relative path. * - * @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. * @@ -61903,15 +59950,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + getImageStoreUploadSessionByPathWithHttpOperationResponse(contentPath, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionRestartProgress(serviceId, partitionId, operationId, 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); } @@ -61922,24 +59969,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Get the image store upload session by relative path. * - * @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. * @@ -61958,7 +59995,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionRestartProgress} - The deserialized result object. + * @resolve {UploadSession} - The deserialized result object. * * @reject {Error} - The error object. * @@ -61967,14 +60004,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 PartitionRestartProgress} 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. */ - getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback) { + getImageStoreUploadSessionByPath(contentPath, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -61983,45 +60019,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, (err, result, request, response) => { + self._getImageStoreUploadSessionByPath(contentPath, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback); + return self._getImageStoreUploadSessionByPath(contentPath, 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 Uploads a file chunk to the image store relative path. * - * @param {string} nodeName The name of the node. + * 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} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * 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} 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} contentPath Relative path to file or folder in the image + * store from its root. * - * @param {string} nodeInstanceId The node instance ID of the target node. - * This can be determined through GetNodeInfo API. + * @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} 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} 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. * @@ -62039,11 +60075,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - startNodeTransitionWithHttpOperationResponse(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options) { + uploadFileChunkWithHttpOperationResponse(contentPath, sessionId, contentRange, 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._uploadFileChunk(contentPath, sessionId, contentRange, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -62054,33 +60090,33 @@ 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 Uploads a file chunk to the image store relative path. * - * @param {string} nodeName The name of the node. + * 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} operationId A GUID that identifies a call of this API. This - * is passed into the corresponding GetProgress API + * 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} 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} contentPath Relative path to file or folder in the image + * store from its root. * - * @param {string} nodeInstanceId The node instance ID of the target node. - * This can be determined through GetNodeInfo API. + * @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} 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} 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. * @@ -62113,7 +60149,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback) { + uploadFileChunk(contentPath, sessionId, contentRange, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62122,31 +60158,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, 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._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback); + return self._uploadFileChunk(contentPath, sessionId, contentRange, options, optionalCallback); } } /** - * @summary Gets the progress of an operation started using - * StartNodeTransition. + * @summary Invokes an administrative command on the given Infrastructure + * Service instance. * - * Gets the progress of an operation started with StartNodeTransition using the - * provided OperationId. + * 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} nodeName The name of the node. + * 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} 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 @@ -62157,15 +60206,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + invokeInfrastructureCommandWithHttpOperationResponse(command, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeTransitionProgress(nodeName, operationId, 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); } @@ -62176,19 +60225,32 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the progress of an operation started using - * StartNodeTransition. + * @summary Invokes an administrative command on the given Infrastructure + * Service instance. * - * Gets the progress of an operation started with StartNodeTransition using the - * provided OperationId. + * 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} nodeName The name of the node. + * 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} 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 @@ -62204,7 +60266,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {NodeTransitionProgress} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -62212,15 +60274,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. + * {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. */ - getNodeTransitionProgress(nodeName, operationId, options, optionalCallback) { + invokeInfrastructureCommand(command, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62229,45 +60289,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeTransitionProgress(nodeName, operationId, options, (err, result, request, response) => { + self._invokeInfrastructureCommand(command, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeTransitionProgress(nodeName, operationId, options, optionalCallback); + return self._invokeInfrastructureCommand(command, 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. + * @summary Invokes a read-only query on the given infrastructure service + * instance. * - * @param {number} typeFilter Used to filter on OperationType for user-induced - * operations. + * 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. * - * - 65535 - select all - * - 1 - select PartitionDataLoss. - * - 2 - select PartitionQuorumLoss. - * - 4 - select PartitionRestart. - * - 8 - select NodeTransition. + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * - * @param {number} stateFilter Used to filter on OperationState's for - * user-induced operations. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * - 65535 - select All - * - 1 - select Running - * - 2 - select RollingBack - * - 8 - select Completed - * - 16 - select Faulted - * - 32 - select Cancelled - * - 64 - select ForceCancelled + * @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 @@ -62278,15 +60337,15 @@ class ServiceFabricClient extends ServiceClient { * * @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) { + invokeInfrastructureQueryWithHttpOperationResponse(command, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getFaultOperationList(typeFilter, stateFilter, options, (err, result, request, response) => { + self._invokeInfrastructureQuery(command, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -62297,33 +60356,32 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Invokes a read-only query on the given infrastructure service + * instance. * - * @param {number} typeFilter Used to filter on OperationType for user-induced - * operations. + * 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. * - * - 65535 - select all - * - 1 - select PartitionDataLoss. - * - 2 - select PartitionQuorumLoss. - * - 4 - select PartitionRestart. - * - 8 - select NodeTransition. + * Available commands and their corresponding response formats vary depending + * upon + * the infrastructure on which the cluster is running. * - * @param {number} stateFilter Used to filter on OperationState's for - * user-induced operations. + * This API supports the Service Fabric platform; it is not meant to be used + * directly from your code. * - * - 65535 - select All - * - 1 - select Running - * - 2 - select RollingBack - * - 8 - select Completed - * - 16 - select Faulted - * - 32 - select Cancelled - * - 64 - select ForceCancelled + * @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 @@ -62339,7 +60397,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -62347,13 +60405,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. + * {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. */ - getFaultOperationList(typeFilter, stateFilter, options, optionalCallback) { + invokeInfrastructureQuery(command, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62362,50 +60420,59 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getFaultOperationList(typeFilter, stateFilter, options, (err, result, request, response) => { + self._invokeInfrastructureQuery(command, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getFaultOperationList(typeFilter, stateFilter, options, optionalCallback); + return self._invokeInfrastructureQuery(command, options, optionalCallback); } } /** - * @summary Cancels a user-induced fault operation. + * @summary This API will induce data loss for the specified partition. It will + * trigger a call to the OnDataLossAsync API of the partition. * - * The following APIs start fault operations that may be cancelled by using - * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, - * StartNodeTransition. + * 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. * - * 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. + * - 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. * - * Important note: if this API is invoked with force==true, internal state may - * be left behind. + * 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 {boolean} force Indicates whether to gracefully rollback and clean up - * internal system state modified by executing the user-induced operation. + * @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. * @@ -62423,11 +60490,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - cancelOperationWithHttpOperationResponse(operationId, force, options) { + startDataLossWithHttpOperationResponse(serviceId, partitionId, operationId, dataLossMode, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._cancelOperation(operationId, force, 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); } @@ -62438,38 +60505,47 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Cancels a user-induced fault operation. + * @summary This API will induce data loss for the specified partition. It will + * trigger a call to the OnDataLossAsync API of the partition. * - * The following APIs start fault operations that may be cancelled by using - * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, - * StartNodeTransition. + * 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. * - * 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. + * - 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. * - * Important note: if this API is invoked with force==true, internal state may - * be left behind. + * 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 {boolean} force Indicates whether to gracefully rollback and clean up - * internal system state modified by executing the user-induced operation. + * @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. * @@ -62502,7 +60578,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - cancelOperation(operationId, force, options, optionalCallback) { + startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62511,55 +60587,36 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._cancelOperation(operationId, force, 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._cancelOperation(operationId, force, options, optionalCallback); + return self._startDataLoss(serviceId, partitionId, operationId, dataLossMode, options, optionalCallback); } } /** - * @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. + * @summary Gets the progress of a partition data loss operation started using + * the StartDataLoss API. * - * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic - * Discriminator + * Gets the progress of a data loss operation started with StartDataLoss, using + * the OperationId. * - * @param {object} backupPolicyDescription.storage Describes the details of - * backup storage where to store the periodic backups. + * @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} [backupPolicyDescription.storage.friendlyName] Friendly name - * for this backup storage. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} backupPolicyDescription.storage.storageKind Polymorphic - * Discriminator + * @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. * @@ -62573,15 +60630,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createBackupPolicyWithHttpOperationResponse(backupPolicyDescription, options) { + getDataLossProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createBackupPolicy(backupPolicyDescription, 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); } @@ -62592,43 +60649,24 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the progress of a partition data loss operation started using + * the StartDataLoss API. * - * @param {string} backupPolicyDescription.schedule.scheduleKind Polymorphic - * Discriminator + * Gets the progress of a data loss operation started with StartDataLoss, using + * the OperationId. * - * @param {object} backupPolicyDescription.storage Describes the details of - * backup storage where to store the periodic backups. + * @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} [backupPolicyDescription.storage.friendlyName] Friendly name - * for this backup storage. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} backupPolicyDescription.storage.storageKind Polymorphic - * Discriminator + * @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. * @@ -62647,7 +60685,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PartitionDataLossProgress} - The deserialized result object. * * @reject {Error} - The error object. * @@ -62655,13 +60693,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 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. */ - createBackupPolicy(backupPolicyDescription, options, optionalCallback) { + getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62670,26 +60710,48 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createBackupPolicy(backupPolicyDescription, 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._createBackupPolicy(backupPolicyDescription, options, optionalCallback); + return self._getDataLossProgress(serviceId, partitionId, operationId, options, optionalCallback); } } /** - * @summary Deletes the backup policy. + * @summary Induces quorum loss for a given stateful service partition. * - * 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. + * This API is useful for a temporary quorum loss situation on your service. * - * @param {string} backupPolicyName The name of the backup policy. + * 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. * @@ -62707,11 +60769,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - deleteBackupPolicyWithHttpOperationResponse(backupPolicyName, options) { + startQuorumLossWithHttpOperationResponse(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteBackupPolicy(backupPolicyName, 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); } @@ -62722,14 +60784,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes the backup policy. + * @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. * - * 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 {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. * @@ -62762,7 +60846,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteBackupPolicy(backupPolicyName, options, optionalCallback) { + startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62771,39 +60855,38 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteBackupPolicy(backupPolicyName, 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._deleteBackupPolicy(backupPolicyName, options, optionalCallback); + return self._startQuorumLoss(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, options, optionalCallback); } } /** - * @summary Gets all the backup policies configured. + * @summary Gets the progress of a quorum loss operation on a partition started + * using the StartQuorumLoss API. * - * Get a list of all the backup policies configured. + * Gets the progress of a quorum loss operation started with StartQuorumLoss, + * using the provided OperationId. * - * @param {object} [options] Optional Parameters. + * @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} [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} partitionId The identity of the partition. * - * @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 {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 @@ -62815,15 +60898,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getBackupPolicyListWithHttpOperationResponse(options) { + getQuorumLossProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getBackupPolicyList(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); } @@ -62834,27 +60917,26 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all the backup policies configured. + * @summary Gets the progress of a quorum loss operation on a partition started + * using the StartQuorumLoss API. * - * Get a list of all the backup policies configured. + * Gets the progress of a quorum loss operation started with StartQuorumLoss, + * using the provided OperationId. * - * @param {object} [options] Optional Parameters. + * @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} [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} partitionId The identity of the partition. * - * @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 {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 @@ -62871,7 +60953,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupPolicyDescriptionList} - The deserialized result object. + * @resolve {PartitionQuorumLossProgress} - The deserialized result object. * * @reject {Error} - The error object. * @@ -62880,14 +60962,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 PagedBackupPolicyDescriptionList} 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. */ - getBackupPolicyList(options, optionalCallback) { + getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62896,23 +60978,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getBackupPolicyList(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._getBackupPolicyList(options, optionalCallback); + return self._getQuorumLossProgress(serviceId, partitionId, operationId, options, optionalCallback); } } /** - * @summary Gets a particular backup policy by name. + * @summary This API will restart some or all replicas or instances of the + * specified partition. * - * Gets a particular backup policy identified by {backupPolicyName} + * This API is useful for testing failover. * - * @param {string} backupPolicyName The name of the backup policy. + * 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. * @@ -62926,15 +61030,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getBackupPolicyByNameWithHttpOperationResponse(backupPolicyName, options) { + startPartitionRestartWithHttpOperationResponse(serviceId, partitionId, operationId, restartPartitionMode, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getBackupPolicyByName(backupPolicyName, 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); } @@ -62945,11 +61049,33 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a particular backup policy by name. + * @summary This API will restart some or all replicas or instances of the + * specified partition. * - * Gets a particular backup policy identified by {backupPolicyName} + * This API is useful for testing failover. * - * @param {string} backupPolicyName The name of the backup policy. + * 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. * @@ -62968,7 +61094,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {BackupPolicyDescription} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -62976,15 +61102,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 BackupPolicyDescription} 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. */ - getBackupPolicyByName(backupPolicyName, options, optionalCallback) { + startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -62993,43 +61117,38 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getBackupPolicyByName(backupPolicyName, 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._getBackupPolicyByName(backupPolicyName, options, optionalCallback); + return self._startPartitionRestart(serviceId, partitionId, operationId, restartPartitionMode, options, optionalCallback); } } /** - * @summary Gets the list of backup entities that are associated with this - * policy. + * @summary Gets the progress of a PartitionRestart operation started using + * StartPartitionRestart. * - * Returns a list of Service Fabric application, service or partition which are - * associated with this backup policy. + * Gets the progress of a PartitionRestart started with StartPartitionRestart + * using the provided OperationId. * - * @param {string} backupPolicyName The name of the backup policy. + * @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 {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 @@ -63041,15 +61160,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getAllEntitiesBackedUpByPolicyWithHttpOperationResponse(backupPolicyName, options) { + getPartitionRestartProgressWithHttpOperationResponse(serviceId, partitionId, operationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getAllEntitiesBackedUpByPolicy(backupPolicyName, 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); } @@ -63060,31 +61179,26 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of backup entities that are associated with this - * policy. + * @summary Gets the progress of a PartitionRestart operation started using + * StartPartitionRestart. * - * Returns a list of Service Fabric application, service or partition which are - * associated with this backup policy. + * Gets the progress of a PartitionRestart started with StartPartitionRestart + * using the provided OperationId. * - * @param {string} backupPolicyName The name of the backup policy. + * @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 {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 @@ -63101,7 +61215,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupEntityList} - The deserialized result object. + * @resolve {PartitionRestartProgress} - The deserialized result object. * * @reject {Error} - The error object. * @@ -63110,13 +61224,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 PagedBackupEntityList} 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. */ - getAllEntitiesBackedUpByPolicy(backupPolicyName, options, optionalCallback) { + getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -63125,56 +61240,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAllEntitiesBackedUpByPolicy(backupPolicyName, 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._getAllEntitiesBackedUpByPolicy(backupPolicyName, options, optionalCallback); + return self._getPartitionRestartProgress(serviceId, partitionId, operationId, options, optionalCallback); } } /** - * @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. + * @summary Starts or stops a cluster node. * - * @param {object} backupPolicyDescription.schedule Describes the backup - * schedule parameters. + * 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} backupPolicyDescription.schedule.scheduleKind Polymorphic - * Discriminator + * @param {string} nodeName The name of the node. * - * @param {object} backupPolicyDescription.storage Describes the details of - * backup storage where to store the periodic backups. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * - * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name - * for this backup storage. + * @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} backupPolicyDescription.storage.storageKind Polymorphic - * Discriminator + * @param {string} nodeInstanceId The node instance ID of the target node. + * This can be determined through GetNodeInfo API. * - * @param {string} backupPolicyName The name of the backup policy. + * @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. * @@ -63192,11 +61296,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - updateBackupPolicyWithHttpOperationResponse(backupPolicyDescription, backupPolicyName, options) { + startNodeTransitionWithHttpOperationResponse(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateBackupPolicy(backupPolicyDescription, backupPolicyName, 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); } @@ -63207,44 +61311,33 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Starts or stops a cluster node. * - * @param {object} backupPolicyDescription.schedule Describes the backup - * schedule parameters. + * 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} backupPolicyDescription.schedule.scheduleKind Polymorphic - * Discriminator + * @param {string} nodeName The name of the node. * - * @param {object} backupPolicyDescription.storage Describes the details of - * backup storage where to store the periodic backups. + * @param {uuid} operationId A GUID that identifies a call of this API. This + * is passed into the corresponding GetProgress API * - * @param {string} [backupPolicyDescription.storage.friendlyName] Friendly name - * for this backup storage. + * @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} backupPolicyDescription.storage.storageKind Polymorphic - * Discriminator + * @param {string} nodeInstanceId The node instance ID of the target node. + * This can be determined through GetNodeInfo API. * - * @param {string} backupPolicyName The name of the backup policy. + * @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. * @@ -63277,7 +61370,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, optionalCallback) { + startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -63286,40 +61379,28 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateBackupPolicy(backupPolicyDescription, backupPolicyName, 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._updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, optionalCallback); + return self._startNodeTransition(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, options, optionalCallback); } } /** - * @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. + * @summary Gets the progress of an operation started using + * StartNodeTransition. * - * @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 progress of an operation started with StartNodeTransition using the + * provided OperationId. * - * @param {object} enableBackupDescription Specifies the parameters for - * enabling backup. + * @param {string} nodeName The name of the node. * - * @param {string} enableBackupDescription.backupPolicyName Name of the backup - * policy to be used for enabling periodic backups. + * @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. * @@ -63333,15 +61414,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - enableApplicationBackupWithHttpOperationResponse(applicationId, enableBackupDescription, options) { + getNodeTransitionProgressWithHttpOperationResponse(nodeName, operationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._enableApplicationBackup(applicationId, enableBackupDescription, options, (err, result, request, response) => { + self._getNodeTransitionProgress(nodeName, operationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -63352,28 +61433,16 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the progress of an operation started using + * StartNodeTransition. * - * @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 progress of an operation started with StartNodeTransition using the + * provided OperationId. * - * @param {object} enableBackupDescription Specifies the parameters for - * enabling backup. + * @param {string} nodeName The name of the node. * - * @param {string} enableBackupDescription.backupPolicyName Name of the backup - * policy to be used for enabling periodic backups. + * @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. * @@ -63392,7 +61461,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {NodeTransitionProgress} - The deserialized result object. * * @reject {Error} - The error object. * @@ -63400,13 +61469,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 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. */ - enableApplicationBackup(applicationId, enableBackupDescription, options, optionalCallback) { + getNodeTransitionProgress(nodeName, operationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -63415,30 +61486,42 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._enableApplicationBackup(applicationId, enableBackupDescription, options, (err, result, request, response) => { + self._getNodeTransitionProgress(nodeName, operationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._enableApplicationBackup(applicationId, enableBackupDescription, options, optionalCallback); + return self._getNodeTransitionProgress(nodeName, operationId, options, optionalCallback); } } /** - * @summary Disables periodic backup of Service Fabric application. + * @summary Gets a list of user-induced fault operations filtered by provided + * input. * - * Disables periodic backup of Service Fabric application which was previously - * enabled. + * Gets the list of user-induced fault operations filtered by provided input. * - * @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} 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. * @@ -63452,15 +61535,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - disableApplicationBackupWithHttpOperationResponse(applicationId, options) { + getFaultOperationListWithHttpOperationResponse(typeFilter, stateFilter, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._disableApplicationBackup(applicationId, 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); } @@ -63471,18 +61554,30 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Disables periodic backup of Service Fabric application. + * @summary Gets a list of user-induced fault operations filtered by provided + * input. * - * Disables periodic backup of Service Fabric application which was previously - * enabled. + * Gets the list of user-induced fault operations filtered by provided input. * - * @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} 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. * @@ -63501,7 +61596,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. * @@ -63509,13 +61604,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. */ - disableApplicationBackup(applicationId, options, optionalCallback) { + getFaultOperationList(typeFilter, stateFilter, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -63524,49 +61619,52 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._disableApplicationBackup(applicationId, 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._disableApplicationBackup(applicationId, options, optionalCallback); + return self._getFaultOperationList(typeFilter, stateFilter, options, optionalCallback); } } /** - * @summary Gets the Service Fabric application backup configuration - * information. + * @summary Cancels a user-induced fault operation. * - * Gets the Service Fabric backup configuration information for the application - * and the services and partitions under this application. + * The following APIs start fault operations that may be cancelled by using + * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, + * StartNodeTransition. * - * @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. + * 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. * - * @param {object} [options] Optional Parameters. + * Important note: if this API is invoked with force==true, internal state may + * be left behind. * - * @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 {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 {boolean} force Indicates whether to gracefully roll back 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 @@ -63578,15 +61676,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationBackupConfigurationInfoWithHttpOperationResponse(applicationId, options) { + cancelOperationWithHttpOperationResponse(operationId, force, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationBackupConfigurationInfo(applicationId, 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); } @@ -63597,37 +61695,40 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the Service Fabric application backup configuration - * information. + * @summary Cancels a user-induced fault operation. * - * Gets the Service Fabric backup configuration information for the application - * and the services and partitions under this application. + * The following APIs start fault operations that may be cancelled by using + * CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, + * StartNodeTransition. * - * @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. + * 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. * - * @param {object} [options] Optional Parameters. + * Important note: if this API is invoked with force==true, internal state may + * be left behind. * - * @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 {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 {boolean} force Indicates whether to gracefully roll back 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 @@ -63644,7 +61745,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupConfigurationInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -63652,15 +61753,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 PagedBackupConfigurationInfoList} 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. */ - getApplicationBackupConfigurationInfo(applicationId, options, optionalCallback) { + cancelOperation(operationId, force, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -63669,85 +61768,83 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationBackupConfigurationInfo(applicationId, 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._getApplicationBackupConfigurationInfo(applicationId, options, optionalCallback); + return self._cancelOperation(operationId, force, options, optionalCallback); } } /** - * @summary Gets the list of backups available for every partition in this - * application. + * @summary Creates a backup policy. * - * 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. + * Creates a backup policy which can be associated later with a Service Fabric + * application, service or a partition 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} backupPolicyDescription Describes the backup policy. * - * @param {object} [options] Optional Parameters. + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time 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} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. * - * @param {boolean} [options.latest] Specifies whether to get only the most - * recent backup available for a partition for the specified time range. + * @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} [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 {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. * - * @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} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator * - * @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} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. * - * @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 {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getApplicationBackupListWithHttpOperationResponse(applicationId, options) { + createBackupPolicyWithHttpOperationResponse(backupPolicyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationBackupList(applicationId, 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); } @@ -63758,58 +61855,56 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of backups available for every partition in this - * application. + * @summary Creates a backup policy. * - * 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. + * Creates a backup policy which can be associated later with a Service Fabric + * application, service or a partition 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} backupPolicyDescription Describes the backup policy. * - * @param {object} [options] Optional Parameters. + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time 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} backupPolicyDescription.autoRestoreOnDataLoss Specifies + * whether to trigger restore automatically using the latest available backup + * in case the partition experiences a data loss event. * - * @param {boolean} [options.latest] Specifies whether to get only the most - * recent backup available for a partition for the specified time range. + * @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} [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 {object} backupPolicyDescription.schedule Describes the backup + * schedule parameters. * - * @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} backupPolicyDescription.schedule.scheduleKind Polymorphic + * Discriminator * - * @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} backupPolicyDescription.storage Describes the details of + * backup storage where to store the periodic backups. * - * @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 {string} [backupPolicyDescription.storage.friendlyName] Friendly name + * for this backup storage. + * + * @param {string} backupPolicyDescription.storage.storageKind Polymorphic + * Discriminator + * + * @param {object} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * 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 @@ -63821,7 +61916,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -63829,14 +61924,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 PagedBackupInfoList} 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. */ - getApplicationBackupList(applicationId, options, optionalCallback) { + createBackupPolicy(backupPolicyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -63845,33 +61939,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationBackupList(applicationId, options, (err, result, request, response) => { + self._createBackupPolicy(backupPolicyDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationBackupList(applicationId, options, optionalCallback); + return self._createBackupPolicy(backupPolicyDescription, options, optionalCallback); } } /** - * @summary Suspends periodic backup for the specified Service Fabric - * application. + * @summary Deletes the backup policy. * - * 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. + * 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} 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} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * @@ -63889,11 +61976,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - suspendApplicationBackupWithHttpOperationResponse(applicationId, options) { + deleteBackupPolicyWithHttpOperationResponse(backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._suspendApplicationBackup(applicationId, 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); } @@ -63904,21 +61991,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Suspends periodic backup for the specified Service Fabric - * application. + * @summary Deletes the backup policy. * - * 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. + * 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} 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} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * @@ -63951,7 +62031,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - suspendApplicationBackup(applicationId, options, optionalCallback) { + deleteBackupPolicy(backupPolicyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -63960,34 +62040,40 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._suspendApplicationBackup(applicationId, options, (err, result, request, response) => { + self._deleteBackupPolicy(backupPolicyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._suspendApplicationBackup(applicationId, options, optionalCallback); + return self._deleteBackupPolicy(backupPolicyName, options, optionalCallback); } } /** - * @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. + * @summary Gets all the backup policies configured. * - * @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. + * 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 @@ -63998,15 +62084,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resumeApplicationBackupWithHttpOperationResponse(applicationId, options) { + getBackupPolicyListWithHttpOperationResponse(options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resumeApplicationBackup(applicationId, 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); } @@ -64017,22 +62103,28 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets all the backup policies configured. * - * @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. + * 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 @@ -64048,7 +62140,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. * @@ -64056,13 +62148,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. */ - resumeApplicationBackup(applicationId, options, optionalCallback) { + getBackupPolicyList(options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64071,43 +62165,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resumeApplicationBackup(applicationId, options, (err, result, request, response) => { + self._getBackupPolicyList(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resumeApplicationBackup(applicationId, options, optionalCallback); + return self._getBackupPolicyList(options, optionalCallback); } } /** - * @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. + * @summary Gets a particular backup policy by name. * - * @param {object} enableBackupDescription Specifies the parameters for - * enabling backup. + * Gets a particular backup policy identified by {backupPolicyName} * - * @param {string} enableBackupDescription.backupPolicyName Name of the backup - * policy to be used for enabling periodic backups. + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * @@ -64121,15 +62195,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - enableServiceBackupWithHttpOperationResponse(serviceId, enableBackupDescription, options) { + getBackupPolicyByNameWithHttpOperationResponse(backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._enableServiceBackup(serviceId, enableBackupDescription, 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); } @@ -64140,31 +62214,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets a particular backup policy by name. * - * @param {object} enableBackupDescription Specifies the parameters for - * enabling backup. + * Gets a particular backup policy identified by {backupPolicyName} * - * @param {string} enableBackupDescription.backupPolicyName Name of the backup - * policy to be used for enabling periodic backups. + * @param {string} backupPolicyName The name of the backup policy. * * @param {object} [options] Optional Parameters. * @@ -64183,7 +62237,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. * @@ -64191,13 +62245,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. */ - enableServiceBackup(serviceId, enableBackupDescription, options, optionalCallback) { + getBackupPolicyByName(backupPolicyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64206,37 +62262,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._enableServiceBackup(serviceId, enableBackupDescription, options, (err, result, request, response) => { + self._getBackupPolicyByName(backupPolicyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._enableServiceBackup(serviceId, enableBackupDescription, options, optionalCallback); + return self._getBackupPolicyByName(backupPolicyName, options, optionalCallback); } } /** - * @summary Disables periodic backup of Service Fabric service which was - * previously enabled. + * @summary Gets the list of backup entities that are associated with this + * policy. * - * 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. + * Returns a list of Service Fabric application, service or partition which are + * associated with this backup policy. * - * @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} 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 @@ -64247,15 +62310,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - disableServiceBackupWithHttpOperationResponse(serviceId, options) { + getAllEntitiesBackedUpByPolicyWithHttpOperationResponse(backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._disableServiceBackup(serviceId, 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); } @@ -64266,25 +62329,32 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Disables periodic backup of Service Fabric service which was - * previously enabled. + * @summary Gets the list of backup entities that are associated with this + * policy. * - * 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. + * Returns a list of Service Fabric application, service or partition which are + * associated with this backup policy. * - * @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} 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 @@ -64300,7 +62370,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. * @@ -64308,13 +62378,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. */ - disableServiceBackup(serviceId, options, optionalCallback) { + getAllEntitiesBackedUpByPolicy(backupPolicyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64323,48 +62394,64 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._disableServiceBackup(serviceId, options, (err, result, request, response) => { + self._getAllEntitiesBackedUpByPolicy(backupPolicyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._disableServiceBackup(serviceId, options, optionalCallback); + return self._getAllEntitiesBackedUpByPolicy(backupPolicyName, options, optionalCallback); } } /** - * @summary Gets the Service Fabric service backup configuration information. + * @summary Updates the backup policy. * - * Gets the Service Fabric backup configuration information for the service and - * the partitions under this service. + * Updates the backup policy identified by {backupPolicyName} * - * @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} backupPolicyDescription Describes the backup policy. * - * @param {object} [options] Optional Parameters. + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. * - * @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 {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} [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} 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} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * 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 @@ -64376,15 +62463,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceBackupConfigurationInfoWithHttpOperationResponse(serviceId, options) { + updateBackupPolicyWithHttpOperationResponse(backupPolicyDescription, backupPolicyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceBackupConfigurationInfo(serviceId, 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); } @@ -64395,36 +62482,52 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the Service Fabric service backup configuration information. + * @summary Updates the backup policy. * - * Gets the Service Fabric backup configuration information for the service and - * the partitions under this service. + * Updates the backup policy identified by {backupPolicyName} * - * @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} backupPolicyDescription Describes the backup policy. * - * @param {object} [options] Optional Parameters. + * @param {string} backupPolicyDescription.name The unique name identifying + * this backup policy. * - * @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 {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} [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} 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} [backupPolicyDescription.retentionPolicy] Describes the + * policy to retain backups in storage. + * + * @param {string} backupPolicyDescription.retentionPolicy.retentionPolicyType + * 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 @@ -64441,7 +62544,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupConfigurationInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -64449,15 +62552,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 PagedBackupConfigurationInfoList} 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. */ - getServiceBackupConfigurationInfo(serviceId, options, optionalCallback) { + updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64466,35 +62567,41 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceBackupConfigurationInfo(serviceId, options, (err, result, request, response) => { + self._updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getServiceBackupConfigurationInfo(serviceId, options, optionalCallback); + return self._updateBackupPolicy(backupPolicyDescription, backupPolicyName, options, optionalCallback); } } /** - * @summary Gets the list of backups available for every partition in this - * service. + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric application. * - * 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. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -64502,49 +62609,20 @@ class ServiceFabricClient extends ServiceClient { * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceBackupListWithHttpOperationResponse(serviceId, options) { + enableApplicationBackupWithHttpOperationResponse(applicationId, enableBackupDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceBackupList(serviceId, options, (err, result, request, response) => { + self._enableApplicationBackup(applicationId, enableBackupDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -64555,23 +62633,29 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of backups available for every partition in this - * service. + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric application. * - * 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. + * 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} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -64579,35 +62663,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -64618,7 +62673,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -64626,14 +62681,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 PagedBackupInfoList} 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. */ - getServiceBackupList(serviceId, options, optionalCallback) { + enableApplicationBackup(applicationId, enableBackupDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64642,31 +62696,29 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceBackupList(serviceId, 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._getServiceBackupList(serviceId, options, optionalCallback); + return self._enableApplicationBackup(applicationId, enableBackupDescription, options, optionalCallback); } } /** - * @summary Suspends periodic backup for the specified Service Fabric service. + * @summary Disables periodic backup of Service Fabric application. * - * 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. + * Disables periodic backup of Service Fabric application which was previously + * enabled. * - * @param {string} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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. @@ -64676,6 +62728,13 @@ class ServiceFabricClient extends ServiceClient { * client is willing to wait for the requested operation to complete. The * default value for this parameter is 60 seconds. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -64685,11 +62744,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - suspendServiceBackupWithHttpOperationResponse(serviceId, options) { + disableApplicationBackupWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._suspendServiceBackup(serviceId, 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); } @@ -64700,19 +62759,17 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Suspends periodic backup for the specified Service Fabric service. + * @summary Disables periodic backup of Service Fabric application. * - * 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. + * Disables periodic backup of Service Fabric application which was previously + * enabled. * - * @param {string} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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. @@ -64722,6 +62779,13 @@ class ServiceFabricClient extends ServiceClient { * client is willing to wait for the requested operation to complete. The * default value for this parameter is 60 seconds. * + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -64746,7 +62810,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - suspendServiceBackup(serviceId, options, optionalCallback) { + disableApplicationBackup(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64755,34 +62819,50 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._suspendServiceBackup(serviceId, options, (err, result, request, response) => { + self._disableApplicationBackup(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._suspendServiceBackup(serviceId, options, optionalCallback); + return self._disableApplicationBackup(applicationId, options, optionalCallback); } } /** - * @summary Resumes periodic backup of a Service Fabric service which was - * previously suspended. + * @summary Gets the Service Fabric application backup configuration + * information. * - * The previously suspended Service Fabric service resumes taking periodic - * backup as per the backup policy currently configured for the same. + * Gets the Service Fabric backup configuration information for the application + * and the services and partitions under this application. * - * @param {string} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -64793,15 +62873,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resumeServiceBackupWithHttpOperationResponse(serviceId, options) { + getApplicationBackupConfigurationInfoWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resumeServiceBackup(serviceId, 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); } @@ -64812,22 +62892,38 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resumes periodic backup of a Service Fabric service which was - * previously suspended. + * @summary Gets the Service Fabric application backup configuration + * information. * - * The previously suspended Service Fabric service resumes taking periodic - * backup as per the backup policy currently configured for the same. + * Gets the Service Fabric backup configuration information for the application + * and the services and partitions under this application. * - * @param {string} serviceId The identity of the service. This ID is typically - * the full name of the service without the 'fabric:' URI scheme. + * @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 service name is "fabric:/myapp/app1/svc1", the service - * identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in + * 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 @@ -64843,7 +62939,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. * @@ -64851,13 +62947,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. */ - resumeServiceBackup(serviceId, options, optionalCallback) { + getApplicationBackupConfigurationInfo(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64866,35 +62964,34 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resumeServiceBackup(serviceId, options, (err, result, request, response) => { + self._getApplicationBackupConfigurationInfo(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resumeServiceBackup(serviceId, options, optionalCallback); + return self._getApplicationBackupConfigurationInfo(applicationId, options, optionalCallback); } } /** - * @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. + * @summary Gets the list of backups available for every partition in this + * application. * - * @param {string} enableBackupDescription.backupPolicyName Name of the backup - * policy to be used for enabling periodic backups. + * 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. * @@ -64903,20 +63000,49 @@ class ServiceFabricClient extends ServiceClient { * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - enablePartitionBackupWithHttpOperationResponse(partitionId, enableBackupDescription, options) { + getApplicationBackupListWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._enablePartitionBackup(partitionId, enableBackupDescription, 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); } @@ -64927,23 +63053,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets the list of backups available for every partition in this + * application. * - * @param {object} enableBackupDescription Specifies the parameters for - * enabling backup. + * 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} enableBackupDescription.backupPolicyName Name of the backup - * policy to be used for enabling periodic backups. + * @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. * @@ -64952,6 +63077,35 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -64962,7 +63116,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. * @@ -64970,13 +63124,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. */ - enablePartitionBackup(partitionId, enableBackupDescription, options, optionalCallback) { + getApplicationBackupList(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -64985,28 +63140,33 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._enablePartitionBackup(partitionId, enableBackupDescription, options, (err, result, request, response) => { + self._getApplicationBackupList(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._enablePartitionBackup(partitionId, enableBackupDescription, options, optionalCallback); + return self._getApplicationBackupList(applicationId, options, optionalCallback); } } /** - * @summary Disables periodic backup of Service Fabric partition which was - * previously enabled. + * @summary Suspends periodic backup for the specified Service Fabric + * application. * - * 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. + * 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 {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. * @@ -65024,11 +63184,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - disablePartitionBackupWithHttpOperationResponse(partitionId, options) { + suspendApplicationBackupWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._disablePartitionBackup(partitionId, 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); } @@ -65039,16 +63199,21 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Disables periodic backup of Service Fabric partition which was - * previously enabled. + * @summary Suspends periodic backup for the specified Service Fabric + * application. * - * 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. + * 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 {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. * @@ -65081,7 +63246,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - disablePartitionBackup(partitionId, options, optionalCallback) { + suspendApplicationBackup(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65090,24 +63255,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._disablePartitionBackup(partitionId, options, (err, result, request, response) => { + self._suspendApplicationBackup(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._disablePartitionBackup(partitionId, options, optionalCallback); + return self._suspendApplicationBackup(applicationId, options, optionalCallback); } } /** - * @summary Gets the partition backup configuration information + * @summary Resumes periodic backup of a Service Fabric application which was + * previously suspended. * - * Gets the Service Fabric Backup configuration information for the specified - * partition. + * The previously suspended Service Fabric application resumes taking periodic + * backup as per the backup policy currently configured for the same. * - * @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. * @@ -65121,15 +63293,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionBackupConfigurationInfoWithHttpOperationResponse(partitionId, options) { + resumeApplicationBackupWithHttpOperationResponse(applicationId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionBackupConfigurationInfo(partitionId, 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); } @@ -65140,12 +63312,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the partition backup configuration information + * @summary Resumes periodic backup of a Service Fabric application which was + * previously suspended. * - * Gets the Service Fabric Backup configuration information for the specified - * partition. + * The previously suspended Service Fabric application resumes taking periodic + * backup as per the backup policy currently configured for the same. * - * @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. * @@ -65164,7 +63343,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PartitionBackupConfigurationInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -65172,15 +63351,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 PartitionBackupConfigurationInfo} 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. */ - getPartitionBackupConfigurationInfo(partitionId, options, optionalCallback) { + resumeApplicationBackup(applicationId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65189,26 +63366,43 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionBackupConfigurationInfo(partitionId, options, (err, result, request, response) => { + self._resumeApplicationBackup(applicationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionBackupConfigurationInfo(partitionId, options, optionalCallback); + return self._resumeApplicationBackup(applicationId, options, optionalCallback); } } /** - * @summary Gets the list of backups available for the specified partition. + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric service. * - * 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. + * 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 {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} 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. * @@ -65217,33 +63411,20 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getPartitionBackupListWithHttpOperationResponse(partitionId, options) { + enableServiceBackupWithHttpOperationResponse(serviceId, enableBackupDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionBackupList(partitionId, 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); } @@ -65254,14 +63435,31 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the list of backups available for the specified partition. + * @summary Enables periodic backup of stateful partitions under this Service + * Fabric service. * - * 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. + * 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 {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} 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. * @@ -65270,19 +63468,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -65293,7 +63478,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -65301,14 +63486,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 PagedBackupInfoList} 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. */ - getPartitionBackupList(partitionId, options, optionalCallback) { + enableServiceBackup(serviceId, enableBackupDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65317,27 +63501,44 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionBackupList(partitionId, 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._getPartitionBackupList(partitionId, options, optionalCallback); + return self._enableServiceBackup(serviceId, enableBackupDescription, options, optionalCallback); } } /** - * @summary Suspends periodic backup for the specified partition. + * @summary Disables periodic backup of Service Fabric service which was + * previously enabled. * - * The partition which is configured to take periodic backups, is suspended for - * taking further backups till it is resumed again. + * 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 {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -65352,11 +63553,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - suspendPartitionBackupWithHttpOperationResponse(partitionId, options) { + disableServiceBackupWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._suspendPartitionBackup(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); } @@ -65367,15 +63568,32 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Suspends periodic backup for the specified partition. + * @summary Disables periodic backup of Service Fabric service which was + * previously enabled. * - * The partition which is configured to take periodic backups, is suspended for - * taking further backups till it is resumed again. + * 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 {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. + * + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. + * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time duration that the * client is willing to wait for the requested operation to complete. The @@ -65405,7 +63623,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - suspendPartitionBackup(partitionId, options, optionalCallback) { + disableServiceBackup(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65414,28 +63632,49 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._suspendPartitionBackup(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._suspendPartitionBackup(partitionId, options, optionalCallback); + return self._disableServiceBackup(serviceId, options, optionalCallback); } } /** - * @summary Resumes periodic backup of partition which was previously - * suspended. + * @summary Gets the Service Fabric service backup configuration information. * - * The previously suspended partition resumes taking periodic backup as per the - * backup policy currently configured for the same. + * Gets the Service Fabric backup configuration information for the service and + * the partitions under this service. * - * @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.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 @@ -65446,15 +63685,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resumePartitionBackupWithHttpOperationResponse(partitionId, options) { + getServiceBackupConfigurationInfoWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._resumePartitionBackup(partitionId, 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); } @@ -65465,16 +63704,37 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Resumes periodic backup of partition which was previously - * suspended. + * @summary Gets the Service Fabric service backup configuration information. * - * The previously suspended partition resumes taking periodic backup as per the - * backup policy currently configured for the same. + * Gets the Service Fabric backup configuration information for the service and + * the partitions under this service. * - * @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.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 @@ -65490,7 +63750,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. * @@ -65498,13 +63758,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. */ - resumePartitionBackup(partitionId, options, optionalCallback) { + getServiceBackupConfigurationInfo(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65513,75 +63775,85 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resumePartitionBackup(partitionId, options, (err, result, request, response) => { + self._getServiceBackupConfigurationInfo(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resumePartitionBackup(partitionId, options, optionalCallback); + return self._getServiceBackupConfigurationInfo(serviceId, options, optionalCallback); } } /** - * @summary Triggers backup of the partition's state. + * @summary Gets the list of backups available for every partition in this + * service. * - * 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. + * 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 {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 {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 {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {object} [options.backupPartitionDescription.backupStorage] Specifies - * the details of the backup storage where to save the backup. + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. * - * @param {string} - * [options.backupPartitionDescription.backupStorage.friendlyName] Friendly - * name for this backup storage. + * @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.backupPartitionDescription.backupStorage.storageKind - * Polymorphic Discriminator + * @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 {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 {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 {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. */ - backupPartitionWithHttpOperationResponse(partitionId, options) { + getServiceBackupListWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._backupPartition(partitionId, 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); } @@ -65592,48 +63864,58 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Triggers backup of the partition's state. + * @summary Gets the list of backups available for every partition in this + * service. * - * 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. + * 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 {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 {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 {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * @param {object} [options.backupPartitionDescription.backupStorage] Specifies - * the details of the backup storage where to save the backup. + * @param {boolean} [options.latest] Specifies whether to get only the most + * recent backup available for a partition for the specified time range. * - * @param {string} - * [options.backupPartitionDescription.backupStorage.friendlyName] Friendly - * name for this backup storage. + * @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.backupPartitionDescription.backupStorage.storageKind - * Polymorphic Discriminator + * @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 {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 {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 {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 @@ -65645,7 +63927,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. * @@ -65653,13 +63935,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. */ - backupPartition(partitionId, options, optionalCallback) { + getServiceBackupList(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65668,24 +63951,32 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._backupPartition(partitionId, options, (err, result, request, response) => { + self._getServiceBackupList(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._backupPartition(partitionId, options, optionalCallback); + return self._getServiceBackupList(serviceId, options, optionalCallback); } } /** - * @summary Gets details for the latest backup triggered for this partition. + * @summary Suspends periodic backup for the specified Service Fabric service. * - * Returns information about the state of the latest backup along with details - * or failure reason in case of completion. + * 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} 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. * @@ -65699,15 +63990,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionBackupProgressWithHttpOperationResponse(partitionId, options) { + suspendServiceBackupWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionBackupProgress(partitionId, 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); } @@ -65718,12 +64009,20 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets details for the latest backup triggered for this partition. + * @summary Suspends periodic backup for the specified Service Fabric service. * - * Returns information about the state of the latest backup along with details - * or failure reason in case of completion. + * 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} 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. * @@ -65742,7 +64041,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {BackupProgressInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -65750,14 +64049,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 BackupProgressInfo} 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. */ - getPartitionBackupProgress(partitionId, options, optionalCallback) { + suspendServiceBackup(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65766,60 +64064,34 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionBackupProgress(partitionId, options, (err, result, request, response) => { + self._suspendServiceBackup(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionBackupProgress(partitionId, options, optionalCallback); + return self._suspendServiceBackup(serviceId, options, optionalCallback); } } /** - * @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. + * @summary Resumes periodic backup of a Service Fabric service which was + * previously suspended. * - * @param {string} [restorePartitionDescription.backupStorage.friendlyName] - * Friendly name for this backup storage. + * The previously suspended Service Fabric service resumes taking periodic + * backup as per the backup policy currently configured for the same. * - * @param {string} restorePartitionDescription.backupStorage.storageKind - * Polymorphic Discriminator + * @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.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 @@ -65834,11 +64106,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - restorePartitionWithHttpOperationResponse(partitionId, restorePartitionDescription, options) { + resumeServiceBackupWithHttpOperationResponse(serviceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restorePartition(partitionId, restorePartitionDescription, 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); } @@ -65849,48 +64121,22 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Resumes periodic backup of a Service Fabric service which was + * previously suspended. * - * @param {string} [restorePartitionDescription.backupStorage.friendlyName] - * Friendly name for this backup storage. + * The previously suspended Service Fabric service resumes taking periodic + * backup as per the backup policy currently configured for the same. * - * @param {string} restorePartitionDescription.backupStorage.storageKind - * Polymorphic Discriminator + * @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.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 @@ -65920,7 +64166,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restorePartition(partitionId, restorePartitionDescription, options, optionalCallback) { + resumeServiceBackup(serviceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -65929,26 +64175,36 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restorePartition(partitionId, restorePartitionDescription, options, (err, result, request, response) => { + self._resumeServiceBackup(serviceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restorePartition(partitionId, restorePartitionDescription, options, optionalCallback); + return self._resumeServiceBackup(serviceId, options, optionalCallback); } } /** - * @summary Gets details for the latest restore operation triggered for this - * partition. + * @summary Enables periodic backup of the stateful persisted partition. * - * Returns information about the state of the latest restore operation along - * with details or failure reason in case of completion. + * 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 @@ -65961,15 +64217,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPartitionRestoreProgressWithHttpOperationResponse(partitionId, options) { + enablePartitionBackupWithHttpOperationResponse(partitionId, enableBackupDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionRestoreProgress(partitionId, 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); } @@ -65980,14 +64236,24 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets details for the latest restore operation triggered for this - * partition. + * @summary Enables periodic backup of the stateful persisted partition. * - * Returns information about the state of the latest restore operation along - * with details or failure reason in case of completion. + * 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 @@ -66005,7 +64271,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {RestoreProgressInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -66013,14 +64279,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 RestoreProgressInfo} 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. */ - getPartitionRestoreProgress(partitionId, options, optionalCallback) { + enablePartitionBackup(partitionId, enableBackupDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66029,96 +64294,57 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionRestoreProgress(partitionId, 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._getPartitionRestoreProgress(partitionId, options, optionalCallback); + return self._enablePartitionBackup(partitionId, enableBackupDescription, 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. + * @summary Disables periodic backup of Service Fabric partition which was + * previously enabled. * - * @param {string} [getBackupByStorageQueryDescription.storage.friendlyName] - * Friendly name for this backup storage. + * 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 {string} getBackupByStorageQueryDescription.storage.storageKind - * Polymorphic Discriminator + * @param {uuid} partitionId The identity of the partition. * - * @param {object} getBackupByStorageQueryDescription.backupEntity Indicates - * the entity for which to enumerate backups. + * @param {object} [options] Optional Parameters. * - * @param {string} getBackupByStorageQueryDescription.backupEntity.entityKind - * Polymorphic Discriminator + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. * - * @param {object} [options] Optional Parameters. + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time 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. */ - getBackupsFromBackupLocationWithHttpOperationResponse(getBackupByStorageQueryDescription, options) { + disablePartitionBackupWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, 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); } @@ -66129,70 +64355,31 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Disables periodic backup of Service Fabric partition which was + * previously enabled. * - * @param {string} [getBackupByStorageQueryDescription.storage.friendlyName] - * Friendly name for this backup storage. + * 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 {string} getBackupByStorageQueryDescription.storage.storageKind - * Polymorphic Discriminator + * @param {uuid} partitionId The identity of the partition. * - * @param {object} getBackupByStorageQueryDescription.backupEntity Indicates - * the entity for which to enumerate backups. + * @param {object} [options] Optional Parameters. * - * @param {string} getBackupByStorageQueryDescription.backupEntity.entityKind - * Polymorphic Discriminator + * @param {object} [options.disableBackupDescription] Specifies the parameters + * to disable backup for any backup entity. * - * @param {object} [options] Optional Parameters. + * @param {boolean} options.disableBackupDescription.cleanBackup Boolean flag + * to delete backups. It can be set to true for deleting all the backups which + * were created for the backup entity that is getting disabled for backup. * * @param {number} [options.timeout] The server timeout for performing the * operation in seconds. This timeout specifies the time 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 * @@ -66203,7 +64390,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedBackupInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -66211,14 +64398,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 PagedBackupInfoList} 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. */ - getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, optionalCallback) { + disablePartitionBackup(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66227,27 +64413,24 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, (err, result, request, response) => { + self._disablePartitionBackup(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, optionalCallback); + return self._disablePartitionBackup(partitionId, options, optionalCallback); } } /** - * @summary Creates a Service Fabric name. - * - * Creates the specified Service Fabric name. + * @summary Gets the partition backup configuration information * - * @param {object} nameDescription Describes the Service Fabric name to be - * created. + * Gets the Service Fabric Backup configuration information for the specified + * partition. * - * @param {string} nameDescription.name The Service Fabric name, including the - * 'fabric:' URI scheme. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66261,15 +64444,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createNameWithHttpOperationResponse(nameDescription, options) { + getPartitionBackupConfigurationInfoWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createName(nameDescription, 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); } @@ -66280,15 +64463,12 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates a Service Fabric name. - * - * Creates the specified Service Fabric name. + * @summary Gets the partition backup configuration information * - * @param {object} nameDescription Describes the Service Fabric name to be - * created. + * Gets the Service Fabric Backup configuration information for the specified + * partition. * - * @param {string} nameDescription.name The Service Fabric name, including the - * 'fabric:' URI scheme. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66307,7 +64487,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PartitionBackupConfigurationInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -66315,13 +64495,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 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. */ - createName(nameDescription, options, optionalCallback) { + getPartitionBackupConfigurationInfo(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66330,24 +64512,26 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createName(nameDescription, options, (err, result, request, response) => { + self._getPartitionBackupConfigurationInfo(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createName(nameDescription, options, optionalCallback); + return self._getPartitionBackupConfigurationInfo(partitionId, options, optionalCallback); } } /** - * @summary Returns whether the Service Fabric name exists. + * @summary Gets the list of backups available for the specified partition. * - * Returns whether the specified Service Fabric name exists. + * 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 {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66356,20 +64540,33 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getNameExistsInfoWithHttpOperationResponse(nameId, options) { + getPartitionBackupListWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNameExistsInfo(nameId, 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); } @@ -66380,12 +64577,14 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Returns whether the Service Fabric name exists. + * @summary Gets the list of backups available for the specified partition. * - * Returns whether the specified Service Fabric name exists. + * 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 {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66394,6 +64593,19 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -66404,7 +64616,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. * @@ -66412,13 +64624,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. */ - getNameExistsInfo(nameId, options, optionalCallback) { + getPartitionBackupList(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66427,25 +64640,24 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNameExistsInfo(nameId, options, (err, result, request, response) => { + self._getPartitionBackupList(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNameExistsInfo(nameId, options, optionalCallback); + return self._getPartitionBackupList(partitionId, options, optionalCallback); } } /** - * @summary Deletes a Service Fabric name. + * @summary Suspends periodic backup for the specified partition. * - * Deletes the specified Service Fabric name. A name must be created before it - * can be deleted. Deleting a name with child properties will fail. + * The partition which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. * - * @param {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66463,11 +64675,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - deleteNameWithHttpOperationResponse(nameId, options) { + suspendPartitionBackupWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteName(nameId, 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); } @@ -66478,13 +64690,12 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes a Service Fabric name. + * @summary Suspends periodic backup for the specified partition. * - * Deletes the specified Service Fabric name. A name must be created before it - * can be deleted. Deleting a name with child properties will fail. + * The partition which is configured to take periodic backups, is suspended for + * taking further backups till it is resumed again. * - * @param {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66517,7 +64728,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteName(nameId, options, optionalCallback) { + suspendPartitionBackup(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66526,41 +64737,28 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteName(nameId, options, (err, result, request, response) => { + self._suspendPartitionBackup(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteName(nameId, options, optionalCallback); + return self._suspendPartitionBackup(partitionId, options, optionalCallback); } } /** - * @summary Enumerates all the Service Fabric names under a given name. + * @summary Resumes periodic backup of partition which was previously + * suspended. * - * 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. + * The previously suspended partition resumes taking periodic backup as per the + * backup policy currently configured for the same. * - * @param {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @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 @@ -66571,15 +64769,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getSubNameInfoListWithHttpOperationResponse(nameId, options) { + resumePartitionBackupWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getSubNameInfoList(nameId, 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); } @@ -66590,29 +64788,16 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Enumerates all the Service Fabric names under a given name. + * @summary Resumes periodic backup of partition which was previously + * suspended. * - * 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. + * The previously suspended partition resumes taking periodic backup as per the + * backup policy currently configured for the same. * - * @param {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @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 @@ -66628,7 +64813,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedSubNameInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -66636,14 +64821,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 PagedSubNameInfoList} 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. */ - getSubNameInfoList(nameId, options, optionalCallback) { + resumePartitionBackup(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66652,42 +64836,55 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSubNameInfoList(nameId, options, (err, result, request, response) => { + self._resumePartitionBackup(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSubNameInfoList(nameId, options, optionalCallback); + return self._resumePartitionBackup(partitionId, options, optionalCallback); } } /** - * @summary Gets information on all Service Fabric properties under a given - * name. + * @summary Triggers backup of the partition's state. * - * 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. + * 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} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @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 {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 {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.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 @@ -66699,15 +64896,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPropertyInfoListWithHttpOperationResponse(nameId, options) { + backupPartitionWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPropertyInfoList(nameId, 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); } @@ -66718,30 +64915,43 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets information on all Service Fabric properties under a given - * name. + * @summary Triggers backup of the partition's state. * - * 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. + * 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} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * * @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 {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 {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.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 @@ -66758,7 +64968,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedPropertyInfoList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -66766,14 +64976,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 PagedPropertyInfoList} 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. */ - getPropertyInfoList(nameId, options, optionalCallback) { + backupPartition(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66782,39 +64991,24 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPropertyInfoList(nameId, options, (err, result, request, response) => { + self._backupPartition(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPropertyInfoList(nameId, options, optionalCallback); + return self._backupPartition(partitionId, options, optionalCallback); } } /** - * @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. + * @summary Gets details for the latest backup triggered for this partition. * - * @param {object} propertyDescription.value Describes a Service Fabric - * property value. + * Returns information about the state of the latest backup along with details + * or failure reason in case of completion. * - * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66828,15 +65022,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - putPropertyWithHttpOperationResponse(nameId, propertyDescription, options) { + getPartitionBackupProgressWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._putProperty(nameId, propertyDescription, 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); } @@ -66847,27 +65041,12 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets details for the latest backup triggered for this partition. * - * @param {object} propertyDescription.value Describes a Service Fabric - * property value. + * Returns information about the state of the latest backup along with details + * or failure reason in case of completion. * - * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -66886,7 +65065,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {BackupProgressInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -66894,13 +65073,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 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. */ - putProperty(nameId, propertyDescription, options, optionalCallback) { + getPartitionBackupProgress(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -66909,30 +65089,60 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._putProperty(nameId, propertyDescription, options, (err, result, request, response) => { + self._getPartitionBackupProgress(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._putProperty(nameId, propertyDescription, options, optionalCallback); + return self._getPartitionBackupProgress(partitionId, options, optionalCallback); } } /** - * @summary Gets the specified Service Fabric property. + * @summary Triggers restore of the state of the partition using the specified + * restore partition description. * - * Gets the specified Service Fabric property under a given name. This will - * always return both value and metadata. + * 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 {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} propertyName Specifies the name of the property to get. + * @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 @@ -66943,15 +65153,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPropertyInfoWithHttpOperationResponse(nameId, propertyName, options) { + restorePartitionWithHttpOperationResponse(partitionId, restorePartitionDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPropertyInfo(nameId, propertyName, options, (err, result, request, response) => { + self._restorePartition(partitionId, restorePartitionDescription, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -66962,18 +65172,48 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the specified Service Fabric property. + * @summary Triggers restore of the state of the partition using the specified + * restore partition description. * - * Gets the specified Service Fabric property under a given name. This will - * always return both value and metadata. + * 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 {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} propertyName Specifies the name of the property to get. + * @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 @@ -66989,7 +65229,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PropertyInfo} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -66997,14 +65237,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 PropertyInfo} 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. */ - getPropertyInfo(nameId, propertyName, options, optionalCallback) { + restorePartition(partitionId, restorePartitionDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67013,27 +65252,25 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPropertyInfo(nameId, propertyName, 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._getPropertyInfo(nameId, propertyName, options, optionalCallback); + return self._restorePartition(partitionId, restorePartitionDescription, options, optionalCallback); } } /** - * @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. + * @summary Gets details for the latest restore operation triggered for this + * partition. * - * @param {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * Returns information about the state of the latest restore operation along + * with details or failure reason in case of completion. * - * @param {string} propertyName Specifies the name of the property to get. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -67047,15 +65284,15 @@ class ServiceFabricClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deletePropertyWithHttpOperationResponse(nameId, propertyName, options) { + getPartitionRestoreProgressWithHttpOperationResponse(partitionId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteProperty(nameId, propertyName, options, (err, result, request, response) => { + self._getPartitionRestoreProgress(partitionId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -67066,15 +65303,13 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets details for the latest restore operation triggered for this + * partition. * - * @param {string} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * Returns information about the state of the latest restore operation along + * with details or failure reason in case of completion. * - * @param {string} propertyName Specifies the name of the property to get. + * @param {uuid} partitionId The identity of the partition. * * @param {object} [options] Optional Parameters. * @@ -67093,7 +65328,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {RestoreProgressInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -67101,13 +65336,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 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. */ - deleteProperty(nameId, propertyName, options, optionalCallback) { + getPartitionRestoreProgress(partitionId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67116,53 +65352,96 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteProperty(nameId, propertyName, options, (err, result, request, response) => { + self._getPartitionRestoreProgress(partitionId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteProperty(nameId, propertyName, options, optionalCallback); + return self._getPartitionRestoreProgress(partitionId, options, optionalCallback); } } /** - * @summary Submits a property batch. + * @summary Gets the list of backups available for the specified backed up + * entity at the specified backup location. * - * Submits a batch of property operations. Either all or none of the operations - * will be committed. + * 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} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {object} getBackupByStorageQueryDescription Describes the filters and + * backup storage details to be used for enumerating backups. * - * @param {object} propertyBatchDescriptionList Describes the property batch - * operations to be submitted. + * @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 {array} [propertyBatchDescriptionList.operations] A list of the - * property batch operations to be executed. + * @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 {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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. */ - submitPropertyBatchWithHttpOperationResponse(nameId, propertyBatchDescriptionList, options) { + getBackupsFromBackupLocationWithHttpOperationResponse(getBackupByStorageQueryDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._submitPropertyBatch(nameId, propertyBatchDescriptionList, 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); } @@ -67173,19 +65452,46 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Submits a property batch. + * @summary Gets the list of backups available for the specified backed up + * entity at the specified backup location. * - * Submits a batch of property operations. Either all or none of the operations - * will be committed. + * 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} nameId The Service Fabric name, without the 'fabric:' URI - * scheme. + * @param {object} getBackupByStorageQueryDescription Describes the filters and + * backup storage details to be used for enumerating backups. * - * @param {object} propertyBatchDescriptionList Describes the property batch - * operations to be submitted. + * @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 {array} [propertyBatchDescriptionList.operations] A list of the - * property batch operations to be executed. + * @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. * @@ -67194,6 +65500,22 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -67204,7 +65526,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PropertyBatchInfo} - The deserialized result object. + * @resolve {PagedBackupInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -67213,13 +65535,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 PropertyBatchInfo} 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. */ - submitPropertyBatch(nameId, propertyBatchDescriptionList, options, optionalCallback) { + getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67228,27 +65550,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._submitPropertyBatch(nameId, propertyBatchDescriptionList, options, (err, result, request, response) => { + self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._submitPropertyBatch(nameId, propertyBatchDescriptionList, options, optionalCallback); + return self._getBackupsFromBackupLocation(getBackupByStorageQueryDescription, options, optionalCallback); } } /** - * @summary Gets all Cluster-related events. + * @summary Creates a Service Fabric name. * - * The response is list of ClusterEvent objects. + * Creates the specified Service Fabric name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {object} nameDescription Describes the Service Fabric name to be + * created. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameDescription.name The Service Fabric name, including the + * 'fabric:' URI scheme. * * @param {object} [options] Optional Parameters. * @@ -67257,32 +65579,20 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getClusterEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + createNameWithHttpOperationResponse(nameDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getClusterEventList(startTimeUtc, endTimeUtc, 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); } @@ -67293,15 +65603,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all Cluster-related events. + * @summary Creates a Service Fabric name. * - * The response is list of ClusterEvent objects. + * Creates the specified Service Fabric name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {object} nameDescription Describes the Service Fabric name to be + * created. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameDescription.name The Service Fabric name, including the + * 'fabric:' URI scheme. * * @param {object} [options] Optional Parameters. * @@ -67310,18 +65620,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -67332,7 +65630,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. * @@ -67340,13 +65638,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. */ - getClusterEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { + createName(nameDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67355,27 +65653,24 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getClusterEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._createName(nameDescription, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getClusterEventList(startTimeUtc, endTimeUtc, options, optionalCallback); + return self._createName(nameDescription, options, optionalCallback); } } /** - * @summary Gets all Containers-related events. - * - * The response is list of ContainerInstanceEvent objects. + * @summary Returns whether the Service Fabric name exists. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * Returns whether the specified Service Fabric name exists. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * @@ -67384,32 +65679,20 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getContainersEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + getNameExistsInfoWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getContainersEventList(startTimeUtc, endTimeUtc, 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); } @@ -67420,15 +65703,12 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all Containers-related events. - * - * The response is list of ContainerInstanceEvent objects. + * @summary Returns whether the Service Fabric name exists. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * Returns whether the specified Service Fabric name exists. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * @@ -67437,18 +65717,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -67459,7 +65727,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. * @@ -67467,13 +65735,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. */ - getContainersEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { + getNameExistsInfo(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67482,29 +65750,25 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getContainersEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._getNameExistsInfo(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getContainersEventList(startTimeUtc, endTimeUtc, options, optionalCallback); + return self._getNameExistsInfo(nameId, options, optionalCallback); } } /** - * @summary Gets a Node-related events. - * - * The response is list of NodeEvent objects. - * - * @param {string} nodeName The name of the node. + * @summary Deletes a Service Fabric name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * 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} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * @@ -67513,32 +65777,20 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getNodeEventListWithHttpOperationResponse(nodeName, startTimeUtc, endTimeUtc, options) { + deleteNameWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, 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); } @@ -67549,17 +65801,13 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a Node-related events. - * - * The response is list of NodeEvent objects. - * - * @param {string} nodeName The name of the node. + * @summary Deletes a Service Fabric name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * 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} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * * @param {object} [options] Optional Parameters. * @@ -67568,18 +65816,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -67590,7 +65826,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. * @@ -67598,13 +65834,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. */ - getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, optionalCallback) { + deleteName(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67613,61 +65849,60 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._deleteName(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, optionalCallback); + return self._deleteName(nameId, options, optionalCallback); } } /** - * @summary Gets all Nodes-related Events. - * - * The response is list of NodeEvent objects. + * @summary Enumerates all the Service Fabric names under a given name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * 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} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @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 {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. */ - getNodesEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + getSubNameInfoListWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getNodesEventList(startTimeUtc, endTimeUtc, 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); } @@ -67678,35 +65913,34 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all Nodes-related Events. - * - * The response is list of NodeEvent objects. + * @summary Enumerates all the Service Fabric names under a given name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * 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} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @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 {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 * @@ -67717,7 +65951,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {PagedSubNameInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -67725,13 +65959,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 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. */ - getNodesEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { + getSubNameInfoList(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67740,69 +65975,62 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNodesEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._getSubNameInfoList(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNodesEventList(startTimeUtc, endTimeUtc, options, optionalCallback); + return self._getSubNameInfoList(nameId, options, optionalCallback); } } /** - * @summary Gets an Application-related events. + * @summary Gets information on all Service Fabric properties under a given + * name. * - * The response is list of ApplicationEvent objects. + * 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} 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 {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {object} [options] Optional Parameters. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @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 {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.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. */ - getApplicationEventListWithHttpOperationResponse(applicationId, startTimeUtc, endTimeUtc, options) { + getPropertyInfoListWithHttpOperationResponse(nameId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, 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); } @@ -67813,43 +66041,36 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets an Application-related events. + * @summary Gets information on all Service Fabric properties under a given + * name. * - * The response is list of ApplicationEvent objects. + * 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} 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 {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {object} [options] Optional Parameters. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @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 {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.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 * @@ -67860,7 +66081,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {PagedPropertyInfoList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -67868,13 +66089,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 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. */ - getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, optionalCallback) { + getPropertyInfoList(nameId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -67883,61 +66105,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._getPropertyInfoList(nameId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, optionalCallback); + return self._getPropertyInfoList(nameId, options, optionalCallback); } } /** - * @summary Gets all Applications-related events. + * @summary Creates or updates a Service Fabric property. * - * The response is list of ApplicationEvent objects. + * Creates or updates the specified Service Fabric property under a given name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {object} propertyDescription Describes the Service Fabric property to + * be created. * - * @param {object} [options] Optional Parameters. + * @param {string} propertyDescription.propertyName The name of the Service + * Fabric property. * - * @param {number} [options.timeout] The server timeout for performing the - * operation in seconds. This timeout specifies the time 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} [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 {string} [options.eventsTypesFilter] This is a comma separated string - * specifying the types of FabricEvents that should only be included in the - * response. + * @param {object} propertyDescription.value Describes a Service Fabric + * property value. * - * @param {boolean} [options.excludeAnalysisEvents] This param disables the - * retrieval of AnalysisEvents if true is passed. + * @param {string} propertyDescription.value.kind Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. * - * @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} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested 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. */ - getApplicationsEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + putPropertyWithHttpOperationResponse(nameId, propertyDescription, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationsEventList(startTimeUtc, endTimeUtc, 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); } @@ -67948,15 +66170,27 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all Applications-related events. + * @summary Creates or updates a Service Fabric property. * - * The response is list of ApplicationEvent objects. + * Creates or updates the specified Service Fabric property under a given name. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @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. * @@ -67965,18 +66199,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -67987,7 +66209,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. * @@ -67995,13 +66217,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. */ - getApplicationsEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { + putProperty(nameId, propertyDescription, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68010,35 +66232,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationsEventList(startTimeUtc, endTimeUtc, 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._getApplicationsEventList(startTimeUtc, endTimeUtc, options, optionalCallback); + return self._putProperty(nameId, propertyDescription, options, optionalCallback); } } /** - * @summary Gets a Service-related events. - * - * The response is list of ServiceEvent objects. + * @summary Gets the specified Service Fabric property. * - * @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. + * Gets the specified Service Fabric property under a given name. This will + * always return both value and metadata. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * @@ -68047,32 +66261,20 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getServiceEventListWithHttpOperationResponse(serviceId, startTimeUtc, endTimeUtc, options) { + getPropertyInfoWithHttpOperationResponse(nameId, propertyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServiceEventList(serviceId, startTimeUtc, endTimeUtc, 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); } @@ -68083,23 +66285,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a Service-related events. - * - * The response is list of ServiceEvent objects. + * @summary Gets the specified Service Fabric property. * - * @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. + * Gets the specified Service Fabric property under a given name. This will + * always return both value and metadata. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * @@ -68108,18 +66302,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -68130,7 +66312,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {PropertyInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -68138,13 +66320,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 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. */ - getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, optionalCallback) { + getPropertyInfo(nameId, propertyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68153,27 +66336,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServiceEventList(serviceId, startTimeUtc, endTimeUtc, 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._getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, optionalCallback); + return self._getPropertyInfo(nameId, propertyName, options, optionalCallback); } } /** - * @summary Gets all Services-related events. + * @summary Deletes the specified Service Fabric property. * - * The response is list of ServiceEvent objects. + * Deletes the specified Service Fabric property under a given name. A property + * must be created before it can be deleted. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * @@ -68182,32 +66365,20 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getServicesEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + deletePropertyWithHttpOperationResponse(nameId, propertyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServicesEventList(startTimeUtc, endTimeUtc, 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); } @@ -68218,15 +66389,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all Services-related events. + * @summary Deletes the specified Service Fabric property. * - * The response is list of ServiceEvent objects. + * Deletes the specified Service Fabric property under a given name. A property + * must be created before it can be deleted. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {string} propertyName Specifies the name of the property to get. * * @param {object} [options] Optional Parameters. * @@ -68235,18 +66406,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -68257,7 +66416,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. * @@ -68265,13 +66424,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. */ - getServicesEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { + deleteProperty(nameId, propertyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68280,29 +66439,31 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServicesEventList(startTimeUtc, endTimeUtc, 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._getServicesEventList(startTimeUtc, endTimeUtc, options, optionalCallback); + return self._deleteProperty(nameId, propertyName, options, optionalCallback); } } /** - * @summary Gets a Partition-related events. + * @summary Submits a property batch. * - * The response is list of PartitionEvent objects. + * Submits a batch of property operations. Either all or none of the operations + * will be committed. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {object} propertyBatchDescriptionList Describes the property batch + * operations to be submitted. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {array} [propertyBatchDescriptionList.operations] A list of the + * property batch operations to be executed. * * @param {object} [options] Optional Parameters. * @@ -68311,32 +66472,20 @@ class ServiceFabricClient extends ServiceClient { * 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. */ - getPartitionEventListWithHttpOperationResponse(partitionId, startTimeUtc, endTimeUtc, options) { + submitPropertyBatchWithHttpOperationResponse(nameId, propertyBatchDescriptionList, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, 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); } @@ -68347,17 +66496,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a Partition-related events. + * @summary Submits a property batch. * - * The response is list of PartitionEvent objects. + * Submits a batch of property operations. Either all or none of the operations + * will be committed. * - * @param {uuid} partitionId The identity of the partition. + * @param {string} nameId The Service Fabric name, without the 'fabric:' URI + * scheme. * - * @param {string} startTimeUtc The start time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {object} propertyBatchDescriptionList Describes the property batch + * operations to be submitted. * - * @param {string} endTimeUtc The end time of a lookup query in ISO UTC - * yyyy-MM-ddTHH:mm:ssZ. + * @param {array} [propertyBatchDescriptionList.operations] A list of the + * property batch operations to be executed. * * @param {object} [options] Optional Parameters. * @@ -68366,18 +66517,6 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -68388,7 +66527,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {PropertyBatchInfo} - The deserialized result object. * * @reject {Error} - The error object. * @@ -68396,13 +66535,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 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. */ - getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback) { + submitPropertyBatch(nameId, propertyBatchDescriptionList, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68411,21 +66551,21 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._submitPropertyBatch(nameId, propertyBatchDescriptionList, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback); + return self._submitPropertyBatch(nameId, propertyBatchDescriptionList, options, optionalCallback); } } /** - * @summary Gets all Partitions-related events. + * @summary Gets all Cluster-related events. * - * The response is list of PartitionEvent objects. + * 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. @@ -68461,11 +66601,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - getPartitionsEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { + getClusterEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionsEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._getClusterEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -68476,9 +66616,9 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all Partitions-related events. + * @summary Gets all Cluster-related events. * - * The response is list of PartitionEvent objects. + * 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. @@ -68529,7 +66669,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getPartitionsEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { + getClusterEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68538,25 +66678,21 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionsEventList(startTimeUtc, endTimeUtc, 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._getPartitionsEventList(startTimeUtc, endTimeUtc, options, optionalCallback); + return self._getClusterEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets a Partition Replica-related events. - * - * The response is list of ReplicaEvent objects. - * - * @param {uuid} partitionId The identity of the partition. + * @summary Gets all Containers-related events. * - * @param {string} replicaId The identifier of the replica. + * 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. @@ -68592,11 +66728,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - getPartitionReplicaEventListWithHttpOperationResponse(partitionId, replicaId, startTimeUtc, endTimeUtc, options) { + getContainersEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._getContainersEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -68607,13 +66743,9 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets a Partition Replica-related events. - * - * The response is list of ReplicaEvent objects. - * - * @param {uuid} partitionId The identity of the partition. + * @summary Gets all Containers-related events. * - * @param {string} replicaId The identifier of the replica. + * 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. @@ -68664,7 +66796,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, optionalCallback) { + getContainersEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68673,23 +66805,23 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._getContainersEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, optionalCallback); + return self._getContainersEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets all Replicas-related events for a Partition. + * @summary Gets a Node-related events. * - * The response is list of ReplicaEvent objects. + * The response is list of NodeEvent objects. * - * @param {uuid} partitionId The identity of the partition. + * @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. @@ -68725,11 +66857,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - getPartitionReplicasEventListWithHttpOperationResponse(partitionId, startTimeUtc, endTimeUtc, options) { + getNodeEventListWithHttpOperationResponse(nodeName, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, 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); } @@ -68740,11 +66872,11 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all Replicas-related events for a Partition. + * @summary Gets a Node-related events. * - * The response is list of ReplicaEvent objects. + * The response is list of NodeEvent objects. * - * @param {uuid} partitionId The identity of the partition. + * @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. @@ -68795,7 +66927,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback) { + getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68804,23 +66936,27 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { + self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback); + return self._getNodeEventList(nodeName, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets all correlated events for a given event. + * @summary Gets all Nodes-related Events. * - * The response is list of FabricEvents. + * The response is list of NodeEvent objects. * - * @param {string} eventInstanceId The EventInstanceId. + * @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. * @@ -68829,6 +66965,18 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -68838,11 +66986,11 @@ class ServiceFabricClient extends ServiceClient { * * @reject {Error} - The error object. */ - getCorrelatedEventListWithHttpOperationResponse(eventInstanceId, options) { + getNodesEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCorrelatedEventList(eventInstanceId, options, (err, result, request, response) => { + self._getNodesEventList(startTimeUtc, endTimeUtc, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -68853,11 +67001,15 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all correlated events for a given event. + * @summary Gets all Nodes-related Events. * - * The response is list of FabricEvents. + * The response is list of NodeEvent objects. * - * @param {string} eventInstanceId The EventInstanceId. + * @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. * @@ -68866,6 +67018,18 @@ class ServiceFabricClient extends ServiceClient { * 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 * @@ -68890,7 +67054,7 @@ class ServiceFabricClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCorrelatedEventList(eventInstanceId, options, optionalCallback) { + getNodesEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -68899,187 +67063,69 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCorrelatedEventList(eventInstanceId, 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._getCorrelatedEventList(eventInstanceId, options, optionalCallback); + return self._getNodesEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createApplicationResourceWithHttpOperationResponse(applicationResourceName, applicationResourceDescription, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._createApplicationResource(applicationResourceName, applicationResourceDescription, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates or updates 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. + * @summary Gets an Application-related events. * - * @param {array} [applicationResourceDescription.diagnostics.sinks] List of - * supported sinks that can be referenced. + * The response is list of ApplicationEvent objects. * - * @param {boolean} [applicationResourceDescription.diagnostics.enabled] Status - * of whether or not sinks are 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 {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} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} applicationResourceDescription.name Application resource - * name. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createApplicationResource(applicationResourceName, applicationResourceDescription, 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._createApplicationResource(applicationResourceName, applicationResourceDescription, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createApplicationResource(applicationResourceName, applicationResourceDescription, options, optionalCallback); - } - } - - /** - * @summary Gets the application with the given name. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time duration that the + * client is willing to wait for the requested operation to complete. The + * default value for this parameter is 60 seconds. * - * Gets the application with the given name. This includes the information - * about the application's services and other runtime information. + * @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} applicationResourceName Service Fabric application resource - * name. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {object} [options] Optional Parameters. + * @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. */ - getApplicationResourceWithHttpOperationResponse(applicationResourceName, options) { + getApplicationEventListWithHttpOperationResponse(applicationId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getApplicationResource(applicationResourceName, 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); } @@ -69090,16 +67136,43 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the application with the given name. + * @summary Gets an Application-related events. * - * Gets the application with the given name. This includes the information - * about the application's services and other runtime information. + * The response is list of ApplicationEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @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 * @@ -69110,7 +67183,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ApplicationResourceDescription} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -69118,15 +67191,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 ApplicationResourceDescription} 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. */ - getApplicationResource(applicationResourceName, options, optionalCallback) { + getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69135,41 +67206,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getApplicationResource(applicationResourceName, 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._getApplicationResource(applicationResourceName, options, optionalCallback); + return self._getApplicationEventList(applicationId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Deletes the specified application. + * @summary Gets all Applications-related events. + * + * The response is list of ApplicationEvent objects. * - * Deletes the application identified by the name. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteApplicationResourceWithHttpOperationResponse(applicationResourceName, options) { + getApplicationsEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteApplicationResource(applicationResourceName, 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); } @@ -69180,15 +67271,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes the specified application. + * @summary Gets all Applications-related events. * - * Deletes the application identified by the name. + * The response is list of ApplicationEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @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 * @@ -69199,7 +67310,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. * @@ -69207,13 +67318,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. */ - deleteApplicationResource(applicationResourceName, options, optionalCallback) { + getApplicationsEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69222,42 +67333,69 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteApplicationResource(applicationResourceName, 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._deleteApplicationResource(applicationResourceName, options, optionalCallback); + return self._getApplicationsEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets all the services in the application resource. + * @summary Gets a Service-related events. * - * The operation returns the service descriptions of all the services in the - * application resource. + * The response is list of ServiceEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServicesWithHttpOperationResponse(applicationResourceName, options) { + getServiceEventListWithHttpOperationResponse(serviceId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getServices(applicationResourceName, 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); } @@ -69268,16 +67406,43 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets all the services in the application resource. + * @summary Gets a Service-related events. * - * The operation returns the service descriptions of all the services in the - * application resource. + * The response is list of ServiceEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @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 * @@ -69288,7 +67453,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedServiceResourceDescriptionList} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -69296,15 +67461,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 PagedServiceResourceDescriptionList} 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. */ - getServices(applicationResourceName, options, optionalCallback) { + getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69313,44 +67476,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getServices(applicationResourceName, 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._getServices(applicationResourceName, options, optionalCallback); + return self._getServiceEventList(serviceId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets the description of the specified service in an application - * resource. + * @summary Gets all Services-related events. * - * Gets the description of the service resource. + * The response is list of ServiceEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} serviceResourceName Service Fabric service resource name. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getServiceWithHttpOperationResponse(applicationResourceName, serviceResourceName, options) { + getServicesEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getService(applicationResourceName, serviceResourceName, 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); } @@ -69361,18 +67541,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the description of the specified service in an application - * resource. + * @summary Gets all Services-related events. * - * Gets the description of the service resource. + * The response is list of ServiceEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} serviceResourceName Service Fabric service resource name. + * @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 * @@ -69383,7 +67580,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceResourceDescription} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -69391,15 +67588,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 ServiceResourceDescription} 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. */ - getService(applicationResourceName, serviceResourceName, options, optionalCallback) { + getServicesEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69408,45 +67603,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getService(applicationResourceName, serviceResourceName, 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._getService(applicationResourceName, serviceResourceName, options, optionalCallback); + return self._getServicesEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets replicas of a given service in an application resource. + * @summary Gets a Partition-related events. * - * Gets the information about all replicas of a given service of an - * application. The information includes the runtime properties of the replica - * instance. + * The response is list of PartitionEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @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} serviceResourceName Service Fabric service resource name. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getReplicasWithHttpOperationResponse(applicationResourceName, serviceResourceName, options) { + getPartitionEventListWithHttpOperationResponse(partitionId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplicas(applicationResourceName, serviceResourceName, 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); } @@ -69457,19 +67670,37 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets replicas of a given service in an application resource. + * @summary Gets a Partition-related events. * - * Gets the information about all replicas of a given service of an - * application. The information includes the runtime properties of the replica - * instance. + * The response is list of PartitionEvent objects. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * @param {uuid} partitionId The identity of the partition. * - * @param {string} serviceResourceName Service Fabric service resource name. + * @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 * @@ -69480,7 +67711,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {PagedServiceResourceReplicaDescriptionList} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -69488,15 +67719,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 PagedServiceResourceReplicaDescriptionList} - * 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. */ - getReplicas(applicationResourceName, serviceResourceName, options, optionalCallback) { + getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69505,48 +67734,61 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplicas(applicationResourceName, serviceResourceName, 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._getReplicas(applicationResourceName, serviceResourceName, options, optionalCallback); + return self._getPartitionEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @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. + * @summary Gets all Partitions-related events. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * The response is list of PartitionEvent objects. * - * @param {string} serviceResourceName Service Fabric service resource name. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} replicaName Service Fabric replica name. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getReplicaWithHttpOperationResponse(applicationResourceName, serviceResourceName, replicaName, options) { + getPartitionsEventListWithHttpOperationResponse(startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getReplica(applicationResourceName, serviceResourceName, replicaName, 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); } @@ -69557,22 +67799,35 @@ class ServiceFabricClient extends ServiceClient { } /** - * @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. + * @summary Gets all Partitions-related events. * - * @param {string} applicationResourceName Service Fabric application resource - * name. + * The response is list of PartitionEvent objects. * - * @param {string} serviceResourceName Service Fabric service resource name. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} replicaName Service Fabric replica name. + * @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 * @@ -69583,7 +67838,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {ServiceResourceReplicaDescription} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -69591,15 +67846,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 ServiceResourceReplicaDescription} 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. */ - getReplica(applicationResourceName, serviceResourceName, replicaName, options, optionalCallback) { + getPartitionsEventList(startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69608,62 +67861,65 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getReplica(applicationResourceName, serviceResourceName, replicaName, 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._getReplica(applicationResourceName, serviceResourceName, replicaName, options, optionalCallback); + return self._getPartitionsEventList(startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Creates or updates a volume resource. + * @summary Gets a Partition Replica-related events. * - * 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. + * The response is list of ReplicaEvent objects. * - * @param {string} volumeResourceName Service Fabric volume resource name. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} volumeResourceDescription Description for creating a volume - * resource. + * @param {string} replicaId The identifier of the replica. * - * @param {string} [volumeResourceDescription.description] User readable - * description of the volume. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {object} [volumeResourceDescription.azureFileParameters] This type - * describes a volume provided by an Azure Files file share. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} volumeResourceDescription.azureFileParameters.accountName - * Name of the Azure storage account for the File Share. + * @param {object} [options] Optional Parameters. * - * @param {string} [volumeResourceDescription.azureFileParameters.accountKey] - * Access key of the Azure storage account for the File Share. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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.shareName Name - * of the Azure Files file share that provides storage for the volume. + * @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} volumeResourceDescription.name Volume resource name. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {object} [options] Optional Parameters. + * @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. */ - createVolumeResourceWithHttpOperationResponse(volumeResourceName, volumeResourceDescription, options) { + getPartitionReplicaEventListWithHttpOperationResponse(partitionId, replicaId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createVolumeResource(volumeResourceName, volumeResourceDescription, 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); } @@ -69674,35 +67930,38 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Creates or updates a volume resource. + * @summary Gets a Partition Replica-related events. * - * 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. + * The response is list of ReplicaEvent objects. * - * @param {string} volumeResourceName Service Fabric volume resource name. + * @param {uuid} partitionId The identity of the partition. * - * @param {object} volumeResourceDescription Description for creating a volume - * resource. + * @param {string} replicaId The identifier of the replica. * - * @param {string} [volumeResourceDescription.description] User readable - * description of the volume. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {object} [volumeResourceDescription.azureFileParameters] This type - * describes a volume provided by an Azure Files file share. + * @param {string} endTimeUtc The end time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} volumeResourceDescription.azureFileParameters.accountName - * Name of the Azure storage account for the File Share. + * @param {object} [options] Optional Parameters. * - * @param {string} [volumeResourceDescription.azureFileParameters.accountKey] - * Access key of the Azure storage account for the File Share. + * @param {number} [options.timeout] The server timeout for performing the + * operation in seconds. This timeout specifies the time 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.shareName Name - * of the Azure Files file share that provides storage for the volume. + * @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} volumeResourceDescription.name Volume resource name. + * @param {boolean} [options.excludeAnalysisEvents] This param disables the + * retrieval of AnalysisEvents if true is passed. * - * @param {object} [options] Optional Parameters. + * @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 @@ -69714,7 +67973,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. * @@ -69722,13 +67981,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. */ - createVolumeResource(volumeResourceName, volumeResourceDescription, options, optionalCallback) { + getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69737,41 +67996,63 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createVolumeResource(volumeResourceName, volumeResourceDescription, 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._createVolumeResource(volumeResourceName, volumeResourceDescription, options, optionalCallback); + return self._getPartitionReplicaEventList(partitionId, replicaId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Gets the volume resource. + * @summary Gets all Replicas-related events for a Partition. * - * Gets the information about the volume resource with a given name. This - * information includes the volume description and other runtime information. + * 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} volumeResourceName Service Fabric volume resource name. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getVolumeResourceWithHttpOperationResponse(volumeResourceName, options) { + getPartitionReplicasEventListWithHttpOperationResponse(partitionId, startTimeUtc, endTimeUtc, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getVolumeResource(volumeResourceName, 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); } @@ -69782,15 +68063,37 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Gets the volume resource. + * @summary Gets all Replicas-related events for a Partition. + * + * The response is list of ReplicaEvent objects. + * + * @param {uuid} partitionId The identity of the partition. * - * Gets the information about the volume resource with a given name. This - * information includes the volume description and other runtime information. + * @param {string} startTimeUtc The start time of a lookup query in ISO UTC + * yyyy-MM-ddTHH:mm:ssZ. * - * @param {string} volumeResourceName Service Fabric volume resource name. + * @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 * @@ -69801,7 +68104,7 @@ class ServiceFabricClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {VolumeResourceDescription} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -69809,15 +68112,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 VolumeResourceDescription} 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. */ - getVolumeResource(volumeResourceName, options, optionalCallback) { + getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69826,40 +68127,45 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getVolumeResource(volumeResourceName, options, (err, result, request, response) => { + self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getVolumeResource(volumeResourceName, options, optionalCallback); + return self._getPartitionReplicasEventList(partitionId, startTimeUtc, endTimeUtc, options, optionalCallback); } } /** - * @summary Deletes the volume resource. + * @summary Gets all correlated events for a given event. * - * Deletes the volume identified by the name. + * The response is list of FabricEvents. * - * @param {string} volumeResourceName Service Fabric volume resource name. + * @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 * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteVolumeResourceWithHttpOperationResponse(volumeResourceName, options) { + getCorrelatedEventListWithHttpOperationResponse(eventInstanceId, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteVolumeResource(volumeResourceName, 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); } @@ -69870,14 +68176,19 @@ class ServiceFabricClient extends ServiceClient { } /** - * @summary Deletes the volume resource. + * @summary Gets all correlated events for a given event. * - * Deletes the volume identified by the name. + * The response is list of FabricEvents. * - * @param {string} volumeResourceName Service Fabric volume resource name. + * @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 * @@ -69888,7 +68199,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. * @@ -69896,13 +68207,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. */ - deleteVolumeResource(volumeResourceName, options, optionalCallback) { + getCorrelatedEventList(eventInstanceId, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -69911,14 +68222,14 @@ class ServiceFabricClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteVolumeResource(volumeResourceName, options, (err, result, request, response) => { + self._getCorrelatedEventList(eventInstanceId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteVolumeResource(volumeResourceName, options, optionalCallback); + return self._getCorrelatedEventList(eventInstanceId, options, optionalCallback); } }